← Knowledge HubAWS · Security, Identity & Compliance
AWS IAM
Controls who (or what) can do what across your AWS account — the foundation of AWS security.
What is it?
AWS Identity and Access Management (IAM) is the service that authenticates and authorizes every request made to AWS. It manages users, groups, roles, and the policies that define exactly which actions on which resources are allowed or denied.
Why it matters
Almost every AWS security incident traces back to an IAM misconfiguration — credentials that were too broad, a role that could be assumed by more than intended, or a policy that granted more access than the workload needed. Getting IAM right is the single highest-leverage security control in an AWS account.
Business use cases
- Giving an application running on EC2/Lambda/ECS permission to call other AWS services, without embedding credentials
- Letting engineers sign in with individual accounts instead of shared root credentials
- Granting a third party (e.g. a CI/CD pipeline) temporary, scoped access
- Enforcing least-privilege boundaries between environments (dev cannot touch prod resources)
How it works
IAM policies are JSON documents that allow or deny specific actions on specific resources, optionally with conditions. Policies attach to users, groups, or roles. Roles are the recommended way to grant access to AWS services and applications — they provide temporary credentials instead of long-lived access keys. IAM evaluates all applicable policies for a request and denies it unless something explicitly allows it (and nothing explicitly denies it).
When to use it
- Always — IAM underlies every AWS interaction, there is no opting out
- Whenever a workload (EC2, Lambda, ECS task, etc.) needs to call another AWS service, use a role, not a stored access key
When not to use it
- IAM does not replace application-level authentication for your own end users — for that, use Amazon Cognito or your own identity provider
Alternatives
There is no alternative within AWS — IAM is foundational. Cross-cloud, the equivalent is Google Cloud IAM or Azure RBAC/Entra ID.
Pricing concepts
IAM itself has no direct charge. Cost implications are indirect: overly broad permissions can lead to unexpected resource creation and spend, which is one more reason to scope policies tightly.
Security
- Never use the root account for daily work; lock it down with MFA and use it only for account-level tasks
- Prefer roles with temporary credentials over long-lived IAM user access keys
- Write policies scoped to specific resources and actions rather than using wildcard ("*") permissions
- Enable MFA for all human users, especially anyone with elevated privileges
- Use IAM Access Analyzer and regular access reviews to catch unused or overly broad permissions
- Rotate any access keys that must exist, and delete ones that are unused
Setup guide
- Enable MFA on the root account and create individual IAM users (or use IAM Identity Center) for real people — never share root credentials
- Create roles for every application/service workload, scoped to only what it needs
- Group permissions logically (e.g. by team or environment) rather than attaching policies one-by-one to each user
- Turn on CloudTrail so every IAM-authorized action is logged
Best practices
- Start from least privilege and add permissions as genuinely needed, rather than starting broad and narrowing later
- Use AWS-managed policies as a starting reference, but write scoped custom policies for production workloads
- Separate accounts (via AWS Organizations) for prod/non-prod rather than relying solely on IAM boundaries within one account
- Review and remove unused roles, users, and policies periodically
FAQ
What’s the difference between a role and a user?A user represents a person or long-lived identity with its own credentials. A role has no credentials of its own — it’s assumed temporarily by a user, service, or application, which is safer because the resulting credentials expire automatically.
Why is "allow all, then deny specific things" not how IAM works?IAM is deny-by-default: nothing is allowed unless a policy explicitly allows it. This is intentional — it means a missing policy fails safe (access denied) rather than failing open.
Last reviewed: 2026-09-20