Skip to content

Lesson 1 of 9 · 22m

IAM Is an Evaluation Engine, Not a User Database

Principals, actions, resources, conditions, and the evaluation order that decides every AWS API call.

The first IAM mistake is treating it like a list of users with checkboxes. AWS IAM is closer to a policy evaluation engine wrapped around every API call. A principal asks to perform an action on a resource in a context; AWS walks the applicable policy types and returns allow or deny. Once that model clicks, most confusing denials stop being mysterious.

Every request is a tuple

Principal: arn:aws:iam::123456789012:role/app-server
Action:    s3:PutObject
Resource:  arn:aws:s3:::prod-uploads/incoming/report.csv
Context:   source IP, encryption settings, MFA presence, tags, time

A policy matches some part of that tuple. The important word is match: IAM is not executing business logic, it is pattern-matching requests against policy statements.

Evaluation order is the mental shortcut

explicit deny anywhere
  -> deny immediately

otherwise:
  organizational SCP allows it?
    and permissions boundary allows it?
      and identity policy or resource policy allows it?
        -> allow

no allow anywhere -> implicit deny

That is the practical version. There are edge cases with session policies and service-specific behavior, but this ladder explains most production outcomes. An Allow in one place does not override a Deny in another, and an SCP can make a perfectly valid account-level policy irrelevant.

Read policies as constraints

{
  "Version": "2012-10-17",
  "Statement": [{
    "Effect": "Allow",
    "Action": ["s3:GetObject"],
    "Resource": "arn:aws:s3:::team-reports/*",
    "Condition": {
      "StringEquals": {"aws:PrincipalTag/team": "finance"},
      "Bool": {"aws:SecureTransport": "true"}
    }
  }]
}

This is not “finance users can read reports.” It is narrower and more precise: a principal tagged team=finance can read objects under team-reports, over TLS only. Conditions are where real-world IAM lives.

The day-one habit

When access fails, identify which layer denied it before editing anything. CloudTrail usually shows the action and sometimes the exact reason; the IAM policy simulator can test identity policies, but it does not rescue a bad mental model. Add the narrowest missing allow, or remove the wrong deny — never both at once.

Field notes

  • * in Action or Resource is not automatically evil, but Action: "*" plus Resource: "*" is a root cause waiting for a timestamp.
  • IAM is global, but the resources it protects are usually regional; do not confuse control plane scope with data location.
  • AWS managed policies change over time. Convenient in a lab, occasionally surprising in a regulated production account.
  • If a policy needs a paragraph of prose to explain, it probably wants multiple smaller roles.

Was this lesson helpful?

Sign in to rate