by thedeusx · 5y ago · 0 comments
The author, a "Director of Consulting" might want to do some training (Both Hashicorp and Microsoft have free training).
Why in the hell would you have the same statefile for different environments? Why would you have these environments in the same Azure subscription? Why would you run your terraform so infrequently that you'd forget about a botched statefile move? Why would you not read TERRAFORM PLAN (It's LITERALLY WHAT TERRAFORM DOES)?
I also suspect that while the author's probably heard of a CI/CD pipeline, they're running their IaC from their local machine, given the tone of the article.
Why, for a production database that contains information not contained elsewhere, would you not configure an Azure Recovery Services Vault?
Like I get it, people make mistakes. I once did something similar with an overenthusiastic use of terraform destroy, but this guy just seems like an absolute cowboy who doesn't really know what he's doing.
It’s the same with something like a programming language where there are thousands of best practices and foot guns, but infrastructure as code is more dangerous and much newer. There are also less books, venues and even training courses to learn these practices.
There are also a vanishingly small set of engineers who have actually done this in production at scale so it can be hard to find experienced people.
In several firms I've worked in now someone missing so many things wouldn't be above consultant level, and wouldn't be approving PRs let alone deleting a live prod off from their local laptop without some significant questions being asked.
I get everyone must learn things, but when you position yourself as a technical expert (Director, in this case) you should have enough experience to be a bit more thorough with your work so if a mistake happens, there's a way out, or just not make what amounts to several design and implementation mistakes.
Part of what I think makes this a little egregious is the author didn't f** up his own systems, he f**'d his clients. I'd understand a little more if it were "I'm the in-house guy upskilling" rather than "look at this mistake I made as a (presumably) highly paid outside consultant literally brought in to make sure stuff like this doesn't happen".
However, I still must give absolute kudos for sharing mistakes publicly. We all do make mistakes, and most people try and hide it. When the author realised there was an issue, every step after that was handled like a pro.
I do however think that Terraform should have a first class support for different environment without the need of a wrapper to facilitate that.
https://www.terraform.io/docs/language/state/workspaces.html
> Certain backends support multiple named workspaces, allowing multiple states to be associated with a single configuration. The configuration still has only one backend, but multiple distinct instances of that configuration to be deployed without configuring a new backend or changing authentication credentials.
You might want to actually read the entire blog post before going off on a tirade.
I am not OP btw.
> Why, for a production database that contains information not contained elsewhere
* This is a dev environment - the one that he uses to to dev work where its perfectly okay to corrupt, which is why dev environments exists.
> Why would you run your terraform so infrequently that you'd forget about a botched statefile move?
* Why on earth is it surprising to you that theres a dev environment sitting somewhere that could be unused for some time?
> I also suspect that while the author's probably heard of a CI/CD pipeline, they're running their IaC from their local machine
* It is perfectly okay to develop and test changes on a local dev environment before putting it on a CI/CD pipeline. OP mentions that there is an Azure Devops pipeline in place.
> this guy just seems like an absolute cowboy who doesn't really know what he's doing.
* In dev yes. He clearly does know what he is doing.
This of course would never happen with AWS and cloudformation changesets. OP is sharing gotchas that arise when using Azure and Terraform, this is useful.