AWS policy example library

15 worked examples for common AWS access problems. Each one starts from a real situation and gives the policies, how to deploy them, checks that change nothing in your account, the mistakes people make, and the limits of the approach.

Examples use AWS's documented placeholder values (account 111122223333, bucket amzn-s3-demo-bucket). Replace them, then test in your own account before use. Policy types matter; each example is labelled:

  • IAM identity-based policy. Attached to an IAM user, group or role. Grants that identity permissions. Has no Principal element.
  • Amazon S3 bucket policy. A resource-based policy attached to one bucket. Must name a Principal; resources must be the bucket or its objects.
  • IAM role trust policy. The resource-based policy on a role that says who may assume it. Names a Principal; has no Resource element.
  • Service control policy (SCP). An AWS Organizations guardrail on member accounts. Never grants permissions; has no Principal element.

Browse examples

Showing 15 of 15 examples

New to policy design? Start with the least-privilege guide or the Learning Center.