Interview Prep/Terraform/CI/CD and Automation

How do you set up drift detection in CI?

IntermediateProductionCI/CD and Automation
Answer

A scheduled workflow runs terraform plan -detailed-exitcode -lock=false for each stack. Exit 2 opens a ticket or posts to Slack with the plan summary; exit 1 pages the owner. -lock=false avoids blocking real applies, and a read-only role is enough. HCP Terraform's health assessments or Spacelift's drift detection do the same without writing the pipeline.

All Terraform questions Roadmap: Terraform in production

More on CI/CD and Automation