In this lecture, we’re going deeper into IAM policies and observing how permissions behave in real time inside AWS Identity and Access Management (IAM).
This is where you truly understand how AWS authorization works.
👤 Step 1 – Inspect Current User Permissions
In the left sidebar (as the Root User): go to IAM → Users.
You'll see the user codeveda is in the Admin group. That group has the AdministratorAccess policy attached — so codeveda inherits full admin rights.
In practice, that means:
Access to every AWS service
No restrictions
Can do anything in the account
❌ Step 2 – Remove the User from the Admin Group
Now let's test what happens when you take permissions away.
Go to User Groups
Open the Admin group
Remove
codeveda
The moment he's removed, he loses those inherited permissions — instantly. AWS checks permissions in real time, not on a schedule.
Refresh the IAM Users page as codeveda and you'll see:
❌ Access Denied
Error naming
iam:ListUsers
The takeaway: permissions from a group only exist while you're in that group. Remove the membership, and the access is gone immediately — no delay.
🔧 Step 3 – Fixing Access with a Managed Policy
Let's give codeveda some access back — just enough to look around, not to change anything.
Go to IAM → Users → codeveda
Click Add permissions
Choose Attach policy directly
Select IAMReadOnlyAccess
This policy lets him view and list IAM resources — users, configs, and so on. It does not let him create or change anything.
🔄 Refresh Again
Refresh the console and try again.
✅ You can view users and groups
❌ You can't create a group — that attempt will fail
Why? Read-only means exactly that. Viewing and creating are different permissions, and this policy only grants the first one.
This is least privilege in action: give people only what they need, nothing more.
👥 Step 4 – Adding Multiple Permission Sources
Let's stack a few permission sources on codeveda at once.
Create a new group
Go to User Groups
Create a group called
developersAdd
codevedato itAttach a managed policy — e.g. AlexaForBusinessFullAccess
Add him back to Admin
5. Go to the Admin group and add codeveda again
Now he's picking up permissions from three places at once:
Admin group → AdministratorAccess
Developers group → AlexaForBusinessFullAccess
Direct attachment → IAMReadOnlyAccess
🔎 Inspecting Effective Permissions
Open codeveda's Permissions tab and you'll see all three, listed side by side:
AdministratorAccess — via Admin group
AlexaForBusinessFullAccess — via Developers group
IAMReadOnlyAccess — attached directly
This is permission stacking, visible in one place. A user's total access is just the sum of everywhere they get permissions from:
Every group they're in
Any policy attached directly to them
📜 Looking at the Policies Themselves
Inspect AdministratorAccess
Go to IAM → Policies → AdministratorAccess. The summary shows access to every AWS service. Switch to the JSON tab and you'll see:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "*",
"Resource": "*"
}
]
}
What this means:
"Action": "*"→ every API action"Resource": "*"→ every resource
Together, that's full admin access.
Inspect IAMReadOnlyAccess
Open this policy and you'll see actions like iam:Get* and iam:List*
About the wildcards: Get* matches any API starting with "Get," List* matches any starting with "List." One line covers many calls — GetUser, GetRole, ListUsers, ListGroups, all allowed. No write actions included.
🏗 Building a Custom Policy
Go to IAM → Policies → Create policy
Choose Visual Editor or JSON Editor
Using the Visual Editor, set:
Service → IAM
Actions →
ListUsers,GetUserResource → All resources
Name it MyIAMPermissions and create it.
Check the JSON tab afterward — you'll see:
"Action": [
"iam:ListUsers",
"iam:GetUser"
],
"Resource": "*"
The point: the Visual Editor is just a friendlier way to write the same JSON. Once created, this policy can attach to users, groups, or roles.
🧹 Cleanup
Delete the
developersgroupRemove
IAMReadOnlyAccessfromcodevedaLeave him in the Admin group only
He's back to full admin access with nothing extra attached. Refresh the console to confirm everything still works.