ladderlore
Request a guide
  • Type a service name, like S3 or IAM.

Concept

IAM policies

JSON documents that allow or deny actions on AWS resources, and how AWS decides between them.

  • AWS managed policy

    Who writes it
    AWS, which also updates it
    Attached to
    Many users, groups and roles
    Best for
    Common jobs, as a starting point
  • Customer managed policy

    Who writes it
    You. It is a custom policy.
    Attached to
    Many users, groups and roles in your account
    Best for
    Exactly the permissions a task needs
  • Inline policy

    Who writes it
    You
    Attached to
    One user, group or role only
    Best for
    Permissions that belong to one identity only. They are deleted with it.
  • Resource-based policy

    Who writes it
    You
    Attached to
    A resource, such as an S3 bucket
    Best for
    Saying who may use the resource, even from another account
The four policy types to know.

1 / 2

  • AWS managed policy

    Who writes it
    AWS, which also updates it
    Attached to
    Many users, groups and roles
    Best for
    Common jobs, as a starting point
  • Customer managed policy

    Who writes it
    You. It is a custom policy.
    Attached to
    Many users, groups and roles in your account
    Best for
    Exactly the permissions a task needs

2 / 2

  • Inline policy

    Who writes it
    You
    Attached to
    One user, group or role only
    Best for
    Permissions that belong to one identity only. They are deleted with it.
  • Resource-based policy

    Who writes it
    You
    Attached to
    A resource, such as an S3 bucket
    Best for
    Saying who may use the resource, even from another account
The four policy types to know.
Does any policy deny it?
Denied
Does any policy allow it?
Allowed
Denied by default
yesnoyesno
How AWS decides on a request within one account. An explicit deny always wins.

What it is

A policy is a document, written in the JSON text format, that sets permissions. Each statement in it has an effect (Allow or Deny), the actions it covers, the resources they apply to and, if needed, conditions, such as “only when the user signed in with MFA”. AWS denies every request from a user or role unless a policy allows it, and an explicit deny always wins.

What it is

Most policies are identity-based: you attach them to a user, a group or a role. AWS managed policies are written and kept up to date by AWS for common jobs. Customer managed policies are custom policies that you write yourself and can attach to many identities. An inline policy belongs to exactly one identity and is deleted with it.

A resource-based policy is attached to a resource instead, such as a bucket policy on an Amazon S3 bucket. It names who may use the resource, and that can include identities in other AWS accounts.

Remember

  • Statement = effect + action + resource, plus an optional condition.
  • Everything starts denied. An explicit Deny overrides any Allow.
  • AWS managed policies are a quick start, but often broader than a task needs.
  • Customer managed policies let you grant exactly what a task needs.

Remember

  • Attach policies to groups and roles rather than to single users.
  • Service control policies (SCPs) in AWS Organizations set the most that users and roles in an account can do. They never grant permissions.

On the exam

  • “A policy created and maintained by AWS” is an AWS managed policy. “A reusable policy that you write for your own needs” is a customer managed policy.
  • “One policy allows the action and another policy denies it” means the request is denied.