L5. AWS IAM: Users, Groups, Roles, and Policies
Course outlineLesson 5 of 18
AWS Identity and Access Management (IAM) controls who can do what in your AWS account. The Cloud Practitioner exam tests IAM users, groups, roles, policies, and the principle of least privilege.
What Is AWS IAM?
AWS Identity and Access Management (IAM) is a global service that controls authentication (who you are) and authorization (what you can do) in AWS. IAM is free.
IAM Components
IAM Users: individual identities for people or applications that need access to AWS. A user can have a console password, access keys for API/CLI access, both, or neither. Prefer federation through IAM Identity Center for workforce access rather than creating long-term IAM user credentials. IAM Groups: collections of IAM users. Permissions assigned to a group apply to all members. Groups make managing permissions at scale easier. IAM Roles: identities that can be assumed by AWS services, users, or applications. Roles use temporary credentials (no long-term password or access key). Roles are the recommended way to grant permissions to AWS services. IAM Policies: JSON documents that define allowed or denied actions. Identity-based policies are attached to users, groups, or roles. Resource-based policies, such as S3 bucket policies, are attached to resources.Policy Structure
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": ["s3:GetObject", "s3:PutObject"],
"Resource": "arn:aws:s3:::my-bucket/*"
}
]
}Key policy elements: Effect (Allow/Deny), Action (API operation), Resource (ARN).
IAM Best Practices
- Reserve the root user for tasks that require it; use federated workforce access through IAM Identity Center for everyday tasks
- Enable MFA on the root account and privileged users
- Grant least privilege: give only the minimum permissions needed
- Use roles for applications on EC2, Lambda, and other services (not access keys)
- Prefer temporary credentials; review and remove unused access keys and update required long-term keys when needed
- Use IAM Access Analyzer to identify external access and unused permissions
IAM Policy Evaluation Logic
When multiple policies apply, AWS evaluates them as follows:
- Explicit Deny: if any policy denies the action, it is denied
- Applicable Allow: the required policies must allow the action within permissions boundaries, session policies, and organization guardrails. A single Allow is not sufficient in every context
- Implicit Deny: without the required Allow, the action is denied
For cross-account S3 access, both the resource policy in the bucket account and the identity policy in the requester account must allow the action. A bucket policy alone is not a cross-account exception. SCPs and permissions boundaries limit permissions; they do not grant them.
Root Account vs. IAM Users
| Feature | Root Account | IAM User |
|---|---|---|
| Created when | Account sign-up | By administrator |
| Permissions | Broad account access, subject to applicable controls | Only if granted |
| Can be restricted | Member-account root is subject to organization SCPs | Yes (via policies) |
| Recommended use | Tasks requiring root only | Specific cases needing long-term credentials; prefer workforce federation |
Continue Learning
Apply these rules in S3 data protection, including cross-account bucket access.
References
- ✓IAM Users have long-term credentials; IAM Roles use temporary credentials and are preferred for services
- ✓IAM Groups contain users; permissions assigned to a group apply to all members
- ✓Policies are JSON documents defining Allow or Deny for specific Actions on specific Resources
- ✓Explicit Deny always overrides Allow; no explicit Allow = implicit Deny
- ✓Never use the root account for daily tasks; enable MFA on root and privileged accounts
1. An EC2 instance needs to read objects from an S3 bucket. What is the AWS-recommended way to grant this permission?
2. A user is explicitly allowed to perform an action by one policy, but another policy explicitly denies the same action. What happens when the user attempts the action?