Hello, first time posting.
Recently we saw an interesting issue during a recent Terraform-Jenkins deployment.
So we have the following commits
Base Commit: (Version that our TF state is on before deployment)
Commit A: Adds a new AWS region to our provider as part of region expansion
Commit B: Spins up autoscaling cache
Commit C: Adds env variables to an ECS cluster’s tasks
When we went directly from Base Commit to Commit C, we observed that Terraform attempts to replace (delete and create) certain resources like our ECS ALB Target Group, among other additions that were expected. This is definitely not what we want, as it would knock out traffic to our containers.
Instead, when we went from Base Commit to Commit A, then Commit A to Commit C, we ONLY saw the additions, (no +/- or -/+)
We are using terraform version 0.13.7, has anyone seen this occur or have an explanation on why terraform may choose to delete resources if the commits are batched? Our expectation was that no matter if we went Base → C vs Base → A → C, terraform should have done the same thing (strictly add resources)