Why this matters
Automated, reproducible plans and policy checks reduce risk before apply.
CI must run fmt/validate, produce and upload a plan artifact (e.g., terraform plan -out plan.bin), run policy-as-code (e.g., tfsec/checkov/conftest), and gate apply on manual approval for prod.
Automated, reproducible plans and policy checks reduce risk before apply.
Side-by-side examples engineers can pattern-match during review.
steps:
- run: terraform apply -auto-approve
steps:
- run: terraform fmt -check && terraform validate
- run: terraform plan -out plan.bin
- run: tfsec . && checkov -d .
- upload-artifact: plan.bin
- environment: prod
run: terraform apply plan.bin # requires manual approval
terraform plan -out plan.bin
# upload artifactterraform apply -auto-approveFrom the same buckets as this rule.