AWS IAM Theory Notes
AWS Cloud Computing · 1st Semester · IIMT

AWS IAM
Identity & Access Management

Topic: IAM Theory Subject: Public Cloud Services (AWS) Level: Beginner → Intermediate Next Topic: EC2
Topics Covered

What is AWS IAM?

IAM (Identity and Access Management) is a global AWS service that controls who can access AWS and what they can do. It is the foundation of security in any AWS environment.

Simple Definition
IAM answers two questions:
1. WHO are you? (Authentication — proving your identity)
2. WHAT can you do? (Authorization — what actions are allowed)

Why Do We Need IAM?

Without IAM, everyone would use the root account (owner account), which is extremely dangerous. IAM lets us:

Root Account Warning
The Root Account is created when you first create your AWS account. It has complete access to everything. You should NEVER use it for daily tasks and NEVER share it. Create an IAM Admin user instead.

Key Features of IAM

IAM Core Components

IAM has four main building blocks. Understanding each one is essential.

👤

IAM Users

A real person or application that needs access to AWS.

👥

IAM Groups

A collection of users sharing the same permissions.

🎭

IAM Roles

Temporary identity assumed by services, apps, or users from other accounts.

📋

IAM Policies

JSON documents defining what actions are allowed or denied.

1. IAM Users

An IAM User represents a single person or service. When created, a user has no permissions by default. Permissions are granted by attaching policies.

2. IAM Groups

Groups make it easy to manage permissions for multiple users at once. Assign a policy to a group — all users in that group inherit it.

Key Rule
Groups can only contain Users. Groups CANNOT contain other groups. A user can belong to multiple groups.

Example groups: Developers, Admins, DBAs, ReadOnly-Team

3. IAM Roles

A Role is not assigned to a person — it is assumed temporarily. Think of it like borrowing a badge. Roles are used when:

Roles vs Users
User = permanent identity for a person (long-term)
Role = temporary identity for services or applications (short-term, auto-expires)

4. IAM Policies

A Policy is a JSON document that defines permissions. It specifies which AWS services and actions are allowed or denied, and on which resources.

IAM Policy Types

Policy Type Attached To Who Manages It Use Case
AWS Managed Policy Users, Groups, Roles AWS (pre-built) Common use cases like S3ReadOnly, AdminAccess
Customer Managed Policy Users, Groups, Roles You (your account) Custom rules specific to your org
Inline Policy Single User/Group/Role You (embedded) One-to-one, deleted with the identity
Resource-based Policy AWS Resource (e.g., S3 bucket) You Allow cross-account access to a specific resource
Permission Boundary Users, Roles You (admin sets max limit) Set the maximum permissions a user can ever have
SCP (Service Control Policy) AWS Org Accounts Org Admin Block services across entire AWS Organization
Deny Always Wins
If there is an explicit Deny anywhere in any policy, access is denied — even if another policy explicitly allows it. AWS uses deny-by-default: everything is denied unless there is an explicit Allow.

IAM Policy JSON Structure

Every IAM policy is written in JSON. Understanding this structure is critical for the AZ and AWS exams, and for real-world work.

IAM Policy — JSON Structure
{
  "Version": "2012-10-17",         // always use this version
  "Statement": [
    {
      "Sid": "AllowS3ReadOnly",     // optional: statement ID
      "Effect": "Allow",            // "Allow" or "Deny"
      "Action": [
        "s3:GetObject",          // specific action
        "s3:ListBucket"
      ],
      "Resource": [
        "arn:aws:s3:::my-bucket", // specific resource (ARN)
        "arn:aws:s3:::my-bucket/*"
      ],
      "Condition": {             // optional: when rule applies
        "StringEquals": {
          "aws:RequestedRegion": "ap-south-1"
        }
      }
    }
  ]
}

Breaking Down Each Field

