AWS IAM

AWS IAM: The Security Guard Standing in Front of Every Single AWS Request

A zero-jargon walkthrough of how AWS Identity and Access Management decides, for every single action anyone ever attempts, whether the answer is allow or deny.

Imagine a large office building with one very thorough security guard stationed at every single door, elevator, and filing cabinet, not just the front entrance. Before anyone opens any door anywhere in the building, this guard checks a master list: who is this person, what have they specifically been approved to open, and is there any standing rule that flatly forbids them from ever opening this particular door, no exceptions. Only if the answer comes back clean does the door actually unlock. AWS Identity and Access Management, almost always shortened to IAM, is exactly this guard, except instead of physical doors, it checks every single request made to any AWS service — launching a server, reading a file, deleting a database — before AWS allows that request to actually happen.

1What Problem Is IAM Actually Solving?

Cloud computing hands enormous power to whoever can successfully make a request — power that must be tightly controlled, or the consequences are severe.

In a traditional office, physical presence naturally limits what a person can do — someone cannot delete a filing cabinet they cannot physically reach. In the cloud, every single action, no matter how destructive, is available to anyone from anywhere, the instant they know how to send the right request. Without some system standing guard, a single leaked password could allow a stranger halfway across the world to delete every server, every database, and every backup a company owns, in minutes. AWS IAM exists to make sure that never happens by accident, and to make it deliberately difficult for it to happen through malice either.

Everyday Analogy

Think of IAM like a hotel’s electronic key card system. Every guest gets a card, but that card only opens the specific room they booked, plus the shared gym and pool. It does not open the manager’s office, the cash room, or another guest’s room. The front desk decides exactly which doors each card opens, and can instantly deactivate any card at any time — without touching anyone else’s card.

Formally, AWS IAM is a web service that helps securely control access to AWS resources by managing identities (who someone is) and permissions (what they are allowed to do), enforcing the answer to those questions on every single API request made to AWS.

Who Uses It

Every AWS Account, Always

IAM is not optional or add-on software; every action inside an AWS account is checked against IAM permissions, whether an administrator thinks about it or not.

Common Trigger

Onboarding a New Employee

A new team member needs access to specific AWS resources for their job, and nothing beyond that.

Common Trigger

Letting an Application Access AWS

A server or application needs permission to read a file or write to a database without embedding a permanent password inside its code.

Common Trigger

Passing a Security Audit

A company must demonstrate that access to sensitive resources is limited, tracked, and justifiable.

2Core Concepts You Need Before Anything Else

TermWhat It Actually Means
PrincipalAny entity making a request to AWS — a person, an application, or another AWS service.
UserA specific, named identity representing one person or application with its own long-term credentials.
GroupA named collection of users that share the same set of permissions.
RoleAn identity with permissions that can be temporarily assumed by a trusted principal, rather than permanently owned.
PolicyA document, written in JSON, that explicitly lists which actions are allowed or denied on which resources.
i
Plain-English Tip

Whenever this article says “principal,” picture whoever or whatever is actually knocking on the door and asking to come in — a person, a script, or another AWS service acting on someone’s behalf.

It is worth spending real time on the distinction between a user and a role, since beginners very commonly confuse the two, and the difference matters enormously for security. A user is meant to represent a long-lived identity, something that logs in repeatedly over months or years, typically with its own persistent password or access keys. A role, by contrast, is not meant to be permanently “logged into” by anyone; instead, it is temporarily assumed by a trusted principal for a short window of time, after which the temporary credentials it grants automatically expire. This distinction is the foundation of a huge amount of good AWS security practice: wherever a role can be used instead of a long-lived user, the security exposure from a single leaked credential shrinks dramatically, since a leaked temporary credential naturally expires, while a leaked permanent one does not.

Another concept worth internalizing early is the difference between authentication and authorization, two words that sound similar but answer completely different questions. Authentication answers “who are you,” and is settled once, typically at login or when a role is assumed, by verifying a password, an access key, or a temporary security token. Authorization answers “are you allowed to do this specific thing,” and is checked fresh on every single subsequent request, regardless of how confidently the original authentication was proven. A person can be perfectly, confidently authenticated as themselves and still be correctly denied a specific action, because authentication only proves identity, while authorization separately governs what that identity is permitted to do.

