AWS Compare High-frequency comparison

Root User, IAM User, Group, Policy, and Role

Root User, IAM User, Group, Policy and Role

compareIAMSecurityAWS
Last organized

Distinguishes identities, user collections, permission rules, and assumable temporary identities.

In one sentence

A user is an identity, a group organizes users, a policy describes permissions, and a role is an assumable identity that provides temporary permissions.

Comparison

ObjectMeaningMain use
Root UserThe account’s inherent identityRecovery and root-only tasks
IAM UserA long-term identity inside one accountLimited legacy or compatibility cases
IAM GroupA permission-management collection of IAM usersShared job-role permissions
IAM PolicyA JSON permissions documentEffect, Action, Resource, and Condition
IAM RoleAn assumable permissions identityWorkloads, cross-account access, temporary access
IAM Identity CenterWorkforce access across accountsSSO and permission sets

Exam rules

Groups contain users only, cannot contain groups, cannot sign in, and cannot be assumed. A user may belong to multiple groups and inherits all applicable group policies. An applicable explicit Deny still overrides Allow.

Managed policies can attach to users, groups, or roles. Inline policies can be embedded in one user, group, or role. Policies are not identities, and identity-based policies do not contain Principal.

Scenario choices

Use a group for shared user permissions, a role for EC2-to-S3 access, IAM Identity Center for workforce multi-account access, Cognito for application customers, and root only for required root tasks.

The three essential parts of a role

PartPurpose
Trusted entity / trust policyDefines who can assume the role
Permissions policyDefines which actions and resources the role session may use
STS temporary credentialsSupplies an expiring access key ID, secret access key, and session token

EC2 uses a role through an instance profile, so creating the role alone is not enough—it must be associated with the instance. An operator passing a role to EC2, Lambda, or another service normally needs iam:PassRole. PassRole means “give the role to a service”; AssumeRole means “the principal uses the role.”