Interview Prep/AWS/IAM Advanced, STS and Multi-Account

How do you test whether a policy will allow an action before deploying it?

BeginnerConceptIAM Advanced, STS and Multi-Account
Answer

Use the IAM Policy Simulator (console) or the CLI, which evaluates identity policies, boundaries and optionally SCPs against a list of actions and resources.

aws iam simulate-principal-policy \
  --policy-source-arn arn:aws:iam::123456789012:role/app \
  --action-names s3:GetObject --resource-arns arn:aws:s3:::acme-data/x.csv

The simulator does not model every resource policy or condition context key, so confirm with a real call in a sandbox.

aws All AWS questions Roadmap: AWS core services

More on IAM Advanced, STS and Multi-Account