Question 500
A CI rule needs to fail on invalid Terraform configuration but must never apply or destroy infrastructure. Which Terraform concept most directly explains the appropriate approach?
Explanation
Correct Answer
Add terraform validate as a non-mutating CI gate. The pipeline rejects invalid configuration without calling resource mutation operations.
Incorrect Answers
Require approval before the Terraform apply stage or enforce workspace run policies. Syntax/schema validation can be automated separately from apply permissions.
Generate a plan and inspect its JSON representation using terraform show -json under controlled handling. Add terraform validate as a non-mutating CI gate.
Run terraform init with suitable CI flags and the committed dependency lock file. Syntax/schema validation can be automated separately from apply permissions.