Attach permissions to the identity doing the work
How policies assigned through users, groups, and roles define least-privilege permissions using actions, resources, conditions, and explicit denies. · associate
An identity-based policy is a JSON document that defines permissions for an IAM user, group, or role. Attach a policy directly to a user for individual permissions, or to an IAM group to give its member users a shared set of permissions. A group is a collection of users, not an identity that signs in or makes requests.
A role has its own permissions policies. When someone assumes a role, requests made with that role session use the role's permissions; the person's user and group permissions are not carried into the session. Roles cannot belong to IAM groups. Deciding who may assume a role is separate from defining what that role may do.
A managed policy is a standalone policy that can be attached to multiple identities; an inline policy belongs to one user, group, or role. Both express permissions using the same policy language. For shared job permissions, a customer managed policy makes reuse and updates easier, but its permissions still need to be narrowly scoped.
| Attachment | Who receives permissions | Typical use |
|---|---|---|
| User | That IAM user | Individual permissions |
| Group | Member IAM users | Shared job permissions |
| Role | Sessions using the role | Workload or delegated permissions |