Interview Prep/Terraform/Partial Applies, Version Mismatches and CI Failures

PR plans pass, but the post-merge apply fails because the plan role is read-only and the apply role lacks a permission that the new resource needs.

AdvancedTroubleshootingPartial Applies, Version Mismatches and CI Failures
Answer

Likely causes → Plans only need read/describe permissions; create/update permissions are first exercised at apply. A new resource type (for example aws_wafv2_web_acl) isn't in the apply role.

Diagnose → The apply error names the denied action (AccessDenied ... wafv2:CreateWebACL); decode with aws sts decode-authorization-message if encoded.

Fix → Add the permissions to the apply role (through its own IAM pipeline) and re-run apply. The partial apply resumes.

Prevent → Apply new resource types in a dev account with the same role definition first; review role changes alongside infrastructure PRs.

All Terraform questions

More on Partial Applies, Version Mismatches and CI Failures