3Architecture & Core Components

IAM’s architecture is really a relationship between four pieces: who is asking, what they are allowed to do, how that permission was granted, and what they are asking to touch.
flowchart TB
    subgraph Identities["Identities"]
        USER["IAM User"]
        GROUP["IAM Group"]
        ROLE["IAM Role"]
    end
    subgraph Policies["Permission Policies"]
        POL["JSON Policy Document"]
    end
    subgraph Resources["AWS Resources"]
        S3["S3 Bucket"]
        EC2["EC2 Instance"]
        DB["Database"]
    end

    USER -->|Member of| GROUP
    GROUP -->|Attached| POL
    USER -->|Attached directly| POL
    ROLE -->|Attached| POL
    USER -.->|Assumes| ROLE
    POL -->|Grants/denies access to| S3
    POL -->|Grants/denies access to| EC2
    POL -->|Grants/denies access to| DB
        
Fig 1 — Users can belong to groups and can assume roles; policies attached at any of these levels ultimately determine access to actual resources.

The diagram highlights a detail that trips up many beginners: a permission is never really “owned” by a resource. An S3 bucket does not decide who may read it; the policies attached to identities (and, in some cases, policies attached directly to the resource itself) decide that entirely. This is why two people can look at the exact same bucket and see completely different levels of access — the bucket itself has not changed at all, but each person’s identity carries a different set of attached permissions.

Component

Identity-Based Policy

A policy attached directly to a user, group, or role, defining what that identity is allowed to do.

Component

Resource-Based Policy

A policy attached directly to a resource, such as an S3 bucket policy, defining who may access that specific resource.

Component

Permissions Boundary

An advanced guardrail that caps the maximum permissions an identity can ever have, regardless of what other policies grant it.

Component

Trust Policy

A special policy attached to a role, defining exactly who is allowed to assume that role in the first place.

4Users, Groups, and Roles, One by One

IAM User

A distinct, named identity for a person or application, typically with a password for console access and an access key pair for programmatic access. Best suited for individual human accounts, not for applications, since long-lived credentials are inherently riskier to manage safely over time.

IAM Group

Not itself an identity that can log in, but purely a convenient bucket for organizing users who all need the same permissions, such as “Developers” or “Billing-Team.” Attaching a policy to a group instantly applies it to every current and future member, saving enormous administrative effort compared to repeating the same policy on every individual user.

IAM Role

An identity with a defined set of permissions that is temporarily assumed rather than permanently owned. Roles are the preferred way to grant permissions to AWS services (like an EC2 instance needing to read from S3), to federated users logging in through a corporate identity provider, or to another AWS account entirely.

“A user is a name in the building directory. A role is a visitor badge that expires the moment its purpose is done.”

5How It Works Internally: Policy Evaluation Logic

Every single request to AWS goes through the same evaluation logic before it is allowed or rejected, regardless of which service it targets.

1

Request Arrives

A principal (user, role, or service) sends a request, such as “read this file from this bucket.”

2

All Applicable Policies Are Gathered

IAM collects every relevant identity-based policy, resource-based policy, permissions boundary, and organizational rule that could apply.

3

Explicit Deny Is Checked First

If any single applicable policy explicitly denies the action, the request is rejected immediately, no matter what any other policy says.

4

Explicit Allow Is Checked Next

If no explicit deny was found, IAM looks for at least one explicit allow among the applicable policies.

5

Default Deny Applies Otherwise

If nothing explicitly allowed the action, it is denied by default, since IAM’s baseline assumption is always “deny unless proven otherwise.”

!
Common Misunderstanding

People often assume having one policy that allows an action is enough. In reality, if any other applicable policy anywhere — a permissions boundary, a service control policy, or another attached policy — explicitly denies that same action, the deny always wins over any allow.

This “explicit deny always wins” rule is not an accident; it is a deliberate safety design. It means an organization can safely add a single, centrally managed guardrail policy — for example, “never allow anyone to disable logging” — and trust that this single rule cannot accidentally be overridden later by some other, more permissive policy someone attaches elsewhere. Security teams rely heavily on this property to build layered defenses that remain effective even as many different individual teams manage their own day-to-day permissions.

