TerraformAzureSRE
Terraform count vs for_each: removing one item destroys the rest of the list
Removing one item from a count list re-indexes everything after it, so Terraform replaces them. Switch to for_each and move state with moved blocks.
State, plans, modules and drift: Terraform in real life, beyond the happy path.
4 postsRSS feed
Removing one item from a count list re-indexes everything after it, so Terraform replaces them. Switch to for_each and move state with moved blocks.
A dev plan that renames prod resources is reading prod's state. Read the plan, find the backend key, and re-init with -reconfigure, not -migrate-state.
sensitive = true only hides values in plan output. How a prod password reaches a CI log, how to confirm it without printing it, and how to rotate it.
"Error acquiring the state lock" or "state blob is already locked": read Lock Info, prove the holder is dead, run terraform force-unlock ID, then clean up.