2.2 AWS Identity and Access Management (IAM)

Key Takeaways

  • IAM is a global service (not Region-specific) that controls who can access what in your AWS account.
  • The root user has unrestricted access and should be secured with MFA and used only for tasks that require it (like changing billing info).
  • IAM follows the principle of least privilege — grant only the permissions needed to perform a task, nothing more.
  • IAM policies are JSON documents that define Allow or Deny permissions for specific actions on specific resources.
  • IAM roles are used for temporary access and are the recommended way to grant permissions to AWS services and applications.
Last updated: March 2026

AWS Identity and Access Management (IAM)

Quick Answer: AWS IAM is a free, global service that controls who (authentication) can do what (authorization) in your AWS account. Key components: Users (people), Groups (collections of users), Roles (temporary permissions for services/apps), and Policies (JSON documents defining permissions). Always follow the principle of least privilege.

IAM Overview

AWS Identity and Access Management (IAM) is one of the most important AWS services for the exam. It enables you to securely manage access to AWS services and resources.

Key Facts:

  • IAM is free — there is no charge for using IAM
  • IAM is global — it is not Region-specific (users, groups, roles, and policies apply across all Regions)
  • IAM supports MFA (Multi-Factor Authentication) for additional security
  • IAM provides centralized control of your AWS account

The Root User

When you first create an AWS account, you create a root user with the email and password used to sign up. The root user has complete, unrestricted access to everything in the account.

Root User Best Practices

DoDon't
Enable MFA on the root user immediatelyUse the root user for everyday tasks
Create an IAM admin user for daily workShare root user credentials
Store root user credentials securelyCreate access keys for the root user
Use root only for root-specific tasksLeave MFA disabled on root

Tasks That REQUIRE the Root User

  • Change account settings (name, email, root password)
  • Change AWS Support plan
  • Close the AWS account
  • Restore IAM user permissions (if the only IAM admin is locked out)
  • Configure an S3 bucket for MFA delete
  • View certain tax invoices

IAM Components

IAM Users

An IAM user represents a person or service that interacts with AWS. Each user has:

  • A unique name within the account
  • Credentials: password (for console access) and/or access keys (for CLI/API access)
  • Permissions: defined by attached policies

Best Practice: Create individual IAM users for each person who needs access. Never share credentials.

IAM Groups

An IAM group is a collection of IAM users. Groups make it easier to manage permissions for multiple users.

FeatureDetail
Groups contain users onlyGroups cannot contain other groups
A user can belong to multiple groupsNo limit on groups per user
Groups cannot be used for authenticationOnly for organizing permissions
No default groupAll users must be explicitly added

Example Groups: Administrators, Developers, Finance, ReadOnlyUsers

IAM Roles

An IAM role is similar to a user but is intended to be assumed by anyone or anything that needs it. Roles provide temporary security credentials.

Common use cases for roles:

Use CaseExample
EC2 instance accessing S3Attach a role to the EC2 instance instead of storing access keys
Cross-account accessAllow users in Account A to access resources in Account B
AWS service to serviceLambda function accessing DynamoDB
Federated usersExternal users (SAML/OIDC) accessing AWS through identity providers

On the Exam: When a question asks how to grant an AWS service (like EC2 or Lambda) permission to access another service (like S3 or DynamoDB), the answer is almost always an IAM role.

IAM Policies

IAM policies are JSON documents that define permissions. They specify what actions are allowed or denied on which resources.

Policy structure:

  • Version — Policy language version (always "2012-10-17")
  • Statement — One or more individual permission statements
    • Effect — "Allow" or "Deny"
    • Action — The API action(s) being permitted or denied (e.g., s3:GetObject)
    • Resource — The AWS resource(s) the action applies to (ARN)
    • Condition (optional) — Conditions for when the policy applies

Policy Types:

TypeDescription
AWS Managed PoliciesPre-built by AWS (e.g., AmazonS3ReadOnlyAccess) — maintained by AWS
Customer Managed PoliciesCreated by you for your specific needs — you maintain them
Inline PoliciesEmbedded directly in a user, group, or role — not reusable

The Principle of Least Privilege

Least privilege means granting only the minimum permissions necessary for a user, group, or role to perform their required tasks. This is a fundamental security principle in AWS.

Example: If a developer only needs to read objects from a specific S3 bucket, their policy should only allow s3:GetObject on that specific bucket — NOT s3:* on all buckets.

Multi-Factor Authentication (MFA)

MFA adds an extra layer of security by requiring:

  1. Something you know — Password
  2. Something you have — MFA device (virtual or hardware)

MFA options in AWS:

MFA TypeDescription
Virtual MFA deviceApp on your phone (Google Authenticator, Authy)
Hardware TOTP tokenPhysical key fob that generates codes
FIDO2 security keyPhysical USB/NFC key (e.g., YubiKey)

On the Exam: Always enable MFA on the root account. MFA is a best practice for all IAM users with console access, especially administrators.

IAM Best Practices Summary

  1. Lock away the root user — Enable MFA, do not use for daily tasks
  2. Create individual IAM users — One user per person, never share
  3. Use groups to assign permissions — Easier to manage than individual user policies
  4. Use roles for AWS services — Never embed access keys in code
  5. Grant least privilege — Start with minimum permissions, add as needed
  6. Enable MFA everywhere — Especially for privileged accounts
  7. Rotate credentials regularly — Change passwords and access keys
  8. Use IAM Access Analyzer — Identify resources shared with external entities
  9. Use AWS Organizations — Manage multiple accounts with service control policies
Test Your Knowledge

Which IAM component should you use to grant an EC2 instance permission to access an S3 bucket?

A
B
C
D
Test Your Knowledge

What is the principle of least privilege?

A
B
C
D
Test Your Knowledge

Which of the following tasks REQUIRES the AWS account root user?

A
B
C
D
Test Your Knowledge

IAM is a global service. What does this mean?

A
B
C
D