Terraform doesn't have to manage everything

It’s okay not to manage certain stateful resources with Terraform.

For example, the Terraform EKS module ignores node group’s desired_size because cluster autoscalers usually manage it.

Another example I’ve run into is managing RDS clusters in Terraform. Once you do a failover outside of Terraform, which will happen regardless of whether or not you want it to, the state is out of sync. Terraform will then try crazy things to get it back into the old state, which might involve destroying your database instances.

If you find yourself trying too hard to get something to work because it has to be in IaC, maybe take a step back to consider whether it has to be.


Master GitHub Actions with a Senior Infrastructure Engineer

As a senior staff infrastructure engineer, I share exclusive, behind-the-scenes insights that you won't find anywhere else. Get the strategies and techniques I've used to save companies $500k in CI costs and transform teams with GitOps best practices—delivered straight to your inbox.

Not sure yet? Check out the archive.

Unsubscribe at any time.