How do you roll back a bad Terraform change?
AdvancedProductionCI/CD and Automation
Answer
Terraform has no rollback; you roll forward with a code revert. git revert the commit, review the plan (it should undo the change), apply. Some changes cannot be undone: deleted databases or replaced stateful resources need restore from snapshot or backup. This is why we gate destructive actions, enable deletion protection and review replacements carefully.
More on CI/CD and Automation
Why run Terraform from a pipeline instead of laptops?BeginnerWhat stages does a good Terraform pull-request pipeline have?BeginnerHow do you make sure the apply runs exactly what was reviewed?IntermediateHow do you serialize applies to the same stack in CI?AdvancedShow a minimal GitHub Actions workflow for plan on PR.BeginnerHow does OIDC authentication from GitHub Actions to AWS work?Intermediate