It is also worth understanding the structure of the policy document itself, at least at a conceptual level, since it explains why the evaluation logic behaves the way it does. A policy is fundamentally a list of individual statements, and each statement specifies an effect (allow or deny), a set of actions (such as “read an object” or “delete a database”), and a set of resources those actions apply to. When IAM evaluates a request, it is really scanning through every applicable statement across every applicable policy, looking for any statement whose effect, action, and resource all genuinely match the request being made. This is why very small, seemingly unrelated wording differences in a policy — a wildcard included or omitted, a resource listed too broadly or too narrowly — can meaningfully change real-world behavior, even though the policy document as a whole might look almost identical to a slightly different version.

6Data Flow & Lifecycle

sequenceDiagram
    participant App as Application / User
    participant STS as AWS STS
    participant IAM as IAM Policy Engine
    participant Svc as AWS Service (e.g. S3)

    App->>STS: Assume role request
    STS-->>App: Temporary credentials (expiring)
    App->>Svc: API request with credentials
    Svc->>IAM: Evaluate policies for this request
    IAM-->>Svc: Allow or Deny decision
    Svc-->>App: Response (data or access denied)
        
Fig 2 — A typical role-based flow: temporary credentials are issued once, then evaluated fresh against policy on every subsequent request.

An important detail in this flow is that the policy evaluation in step four happens on every single request, not just once when credentials are first issued. This means a permission change takes effect essentially immediately for future requests, even for a principal who is already holding valid, unexpired credentials — the credentials only prove identity, they do not lock in a fixed set of permissions that stays frozen for their entire lifetime.

7Advantages, Disadvantages & Trade-offs

Advantages

  • No additional cost to create and use identities and policies
  • Extremely fine-grained control down to individual actions and resources
  • Temporary role credentials reduce long-term credential exposure
  • Deep integration across every single AWS service
  • Centralized guardrails possible across an entire organization

Trade-offs

  • Policy language has a real learning curve for beginners
  • Overly broad policies are easy to write accidentally
  • Debugging “access denied” errors can require tracing several policy layers
  • Poor initial design tends to accumulate technical debt over time
Everyday Analogy

Writing IAM policies is a bit like writing a very detailed guest list for a party with multiple rooms. It takes real effort to specify exactly who can enter which room, but that same precision is exactly what prevents an uninvited guest from wandering into the room holding the good silverware.

8Performance & Scalability

Because policy evaluation happens on every request across every AWS service globally, IAM is engineered to answer allow-or-deny decisions with very low added latency, at a scale spanning millions of requests per second across all of AWS’s customers combined. From an individual account’s point of view, this means adding more users, more roles, or more granular policies does not meaningfully slow down request processing; the evaluation engine is designed to handle this volume as a baseline expectation, not as a special case.

5,000
MAX CHARACTERS PER INLINE POLICY
10
MANAGED POLICIES PER USER (DEFAULT)
1 hr+
TYPICAL ROLE SESSION DURATION

Where scalability genuinely becomes a design concern is not performance, but manageability: as an organization grows from a handful of users to hundreds or thousands, individually managing policies per user quickly becomes unwieldy. This is precisely why groups, roles, and centrally managed policies exist — they are less about raw technical scalability and more about human, organizational scalability, letting a small security team confidently manage permissions for a much larger population of users and applications.

A related, often overlooked scalability question is how permissions scale across an entire organization made up of many separate AWS accounts rather than just one. Managing permissions individually inside dozens or hundreds of separate accounts, one account at a time, does not scale well at all as an organization grows. This is why larger organizations typically layer in organization-wide guardrails that apply automatically across every account at once, combined with roles that let a small number of trusted identities operate across many accounts as needed, rather than every person needing a separate identity duplicated inside every single account.

9High Availability, Reliability & Durability

Because every AWS API call depends on IAM to authorize it, IAM itself is built as one of the most highly available services within AWS, since any disruption to it would ripple out and affect essentially everything else a customer tries to do. Identity and policy data is stored redundantly, and the evaluation engine operates across a globally resilient infrastructure so that authorization decisions remain available even during significant regional disruptions elsewhere.

