INFRASTRUCTURE LEARNINGINFRASTRUCTURE LEARNING
インフラ大全インフラ大全IT INFRASTRUCTURE / LEARNING
Infrastructure learning guide
Find a lesson or lab/

Esc to close · Search terms stay on your device

LEARNING日本語

Core lesson 9 of 18Topic: IAM: identity and permissions

How to read IAM policy JSON: Effect, Action and Resource

An IAM policy describes permissions in JSON. Start with a Statement, an individual rule, and compare its Effect, Action and Resource with one request. Valid JSON syntax does not establish that AWS will authorize the intended operation.

What you will learn

Match a statement to a request, identify a mismatched element and explain what the snippet cannot determine.

Prerequisite

Know principal, action, resource and authentication versus authorization. No real policy input is required.

Read one small statement

Reading example for report.csv; not a deployment instruction
{
  "Version": "2012-10-17",
  "Statement": [{
    "Sid": "ReadOneReport",
    "Effect": "Allow",
    "Action": "s3:GetObject",
    "Resource": "arn:aws:s3:::demo-bucket/report.csv"
  }]
}

Braces group properties and brackets enclose an array. This Statement array contains one rule. Version identifies the policy language version, not the creation date. Sid is an optional statement identifier; its name does not grant permission.

The three elements to read first
ElementValue in the exampleQuestion to ask
EffectAllowDoes this rule allow or explicitly deny?
Actions3:GetObjectDoes the requested API operation match?
ResourceThe ARN for demo-bucket/report.csvDoes the target resource match?

Match the action and resource separately

The same bucket does not make every request match
The same bucket does not make every request match1: Allow statement — Matches this statement — GetObject / report.csv. 2: Allow statement — Not covered by this statement — PutObject / report.csv12Allow statementGetObject /report.csvPutObject /report.csvThe same bucket does not make every request match1: Allow statement — Matches this statement — GetObject / report.csv. 2: Allow statement — Not covered by this statement — PutObject / report.csv12Allow statementGetObject /report.csvPutObject /report.csv
  1. Allow statement → GetObject / report.csvMatches this statement
  2. Allow statement → PutObject / report.csvNot covered by this statement
Allow statement
This example names GetObject and report.csv.
GetObject / report.csv
Both elements match this statement; effective authorization still needs review.
PutObject / report.csv
The resource is the same, but the action does not match.

An Amazon Resource Name (ARN) identifies an AWS resource. This example includes the object key report.csv, not just a bucket name. Bucket-level operations and object-level operations can require different resource types. Check which resource the requested action supports.

Read the statement after one change
RequestRelationship to this statement
GetObject for report.csvAction and Resource match
PutObject for report.csvAction does not match
GetObject for other.csvResource does not match

A matching Allow is not the complete decision

This snippet teaches how to read one rule. Real authorization can involve other statements, resource policies, permissions limits, organization controls and request conditions. Adding an Allow does not override an applicable explicit Deny.

Condition adds criteria for a statement to apply. It is not optional to inspect an existing condition just because a basic example omits it. Elements such as NotAction and NotResource have their own meanings and must not be silently treated as Action and Resource.

Check a changed request

Choose an option to see the result and explanation.

Keep the JSON above and change only the request to PutObject. Does this statement grant that write?
Read the answer and reason

Answer: The action does not match · The resource is unchanged, but Action still says GetObject. This statement does not grant PutObject. The snippet alone does not determine effective authorization across other policies.

After reading, change one condition at a time

  1. Write the requested action and target first.
  2. Read each statement’s Effect, Action, Resource and any conditions.
  3. Separate statement matching from effective permission; inspect one-condition changes in the IAM lab.

Check, then explain in your own words

  1. Identify whether the action is GetObject or PutObject.
  2. Check whether the resource is the same object.
  3. Explain statement matching separately from effective authorization.
Check your understanding: Should Version be changed to today’s date?

No. Version identifies the policy language version.

It is not a creation or modification date. Establish what an element means before changing its value.

Sources and conditions checked

The official references used in this lesson are collected here with their scope, conditions and corresponding sections. Independent expert review and live AWS comparison have not been performed.