FieldRequired?DescriptionExample Values
Version Yes Policy language version. Always use 2012-10-17 2012-10-17
Sid No Statement ID — a label for the statement AllowEC2Read
Effect Yes Whether to Allow or Deny the actions Allow / Deny
Action Yes Which AWS API actions to allow/deny. Use * for all. s3:PutObject, ec2:*
Resource Yes Which AWS resource(s) the statement applies to (ARN format). Use * for all. arn:aws:s3:::bucket-name/*
Condition No Optional extra conditions (time, IP, region, MFA, etc.) aws:MultiFactorAuthPresent: true
ARN Format
ARN = Amazon Resource Name. It uniquely identifies every AWS resource.
Format: arn:partition:service:region:account-id:resource
Example: arn:aws:s3:::my-bucket (S3 has no region/account in ARN)

Authentication vs Authorization

These two terms are often confused. Both are handled by IAM but they are completely different concepts.

AuthenticationAuthorization
Question "Who are you?" "What can you do?"
In IAM Login with username + password / Access Key Policies define what actions are permitted
Happens First (before anything else) Second (after identity is confirmed)
Example Logging into AWS Console Being allowed to create an EC2 instance
AWS Term Identity verification Permissions / Policies

IAM Decision Flow

When a user or service tries to perform an action in AWS, IAM checks in this order:

  1. Is there an explicit Deny? → If yes, access is denied immediately
  2. Is there an explicit Allow? → If yes, access is granted
  3. Neither? → Access is denied (implicit deny — default)
Principle of Least Privilege
Always give users and services only the minimum permissions they need to do their job — nothing more. This is one of the most important security principles in cloud computing.

MFA & Access Keys

Multi-Factor Authentication (MFA)

MFA adds an extra layer of security beyond just a password. Even if a password is stolen, the attacker cannot log in without the second factor.

MFA Device Types in AWS

TypeHow it WorksExample
Virtual MFA App TOTP codes in a smartphone app Google Authenticator, Authy
Hardware TOTP Token Physical device with rotating code Gemalto device
FIDO Security Key USB/NFC hardware key — phishing resistant YubiKey
Hardware Key Fob Dedicated hardware for GovCloud SurePassID
Must Enable MFA On
Always enable MFA on the Root Account and all Admin IAM Users. This is mandatory for any real-world AWS account.

Access Keys vs Console Password

There are two ways to access AWS — each uses different credentials:

Console PasswordAccess Key
Used For AWS Web Console (browser) AWS CLI, SDK, API calls
Format Username + Password Access Key ID + Secret Access Key
Secret visible after? Can be reset Secret shown ONCE only — save immediately
Rotate Recommended regularly Recommended every 90 days
Share? Never share Never share — treat like a password
Never Hardcode Access Keys
Never put Access Keys directly in your code or upload them to GitHub. Use IAM Roles for applications running on EC2, and use environment variables or AWS Secrets Manager for local development.

IAM Security Tools

AWS provides built-in tools to audit and review your IAM configuration.

1. IAM Credentials Report (Account Level)

A downloadable CSV report of all IAM users and the status of their credentials — password last used, MFA enabled, access keys created/rotated, etc.

2. IAM Access Advisor (User Level)

Shows which services a user has permission to access, and when they last accessed each service.

When to Use Which Tool
Credentials Report → Use when you want a full overview of all users' security status (account-wide audit)
Access Advisor → Use when you want to fine-tune one specific user's permissions

3. IAM Policy Simulator

Test what a user, group, or role can or cannot do — without actually performing the action.

IAM Best Practices

Chapter Summary

Key Points to Remember

  • IAM = Identity & Access Management — controls WHO can access WHAT in AWS
  • IAM is a global service — not region-specific
  • 4 main components: Users, Groups, Roles, Policies
  • Groups contain Users only — groups cannot contain groups
  • Roles are for temporary access (services, cross-account, federation)
  • Policies are JSON documents with: Version, Statement, Effect, Action, Resource
  • Effect is Allow or Deny — Deny always wins
  • By default, everything is denied unless explicitly allowed
  • MFA adds a second factor of security beyond just a password
  • Access Keys are for CLI/API — Console Password is for the browser
  • Use Credentials Report (account audit) and Access Advisor (user audit)
  • Least Privilege Principle — give only what is needed, nothing more

What's Next?

Now that IAM is covered, the next topic is EC2 (Elastic Compute Cloud) — where you will launch virtual machines in the cloud and connect them to what you just learned about IAM Roles (so EC2 instances can securely access S3, RDS, and other AWS services).

Lab Connection
In the IAM Lab you already completed, you created Users, Groups, and Policies. In the next EC2 lab, you will create an IAM Role and attach it to an EC2 instance — that's how the instance gets permission to access other AWS services without any access key.
AWS Official Docs

Official Documentation — IAM

All links go to docs.aws.amazon.com — official AWS reference. Always verify facts here for assignments and exam prep.

Topic AWS Docs URL
IAM Introduction & OverviewIAM/introduction.html
IAM UsersIAM/id_users.html
IAM GroupsIAM/id_groups.html
IAM RolesIAM/id_roles.html
IAM Policies — Understanding & WritingIAM/access_policies.html
MFA (Multi-Factor Authentication)IAM/id_credentials_mfa.html
IAM Best PracticesIAM/best-practices.html
IAM Credentials ReportIAM/id_credentials_getting-report.html
IAM Policy SimulatorIAM/access_policies_testing-policies.html
Free Hands-On Labs Practice IAM on real AWS with no credit card — AWS Skill Builder has free browser-based labs. Also open the IAM Console directly.