What do you do when an apply fails halfway in the pipeline?
AdvancedProductionCI/CD and Automation
Answer
Do not panic and do not re-run blindly. Read the error and the partial result: Terraform already recorded what it created. Check the lock was released, fix the cause (permissions, quota, name collision, API error) and re-run the same plan or a fresh plan after review. If the lock is stuck, force-unlock after confirming the process died. Never state rm to "make it go green".
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