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.

Join the 80/20 DevOps Newsletter

If you're an engineering leader or developer, you should subscribe to my 80/20 DevOps Newsletter. Give me 1 minute of your day, and I'll teach you essential DevOps skills. I cover topics like Kubernetes, AWS, Infrastructure as Code, and more.

Not sure yet? Check out the archive.

Unsubscribe at any time.