AWS Builder Center
IAM Explained Like a College ID Card

IAM Explained Like a College ID Card

AWS IAM sounds scary until you compare it with your college ID card. Learn users, groups, policies, roles and least privilege by walking through the library, lab, hostel and the exam cell.

Every college student knows this feeling. You tap your ID card at the library gate and it opens. You try the exam cell door and nothing happens. Nobody is being rude, the card just was not given that permission.
That is AWS IAM in one sentence. If you have ever been confused by users, roles and policies, keep your ID card in mind and the rest gets easy.

What is IAM?

IAM stands for Identity and Access Management. It answers two questions for everything in your AWS account:
  1. Who are you? (authentication)
  1. What are you allowed to do? (authorization)
In college, the ID card answers the first question and the college rules answer the second.

Meet the cast

In college
In AWS IAM
The Principal / Chairman with the master key
Root user
A student with an ID card
IAM user
Your department or year (III Year CSE A)
IAM group
The rules written on what your card can open
IAM policy
A temporary lab-duty pass or visitor pass
IAM role

Root user: the master key

When you create an AWS account, you get a root user who can do absolutely everything, including closing the account. Just like the master key, you should lock it away. Use it once to set things up, turn on MFA, and then stop using it for daily work.

IAM user: your own ID card

Each person gets their own identity with their own login. Never share one login between teammates. In college nobody shares an ID card, because then you cannot tell who entered the lab at 11 PM.

IAM group: your department

Instead of giving permissions to 60 students one by one, you put them in a group, like "III Year CSE A", and give permissions to the group. When a new student joins, you add them to the group and they get everything automatically.

IAM policy: the list of doors

A policy is the document that says which doors open. It is written in JSON, but reading it is easy:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": ["s3:GetObject", "s3:ListBucket"],
"Resource": [
"arn:aws:s3:::college-library",
"arn:aws:s3:::college-library/*"
]
}
]
}
Read it like a sentence: Allow this person to read and list things in the college-library bucket. That is all. They can read books but cannot add, edit or delete anything.
  • Effect: Allow or Deny
  • Action: what you can do (read, write, delete)
  • Resource: which door or thing it applies to

IAM role: the temporary pass

A role is not a person. It is a set of permissions that someone (or something) can borrow for a while.
Think of a lab assistant duty pass. For two hours you can open the server room, and after that the pass expires. In AWS, the most common example is an EC2 server or a Lambda function that needs to read from S3. Instead of storing a password inside your code (please never do this), you give that service a role.

Least privilege: the first-year ID card rule

This is the most important idea in IAM.
A first-year student's card opens the classroom, the library and the canteen. It does not open the exam cell, the staff room or the server room. Not because the college does not trust first-years, but because they do not need those doors.
In AWS this is called the principle of least privilege: give only the permissions needed for the job, nothing extra.
A common beginner mistake is attaching  AdministratorAccess  to everything because "it just works". It works the same way a master key works. It opens every door, so if it gets lost, everything is at risk.

Two rules that save you

1. Deny always wins. If one policy says Allow and another says Deny for the same action, the Deny wins. It is like a notice saying "Hostel closed for maintenance". It does not matter that your card normally opens it.
2. By default, everything is denied. A brand new IAM user can do nothing. Every permission must be given on purpose, like a new student whose card is blank until the college activates it.

Add MFA: ID card plus OTP

Some places in college need your card and your fingerprint. In AWS that is MFA (Multi-Factor Authentication). Even if someone steals your password, they still need your phone. Turn it on at least for your root user and any admin.

A quick checklist for your first AWS account

  • Lock the root user and enable MFA on it
  • Create an IAM user for yourself instead of using root
  • Use groups to give permissions
  • Give only the permissions needed, and add more later if required
  • Use roles for services instead of putting access keys in code
  • Never push access keys to GitHub

Final thoughts

IAM looks complicated only because of its vocabulary. Once you see it as a college campus, with ID cards, departments, door rules and temporary passes, it becomes easy to remember.
Next time you tap your ID at the library gate, remember: you are using IAM.
Have you ever got an "Access Denied" error in AWS? Tell me in the comments, and I'll explain how to debug it in the next article.
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