i
Reliability Tip

IAM itself is a global service, not tied to a single AWS Region, which is precisely why users, groups, roles, and policies are visible and usable consistently no matter which Region an application happens to be running in.

It is worth separating the reliability of IAM’s decision-making engine from the reliability of an organization’s own policy design. IAM reliably enforcing whatever rules exist is guaranteed by AWS. Whether those rules actually reflect a sensible, well-thought-out security posture is entirely the customer’s own responsibility. A perfectly reliable system faithfully enforcing an accidentally overly permissive policy will faithfully, reliably allow exactly the mistake that policy contains — reliability of enforcement is not the same thing as correctness of the rules being enforced.

10Security

Authentication

Multi-Factor Authentication

Requires a second proof of identity beyond a password, dramatically reducing the impact of a stolen or guessed password alone.

Design Principle

Least Privilege

Granting only the exact permissions needed for a task, and nothing more, so a compromised identity can cause only limited damage.

Guardrail

Permissions Boundaries

Caps on the maximum permissions an identity can ever be granted, preventing privilege escalation even by well-meaning administrators.

Organization-Wide

Service Control Policies

Guardrails applied across an entire AWS Organization, restricting what even account administrators are able to do.

Least privilege deserves particular emphasis, because it is more a discipline than a single feature to switch on. In practice, it means starting every new role or user with essentially no permissions at all, then adding back only the specific actions that role genuinely needs to perform its job, rather than starting from a broad template and hoping nobody misuses the extra access left inside it. This approach requires more upfront thought than granting broad administrator access to everyone, but it means that if any single identity is ever compromised, the actual blast radius of that compromise is limited to only the narrow set of things that identity was ever allowed to touch in the first place.

Multi-factor authentication is worth understanding at a slightly deeper level as well. A password alone represents “something you know,” which can be guessed, phished, or leaked in a data breach elsewhere on the internet and then reused by an attacker. Multi-factor authentication adds “something you have,” such as a hardware security key or an authenticator app on a phone, meaning that even a fully correct, stolen password is not enough on its own to gain access. This single addition closes off the overwhelming majority of real-world account compromise attempts, which typically rely entirely on a password being known, and nothing more.

Permissions boundaries and service control policies both exist to solve a subtler problem than everyday least-privilege policy writing: preventing privilege escalation by administrators who are individually well-intentioned but collectively capable of accumulating too much power over time. Without a boundary in place, an administrator with permission to create new roles could, in principle, create a new role for themselves with far broader permissions than they were originally intended to have, effectively promoting their own access without anyone else’s explicit approval. A permissions boundary closes this gap by capping the maximum permissions any role or user they create can ever hold, regardless of how the underlying policy attached to that new identity is written, ensuring that delegated administrative convenience never quietly becomes unlimited administrative power.

11Monitoring, Logging & Metrics

AWS CloudTrail records every single API call made within an account, including exactly which identity made it, what action was requested, and whether it was allowed or denied, creating a complete, auditable history of activity across an entire AWS account. IAM Access Analyzer separately reviews existing policies and proactively flags access that may be broader than intended, such as a resource unintentionally left accessible from outside the organization.

These two tools answer genuinely different questions and are most powerful when used together. CloudTrail answers “what actually happened,” providing a factual, after-the-fact record useful for investigating an incident or satisfying an audit request. Access Analyzer answers a forward-looking question instead: “what could theoretically go wrong given the permissions currently configured,” surfacing risky configurations before they are ever actually exploited. A mature security practice reviews Access Analyzer findings proactively on a regular cadence, rather than only turning to CloudTrail reactively after something has already gone wrong.

CloudTrail’s value multiplies considerably once its logs are actually reviewed rather than simply collected and left sitting untouched. A very common, effective habit among security-conscious teams is watching specifically for unusual patterns rather than every individual log entry: an identity suddenly calling actions it has never called before, requests originating from an unfamiliar geographic location, or a spike in denied requests suggesting either a misconfigured application or an active attempt to probe for accessible permissions. None of these patterns are visible from a single log line in isolation; they only become meaningful once logs are aggregated and reviewed over a meaningful window of time, which is precisely why routing CloudTrail data into a dedicated log analysis or alerting system is considered a foundational security practice rather than an optional extra.

