Interview Prep/Terraform/Authentication and Cloud API Errors

`AccessDenied ... with an explicit deny in a service control policy`.

IntermediateTroubleshootingAuthentication and Cloud API Errors
Answer

Likely causes → An Organizations SCP blocks that action/region/resource (for example, deny outside approved regions, deny creating IAM users, deny without tags).

Diagnose → The error names the SCP deny; ask the platform team for the SCP, or check aws organizations list-policies-for-target with access to the management account.

Fix → Change your code to comply (region, tags) or request an approved exception. You can't bypass an SCP from the account.

Prevent → Publish SCP guardrails to teams and encode them as policy-as-code checks (OPA/Sentinel/Checkov) that fail in PR.

All Terraform questions

More on Authentication and Cloud API Errors