IAM Users
Overview
AWS Identity and Access Management (IAM) is the global service that controls who can do what on which resources in your AWS account. An IAM user is an identity you create inside an account to represent a person or an application. It has a name, optional console password, optional access keys for the CLI/SDK, and permissions that come from attached policies.
Every account also has a special root user, the email address used to create the account. The root user has unrestricted power and cannot be limited by IAM policies, so it must be protected with MFA and used only for the few tasks that require it.
IAM is free, global (not tied to a Region) and the very first service to master: every other AWS service call is authorised by IAM. Today AWS recommends IAM Identity Center or federation for human users and roles for applications, using long-lived IAM users only when there is no alternative.
Key Concepts
- Root user: created with the account, has complete access, cannot be restricted by IAM policies; protect with MFA and avoid daily use.
- An IAM user is a permanent identity with long-term credentials: a password (console) and/or up to 2 access keys (CLI/SDK/API).
- A new IAM user has no permissions by default (implicit deny) until a policy is attached.
- Each user has a unique ARN (
arn:aws:iam::123456789012:user/alice) and a user ID. - MFA adds a second factor: virtual authenticator app, FIDO2 security key (passkey) or hardware TOTP token; up to 8 MFA devices per user.
- An account password policy sets length, complexity, expiry, reuse prevention and whether users can change passwords.
- Default quota: 5,000 IAM users per account; each user can be in up to 10 groups and has 2 access keys.
- Access keys start with AKIA (long-term); temporary STS credentials start with ASIA.
- For workforce users prefer IAM Identity Center (SSO) so people get temporary credentials instead of long-lived keys.
Detailed Notes
Root user vs. IAM user
| Root user | IAM user | |
|---|---|---|
| Created | When you open the account | By an administrator |
| Sign-in | Account email + password | Account ID/alias + user name + password |
| Permissions | Everything, cannot be restricted by IAM or permission boundaries (SCPs can limit member-account root users) | Only what attached policies allow |
| Quantity | One per account | Up to 5,000 |
| Use | A handful of tasks only | Day-to-day work (better: Identity Center / roles) |
Tasks that require the root user
- Change account settings (account name, email, root password, root access keys).
- Close the AWS account.
- Change or cancel the AWS Support plan.
- Restore IAM user permissions when the last admin locked themselves out.
- Activate IAM access to Billing data (first time).
- Edit or delete an S3 bucket policy that denies all principals; enable MFA Delete on a bucket.
- Register as a seller in the Reserved Instance Marketplace; some GovCloud/China sign-up steps.
In an AWS Organizations environment you can now centralise root-credential management and remove root credentials from member accounts, performing privileged root tasks through short-lived, task-scoped sessions.
Credentials of an IAM user
| Credential | Used for | Notes |
|---|---|---|
| Console password | AWS Management Console | Governed by the account password policy |
| Access key ID + secret | CLI, SDK, API | Max 2 per user (to allow rotation); secret shown only once |
| MFA device | Second factor | Up to 8 devices; virtual, FIDO security key or hardware token |
| SSH public keys / Git credentials | CodeCommit (legacy) | Rarely tested |
| Server certificates | Legacy HTTPS | Use ACM instead |
Password policy options
Minimum length (6–128, default 8), require uppercase / lowercase / numbers / symbols, password expiry (up to 1,095 days), prevent reuse (up to 24 previous passwords), and whether users can change their own password.
Creating a user with the CLI
# Create the user and a console password that must be changed at first login
aws iam create-user --user-name alice
aws iam create-login-profile --user-name alice \
--password 'Temp#Passw0rd!' --password-reset-required
# Programmatic access (only if truly needed)
aws iam create-access-key --user-name alice
# Put the user in a group to inherit permissions
aws iam add-user-to-group --user-name alice --group-name Developers
Rotating access keys safely
- Create the second access key for the user.
- Update applications to use the new key.
- Check the old key's last used timestamp:
aws iam get-access-key-last-used --access-key-id AKIAIOSFODNN7EXAMPLE
- Make the old key inactive, test, then delete it.
Identifying who has what
- Credential report: CSV of all users with password age, MFA status, key age and last use — generate it with
aws iam generate-credential-report. - IAM Access Advisor: last-accessed information per service for a user/role, used to trim unused permissions.
- IAM Access Analyzer: finds external access to resources and can generate least-privilege policies from CloudTrail activity.
Users in a modern architecture
| Need | Recommended identity |
|---|---|
| Employees using console/CLI | IAM Identity Center (SSO) or federation with corporate IdP -> temporary credentials |
| Application on EC2/ECS/Lambda | IAM role (no keys) |
| CI/CD pipeline (GitHub Actions) | OIDC federation into a role |
| On-premises server that cannot assume roles | IAM Roles Anywhere, or as a last resort an IAM user with rotated keys |
| Customers of your mobile/web app | Amazon Cognito |
Sign-in details
- Users sign in at
https://<account-id-or-alias>.signin.aws.amazon.com/console. You can create an account alias to make the URL friendlier. - The root user signs in with the email address.
- IAM users cannot create other IAM users unless permitted and cannot change their own permissions.
Limits at a glance
| Item | Default |
|---|---|
| IAM users per account | 5,000 |
| Groups per user | 10 |
| Access keys per user | 2 |
| MFA devices per user | 8 |
| Managed policies attached per user | 10 (adjustable to 20) |
| Inline policy size per user | 2,048 characters (excluding whitespace) |
Real World Example
Scenario — onboarding a data analyst at a logistics company.
A logistics firm hires a data analyst who needs to run Athena queries on shipment data in S3 and view dashboards in QuickSight. Historically IT created a shared "analyst" IAM user whose password and access keys were passed around, and nobody knew who ran which query.
The cloud team replaces that with an individual identity for each person. The analyst is created in the corporate directory and assigned to the "Analytics" group, which maps to a permission set in IAM Identity Center. She signs in with SSO and MFA, receives temporary credentials for the AnalyticsReadOnly role, and every Athena call is attributed to her name in CloudTrail.
For the one legacy on-premises batch job that cannot use SSO, the team creates a dedicated IAM user with a single policy limited to one S3 prefix, stores its key in Secrets Manager, and schedules a 90-day rotation. A weekly credential report check alerts on users without MFA or with keys older than 90 days, and the root user is locked in a vault with hardware MFA.
Architecture Diagram
The root user sits above everything; day-to-day access goes through IAM users (or SSO) that must pass MFA and policy checks.
- 1A user signs in with a password plus MFA, or a script signs requests with an access key.
- 2IAM authenticates the identity and gathers all policies that apply.
- 3The request is authorised only if an explicit Allow exists and no Deny applies.
- 4On success the service (here S3) performs the action and CloudTrail records the call.
Best Practices
- ✓Lock down the root user: strong unique password, MFA (hardware/FIDO key), no access keys, and use it only for tasks that need it.
- ✓Create individual users (or SSO identities) for every person — never share credentials.
- ✓Require MFA for all human users and enforce it with a policy condition (
aws:MultiFactorAuthPresent). - ✓Avoid long-lived access keys; if unavoidable, rotate every 90 days, delete unused keys and never embed them in code or Git.
- ✓Set an account password policy with sufficient length and reuse prevention.
- ✓Review the credential report and Access Advisor regularly and remove unused users, passwords and keys.
- ✓Prefer IAM Identity Center / federation for workforce access and roles for workloads.
- ✓Grant least privilege by attaching policies to groups, not directly to users.
Common Interview Questions
Exam Tips
SAA-C03 focus
- Root user: enable MFA, no access keys, use rarely. Tasks like closing the account or changing the support plan need root.
- A new IAM user has no permissions (implicit deny). Permissions come from policies attached to the user or its groups.
- IAM is global: users and policies are not Region-specific.
- "Application on EC2 needs AWS access" -> IAM role, never access keys on the instance.
- "Workforce SSO to multiple accounts" -> IAM Identity Center; "mobile/web app customers" -> Cognito.
- Credential report = account-level list of all users and credential status; Access Advisor = last service access per identity.
- Limits: 5,000 users, 10 groups per user, 2 access keys per user.
- Access key ID prefix AKIA = long-term; ASIA = temporary credentials from STS.
Finished this lesson?
0 of 64 lessons done · 0% of the course

