AWS · Security, Identity, and Compliance
AWS Identity and Access Management (IAM)
Controls who can do what in AWS: users, groups, roles and JSON policies evaluated on every API request.
What it is and what problem it solves
AWS Identity and Access Management (IAM) decides whether each AWS API request is allowed. A request comes from a principal (an IAM user, a role session, a federated user or an AWS service), and IAM evaluates the policies that apply: identity-based policies on the principal, resource-based policies (such as an S3 bucket policy), permission boundaries, session policies, and organisation-wide service control policies.
Everything is denied by default; an explicit Allow grants access; an explicit Deny anywhere always wins.
Roles are the preferred way to grant access: they have no long-term credentials, and whoever assumes a role (an EC2 instance, a Lambda function, a user from another account or an identity provider) receives temporary credentials from AWS STS.
When to use it
- Always: every AWS account uses IAM for access to its resources.
- Give applications on EC2, ECS and Lambda roles rather than access keys.
- Grant cross-account access by letting another account assume a role.
- Set guardrails with permission boundaries for teams that create their own roles.
When to avoid it
- Creating IAM users for your workforce in each account: use IAM Identity Center with your identity provider for single sign-on across accounts.
- Long-lived access keys in code or on laptops: use roles and temporary credentials.
- Customer and app-user sign-in: that is Cognito, not IAM.
- Organisation-wide maximum permissions: use service control policies in AWS Organizations, not policies in each account.
Scaling model and bottlenecks
IAM is global and has no capacity to manage, but quotas shape design: managed policies per role, policy document sizes and roles per account. Prefer a few well-designed roles with managed policies over many inline policies.
Limits and quotas
Policy size limits are fixed and are a common reason for splitting permissions into several managed policies or using permission sets.
| Item | Value | Context | Source |
|---|---|---|---|
| Roles per account | 1,000 Can be raised with a quota request |
Default; the maximum quota is 10,000. | Source checked |
| Managed policies attached to a role | 20 Can be raised with a quota request |
Default; the maximum is 25. | Source checked |
| Managed policies attached to a user | 10 Can be raised with a quota request |
Default; the maximum is 20. | Source checked |
| Customer managed policy size | 6,144 characters Fixed limit |
Source checked |
|
| Inline policy size for a role | 10,240 characters (total) Fixed limit |
Source checked |
|
| Role maximum session duration | 1 to 12 hours Fixed limit |
Source checked |
|
| Users per account | 5,000 Fixed limit |
Source checked |
|
| Versions per managed policy | 5 Fixed limit |
Source checked |
Quotas and limits change. Check the linked source before designing around a number.
Cost model
What you pay for
IAM itself has no charge. You pay for the AWS resources your users and roles use.
Where it is cost-efficient
Every workload: there is no reason to avoid IAM features for cost.
Where costs grow
Not applicable to IAM directly; mistakes in IAM can cause costly resource creation, which is why least privilege and guardrails matter.
Cost controls and common surprises
Use IAM conditions and service control policies to stop expensive actions (for example, launching large instance types) where they are not needed.
Prices differ by Region and change over time; see the pricing page linked under Sources.
Security
Controls the service provides
- Default deny, explicit allow, explicit deny wins.
- Temporary credentials through roles and STS; MFA for users; access analysis that finds resources shared outside your account and unused access.
- Policy conditions such as source IP, MFA present, tags, VPC endpoint and organisation ID.
What you configure
Lock away the root user (MFA, no access keys), grant least privilege, prefer roles to users, rotate or remove old access keys, use permission boundaries for delegated administration, and review findings from IAM Access Analyzer regularly.
Logging and monitoring
CloudTrail records every IAM and STS call; credential reports and last-accessed information show unused credentials and permissions.
Related security services
IAM Identity Center, AWS Organizations (service control policies), IAM Access Analyzer, CloudTrail, Cognito.
Shared responsibility
AWS secures the IAM service. You design and maintain every user, role and policy, and you protect the root user.
Availability, backup and failure behavior
IAM is a global service. Changes take a short time to propagate everywhere, so avoid designs that create a role and use it instantly in critical paths.
Common service combinations
Roles for EC2 (instance profiles), Lambda and ECS tasks; STS for cross-account and federation; resource policies on S3, KMS, SQS and SNS; Organizations for service control policies.
Business application examples
- A Lambda function with a role that can read one DynamoDB table and nothing else.
- An auditor role in each account that a security account can assume, read-only.
- Developers who may create roles only within a permission boundary.
Exam cues and common confusions
- Credentials for applications on AWS: roles (instance profiles for EC2), never access keys in code.
- Explicit Deny always wins; default is deny.
- Cross-account access: a role in the target account with a trust policy for the source account; add an external ID for third parties.
- Limit what an account can ever do: service control policies. Limit what a delegated admin can grant: permission boundaries.
- Workforce SSO across accounts: IAM Identity Center. App end users: Cognito.
Related
Courses and lessons
- IAM users, groups, roles and policies · AWS Solutions Architect – Associate (SAA-C03) · Members
- STS, role switching and cross-account access · AWS Solutions Architect – Associate (SAA-C03) · Members
Services, comparisons and patterns
- AWS IAM Identity Center · Service
- AWS Organizations · Service
- Amazon Cognito · Service
- AWS Key Management Service (AWS KMS) · Service
- AWS CloudTrail · Service
Sources
Independent study material, not affiliated with or endorsed by Amazon Web Services. AWS and service names are trademarks of Amazon.com, Inc. or its affiliates.