Interview Prep/Real-World Interview/Cloud provider issues

A new Lambda deploy fails with "AccessDeniedException: User: arn:aws:sts::1234:assumed-role/deployer/ci is not authorized to perform: lambda:UpdateFunctionCode ... with an explicit deny in a service control policy".

IntermediateTroubleshootingCloud provider issues
Answer

Likely causes → An organization SCP denies the action, regardless of what the IAM role allows. Typical SCPs block regions outside an allow list, require specific tags, or deny changes unless done by an approved role. The message names "service control policy", so editing the role won't help.

Diagnose →

aws organizations list-policies-for-target --target-id $ACCOUNT_ID --filter SERVICE_CONTROL_POLICY
aws organizations describe-policy --policy-id p-abc123 --query 'Policy.Content' --output text | jq

Check the conditions against the request: region, role ARN pattern, tags, MFA.

Fix → Meet the policy's condition (deploy in an allowed region, use the approved role name, add required tags), or ask the platform team to adjust the SCP through their change process.

Prevent → Publish SCP guardrails and test new pipelines in a sandbox account under the same OU, so policy surprises show up before production.

All Real-World Interview questions Roadmap: Interview readiness

More on Cloud provider issues