12Deployment & Cloud Considerations

DecisionWhat It Affects
Managed vs. inline policiesWhether a policy can be reused across many identities, or is tied uniquely to just one.
Federated identity integrationWhether employees log in with existing corporate credentials rather than separate AWS-specific ones.
Multi-account strategyWhether roles are used to grant cross-account access instead of duplicating users everywhere.
Root account usage policyWhether the most powerful account identity is locked away and used only for rare, specific emergency tasks.

13Best Practices & Anti-Patterns

ANTI-PATTERN · SHARED ADMIN CREDENTIALS AVOID
The Mistake

Multiple people using the same single powerful IAM user login, making it impossible to know afterward exactly who performed a given action, and making it painful to revoke access for just one departing person.

The Fix

Give each person their own individual identity with only the permissions they specifically need, so actions are always attributable and access can be revoked individually without affecting anyone else.

Best Practice

Prefer Roles Over Long-Lived Keys

Use roles with temporary credentials for applications and cross-account access instead of embedding permanent access keys.

Best Practice

Review Unused Permissions Regularly

Periodically check for permissions that have not actually been used in months, and remove them, since unused access is pure risk with no offsetting benefit.

ANTI-PATTERN · WILDCARD RESOURCE PERMISSIONS AVOID
The Mistake

Writing a policy that grants an action against every resource using a wildcard, simply because it was faster than listing the specific resources actually needed, silently expanding an identity’s reach far beyond its intended purpose.

The Fix

Scope policies to the specific, named resources a task genuinely requires, treating a wildcard resource as a deliberate, carefully justified exception rather than a convenient default.

14Real-World Usage Patterns

Application-to-Service Access

An application running on a compute instance is given a role instead of embedded credentials, so it can read from a storage bucket or database without any password ever being written into its code.

Cross-Account Access

Large organizations with multiple separate AWS accounts use roles to let a trusted account temporarily access resources in another account, without duplicating user identities across every account.

Federated Corporate Login

Employees log into AWS using their existing corporate identity provider credentials, with IAM roles granting temporary, appropriately scoped access based on their corporate group membership.

Third-Party Vendor Access

Companies grant an external vendor a narrowly scoped role for a specific, limited task, rather than creating a permanent user account for a temporary relationship.

15Frequently Asked Questions

Q1What happens if two policies conflict with each other?
An explicit deny in any applicable policy always overrides any explicit allow found elsewhere, and if nothing explicitly allows an action, it is denied by default.
Q2Should applications use IAM users instead of roles?
Generally no. Roles provide temporary, automatically expiring credentials, which are considerably safer for applications than long-lived user access keys that must be manually rotated and protected.
Q3Does using groups change what a policy can express?
No, groups are purely an organizational convenience for applying the same policies to many users at once; the underlying permission logic works identically whether a policy is attached to a group or directly to an individual user.
Q4Why did my request fail with access denied even though I have an allow policy?
Some other applicable policy, such as a permissions boundary or an organization-wide guardrail, may contain an explicit deny for that action, which always takes priority over any allow.
Q5Is the AWS account root user meant for daily use?
No, the root user has unrestricted access to everything in an account and is generally kept secured and reserved for rare account-level tasks, with day-to-day work performed using individual IAM identities instead.
Q6Can permissions be granted to resources in a completely different AWS account?
Yes, cross-account roles and certain resource-based policies allow trusted principals from another AWS account to be granted specific, controlled access.

16Summary and Key Takeaways

Key Takeaways

  • AWS IAM checks and enforces permissions on every single request made to any AWS service.
  • Identities come as users (long-lived), groups (organizational buckets), and roles (temporarily assumed, expiring credentials).
  • Policies, written in JSON, define exactly what is allowed or denied, and an explicit deny always wins over any allow.
  • The default posture is deny unless explicitly allowed, providing a safe baseline for every new identity.
  • Least privilege and multi-factor authentication are the two most impactful security disciplines to apply consistently.
  • CloudTrail and IAM Access Analyzer together provide both a factual audit trail and forward-looking risk detection.
  • Common uses include application-to-service access, cross-account access, federated corporate login, and scoped vendor access.