Not kidding: having to change - or even worse, add - anything to my team's Terraform files gives me real, serious anxiety.
As someone who's been strictly a developer for all of my 15-year career, infrastructure just doesn't "click" with me. It's a bunch of arbitrary concepts each with tons of arbitrary properties. There's no cohesive logic to it, and I find it impossible to form a mental model of those things.
I'm currently responsible for creating a new service, and because I have to add a lot of new Terraform definitions to those files, I've literally been avoiding work these last few days. I can't reason about it. Even if I write something, it's annoying me to no end that I can't look at it and analyze whether it's complete and sound. All I can do is trial and error.
I understand individual concepts (like what AWS ECS and ECR, or Elasticache, or whatever), but the "glue" looks so inscrutable. Sometimes two things are connected together by a "chain" of definitions, but it's not really a chain because it's really hard to read those files and understand the association between components.
Does anyone else suffer from the same problem? How can I get better at this?
I recommend turning the TF_LOG environment variable all the way up so you get super verbose logging. Then you can actually see what terraform is doing and it actually isn't too bad. It makes a bunch of calls to AWS one by one.
My guess is you just haven't worked with infrastructure that much so it is familiarity problem. You are also using a tool that has a very high level of abstraction. So getting more familiar with how infrastructure is setup (even manually) will help.
Some other things:
- Visualizing things by drawing things out can help - Keep the AWS web console open and you can see Terraform creating the resources on the fly by refreshing