Interview Prep/AWS/IAM and Access Errors

An SCP is suspected of denying actions but console errors are vague. How do you confirm?

AdvancedTroubleshootingIAM and Access Errors
Answer

Likely causes → Explicit deny from SCP shows in the error text of recent API versions and in CloudTrail.

Diagnose →

aws cloudtrail lookup-events --lookup-attributes AttributeKey=EventName,AttributeValue=RunInstances --max-results 5
aws organizations describe-effective-policy --policy-type SERVICE_CONTROL_POLICY --target-id 111111111111
aws organizations list-policies-for-target --target-id ou-xxxx --filter SERVICE_CONTROL_POLICY

Fix →

  1. Adjust the SCP, test in a sandbox OU first
  2. Use an exception for the required principal via condition keys

Prevent → Keep SCPs in IaC with a test suite of allowed and denied calls.

aws All AWS questions Roadmap: AWS core services

More on IAM and Access Errors