In a Terraform-based CI/CD pipeline, what does drift detection mean?
Think about what happens if someone changes the cloud setup manually, not through Terraform.
Drift detection means identifying when the real infrastructure differs from what Terraform expects, usually because of manual changes outside Terraform.
What output will Terraform show if the actual infrastructure has drifted from the last applied state?
terraform plan
Terraform plan shows what it will do to match the real infrastructure to the code.
If drift exists, terraform plan will show the changes needed to bring infrastructure back in sync with the code.
Where in a CI/CD pipeline should you add drift detection to catch manual changes early?
Think about catching problems before making new changes.
Running 'terraform plan' before applying changes helps detect drift early and prevents applying unexpected changes.
You suspect drift in your infrastructure, but running terraform plan shows no changes. What could cause this?
Think about what Terraform uses to compare infrastructure state.
If the state file is outdated or corrupted, Terraform cannot detect drift correctly and may show no changes.
In a multi-environment setup (dev, staging, prod), what is the best practice to automate drift detection?
Think about proactive monitoring and alerting.
Regular automated 'terraform plan' runs with state refresh help detect drift early and alert teams to fix it before problems grow.