AWS Builder Center
AWS IAM Made Simple: Users, Groups, Roles, and Policies

AWS IAM Made Simple: Users, Groups, Roles, and Policies

Understand AWS access permissions through a small application that needs to read one file. Learn what each IAM term means and how the pieces fit.

Start with an ordinary access decision

A colleague asks to read a report. Before handing it over, you want to know who they are and whether they should have access to that report.
Cloud applications need similar decisions. AWS Identity and Access Management, usually shortened to IAM, helps control access to AWS resources.
Two useful terms are authentication, which establishes an identity, and authorization, which determines what that identity may do.
Signing in successfully does not mean every action is allowed.

The four terms you will encounter

Term
Plain-language meaning
A simple example
IAM user
An identity created within an AWS account
A user configured for a particular access requirement
IAM user group
A collection of IAM users that can receive common permissions
A group of users who need to read reports
IAM role
An identity with permissions that trusted callers can assume
A role used by an application running on EC2
Policy
A set of permission rules
Allow reading objects under one S3 prefix
A helpful analogy is an office: people have identities, teams share access needs, particular duties come with permissions, and written rules describe those permissions.
The analogy explains the purpose of the parts. AWS still evaluates actual policies and requests, rather than an office job title.

IAM users and user groups

An IAM user is an identity in an AWS account. A user group makes permissions easier to manage for several IAM users.
For example, a  ReportReaders  group could have a policy allowing a particular set of reads. Adding an IAM user to that group gives the user the permissions granted through the group.
People do not sign in as the group itself. The group organizes IAM users and their shared permissions.
Understanding IAM users does not mean you should create long-lived user credentials for every person and application. AWS recommends temporary credentials and federation for human access where possible, commonly through IAM Identity Center.

IAM roles

A role can be assumed by a caller that its trust configuration permits. The caller receives temporary credentials for the role session.
Consider an application running on EC2 that must read a report from S3. An appropriate role can provide the application's AWS access without placing a permanent IAM user's access key in the source code.
Two questions matter:
  • Who may assume this role? Its trust policy addresses that relationship.
  • What may the role do? Its permissions policies help define the allowed actions and resources.
Being trusted to assume a role and being permitted to read a particular object are related but separate decisions.

Read a small policy one piece at a time

Here is an illustrative permissions policy:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::example-reports-bucket/reports/*"
}
]
}
Read it as: allow the  GetObject  action on object keys under  reports/  in this example bucket.
Field
What it contributes
 Version 
Identifies the policy language version
 Effect 
Specifies the effect of this statement
 Action 
Names the AWS operation
 Resource 
Identifies the resources the statement covers
The ARN is AWS's resource identifier. Here, the final  *  matches object keys below the stated prefix.
This fragment is a learning example, not a complete EC2 role configuration. It does not grant listing, upload, or deletion. A console workflow may need additional permissions beyond this single object-read action.

Walk through one file request

Imagine the role is correctly configured and available to the application:
  1. The application requests  reports/monthly-summary.txt .
  1. Its AWS SDK uses the role's temporary credentials.
  1. AWS evaluates the request and the applicable policies.
  1. If access is permitted, S3 returns the object.
Now imagine the application requests  private/payroll.txt . The example statement does not grant that read.
A complete decision can involve other policies too. A small allow statement does not remove broader permissions granted elsewhere, and applicable explicit denies can override an allow.

Keep the first design specific

Least privilege means granting the access required for the job. For a report-reading task, start by naming the reports and the read operations it needs.
AWS also recommends protecting root access, using MFA where appropriate, and favouring temporary credentials for workloads.
You can understand the foundation through one question: which identity needs to perform which action on which resource?
Discussion: Which IAM distinction took you longest to understand: user versus role, or trust policy versus permissions policy?

Further reading

Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article