Courseiva
DVA-C02Chapter 1 of 16Objective Domain 1

Identity and Access Management (IAM) Basics

Identity and Access Management (IAM) is the security system that decides who can access your cloud resources and what they can do with them. For the DVA-C02 exam, IAM is the single most important security topic because every service you use — from databases to serverless functions — relies on IAM to keep data safe. Without IAM, your cloud account would be a vault with the door left wide open.

12 min read
Beginner
Updated Jul 23, 2026
Reviewed by Johnson Ajibi· Senior Network & Security Engineer · MSc IT Security

The Office Building Security Badge Analogy

An office building’s security badge system is the perfect analogy for IAM. The badge is the central tool that controls every person’s access to every room and resource in the building.

Imagine you work for a company that rents space in a large office building. The building has a main entrance, a data centre on the second floor, a finance office on the third, and a pantry on every floor. Every employee gets a plastic badge with a photo and a chip. That badge is their identity. When you scan it at the main entrance, it checks who you are and lets you in — that is authentication. Once inside, your badge only opens the doors you are allowed to use. A junior developer might only access the pantry, the toilets, and the ground-floor open workspace. A senior manager’s badge might open the finance office, the data centre, and the executive lounge. That part is authorisation — what you are allowed to do after proving who you are. The company’s IT team manages a central system that defines these permissions. They create groups of people with similar jobs — the "Finance Team" group gets access to finance rooms, the "Development Team" group gets the data centre. If someone changes departments, their badge permissions are updated in the central system, not by issuing a different badge. This central system is exactly what IAM does for cloud resources: it issues identities (badges), defines permissions (which doors open), and manages groups of users (teams) so you can control access at scale without rewriting rules for every single person.

How It Actually Works

Identity and Access Management (IAM) is a web service that helps you securely control access to Amazon Web Services (AWS) resources. AWS is a cloud computing platform provided by Amazon that lets you rent virtual servers, storage, and databases. IAM is free to use with any AWS account, and it is the first thing you set up when you create an account.

The core concept is simple: you have a central place to manage users, their passwords, and what they are allowed to do. Before cloud computing, companies managed access by giving each employee a shared username and password for a single server, or they used a physical key to a room with a computer. That worked poorly because if someone left the company, you had to change every password and re-key every lock. IAM solves this by giving you one central dashboard to control everything.

Let us break down the four main components you need to understand for the DVA-C02 exam.

The first component is the IAM User. An IAM User is a person or service that interacts with AWS. Each user has a unique name and a set of credentials, usually a password for the AWS web console or an access key for programmatic access (when a script or application makes requests without a human typing a password). You create a separate IAM User for every person in your organisation who needs to touch AWS. You never share users — each person gets their own. This is important because if you share one username and password, you cannot tell who did what in the audit logs. AWS records every action taken by every IAM User, so having individual users is essential for security auditing.

The second component is the IAM Group. An IAM Group is a collection of IAM Users. Groups make it easy to manage permissions for many people at once. For example, you might create a group called "Developers" and assign permissions that let them launch virtual servers and access logs. Then you add all the developer IAM Users to that group. When a new developer joins, you simply add them to the group, and they automatically get the right permissions. When a developer leaves, you remove them from the group. This is much faster than editing permissions on each user individually. Groups cannot contain other groups — they are flat collections of users only.

The third component is the IAM Policy. An IAM Policy is a document that defines permissions. It is written in a language called JSON (JavaScript Object Notation), which is a text format for storing data. A policy states whether to "Allow" or "Deny" specific actions on specific resources. For example, a policy might say: "Allow the 'ec2:RunInstances' action on all resources." EC2 is the AWS service that provides virtual servers. RunInstances is the action that launches a new server. The policy is then attached to a user, group, or role. Policies can be very granular — you can allow a user to start a server but not stop it, or allow reading a file from a storage bucket but not deleting it.

The fourth component is the IAM Role. An IAM Role is similar to a user in that it has permissions attached, but it is not a permanent identity — it does not have a username or password in the traditional sense. Instead, a role is assumed by someone or something that needs temporary permissions. For example, a virtual server running on EC2 might need to access a database. Instead of hardcoding a username and password into that server’s software (which is a security risk), you attach an IAM Role to the server. The server then automatically retrieves temporary security credentials from AWS and uses them to access the database. Roles are also used to give access to users from other AWS accounts or to allow services like AWS Lambda (a serverless compute service) to interact with other AWS services.

The simplest way to remember the difference between users, groups, roles, and policies is this: Users are identities for people. Groups are containers for users. Policies are permission documents. Roles are temporary identities for services or cross-account access.

IAM also enforces the principle of least privilege. This is a security best practice meaning you give someone only the permissions they absolutely need to do their job — no more, no less. For example, if a developer only needs to read logs, you do not give them permission to delete resources. The exam loves to test this principle.

Finally, IAM is global. Unlike many AWS services that are tied to a specific region (like US East or Europe), IAM settings apply across all regions. You create a user once, and that user can access resources in any region, unless you specifically restrict them.

In summary, IAM is the gatekeeper for your entire AWS account. It lets you create individual users, group them, define precise permissions with policies, and use roles for services. It is the first line of defence and the foundation of AWS security.

This diagram shows the flow of creating a root user, then an admin user, and how users, groups, policies, and roles interact to grant permissions.

Walk-Through

1

Create the Root User Account

When you first sign up for AWS, you create a root user — the email address you used. This user has full, unrestricted access to everything. You will use this account exactly once to set up your first IAM admin user, then secure it with MFA and never use it for daily tasks.

2

Create an IAM Admin User

Log in as root, go to IAM, and create a new IAM User with a name like 'Admin'. Attach the 'AdministratorAccess' policy to it. This gives you a user you can use for day-to-day management. Set a strong password and enable MFA. Now you can log out of root and use this admin user instead.

3

Create an IAM Group for the Development Team

Create a group called 'Developers'. This is a logical container for all developer users. Groups let you manage permissions at the team level rather than individually. Attach policies to the group that grant the specific actions developers need, such as 'EC2:RunInstances' and 'S3:GetObject'.

4

Add a New Developer as an IAM User

Create a new IAM User for the developer, e.g., 'Priya'. Provide her access to the AWS Management Console with a temporary password (she will change it on first login). Then add her to the 'Developers' group. She automatically inherits the group's permissions. You should also create an access key for her if she needs to use the AWS CLI.

5

Create an IAM Role for an EC2 Instance

Suppose a web server running on EC2 needs to read files from S3. Instead of hardcoding credentials, create an IAM Role called 'WebServerRole'. Attach a policy allowing 'S3:GetObject' on the specific bucket. When launching the EC2 instance, assign the role to it. The server will automatically retrieve temporary credentials from the Instance Metadata Service and use them to access S3.

6

Set a Password Policy and Enforce MFA

Go to the Account Settings in IAM and set a password policy: require minimum length (e.g., 12 characters), require a symbol, and set expiry to 90 days. Then enable MFA for all users, especially those with admin access. You can create an IAM policy that denies any action unless an MFA session is active, using the condition 'aws:MultiFactorAuthPresent'.

What This Looks Like on the Job

Imagine you are a junior developer at a small e-commerce company called "ShopFast". The company uses AWS to host its website, store product images in Amazon S3 (Simple Storage Service — a cloud storage service), and run a database in Amazon RDS (Relational Database Service — a managed database service). You are tasked with setting up a new employee’s access.

First, you log into the AWS Management Console as the root user. The root user is the email address you used to create the AWS account. Every AWS account has exactly one root user, and it has full, unrestricted access to everything. For security reasons, you should never use the root user for daily tasks — only for initial setup and billing emergencies. The first thing you do is create an IAM User for yourself and assign it admin permissions. Then you lock away the root user credentials.

Now, the new employee, Priya, joins as a developer. You open the IAM dashboard in AWS. You click "Add user" and type her name: "Priya". You select "Programmatic access" because she will use the AWS Command Line Interface (CLI) to run scripts, and also "AWS Management Console access" so she can log in to the web interface. You set a temporary password that she will change on first login.

Next, you need to give Priya permissions. Instead of creating a policy from scratch, you go to the "Groups" section and create a group called "Developers". You then attach the AWS managed policy called "AmazonS3FullAccess" which allows full control over S3 buckets. You also attach "AmazonRDSReadOnlyAccess" so she can query the database but not modify it. Then you add Priya to the Developers group. She now has exactly the permissions she needs — that is least privilege in action.

Later, your boss asks you to set up a backup server that automatically copies files from S3 to a second region. You could put the server's access key inside its configuration file, but that is insecure. Instead, you create an IAM Role called "BackupServerRole". You attach a policy to it that allows "s3:GetObject" and "s3:PutObject" on the bucket. You then launch an EC2 instance (virtual server) and attach the role to it. The server automatically gets temporary credentials via an AWS feature called Instance Metadata Service (IMDS) and uses those credentials to perform the backup. You never have to manage a password or key for that server.

Finally, you set up a password policy in IAM that requires passwords to be at least 12 characters long, contain a symbol, and expire every 90 days. You also enable Multi-Factor Authentication (MFA) — an extra layer of security where you need a code from a phone app in addition to your password — for all users who can access the production environment.

What you have done here is pure IAM in practice: creating users, grouping them, attaching policies, using roles for services, and applying security best practices. Every real-world AWS environment follows this pattern.

How DVA-C02 Actually Tests This

The DVA-C02 exam tests IAM heavily. You should expect at least 5 to 10 questions that directly involve IAM concepts, and many other questions assume you understand IAM. The exam does not just ask "what is a user?" — it tests how you apply IAM in real scenarios.

Here are the exact concepts the exam focuses on. - Least privilege: The exam will present a scenario where a developer needs to read a file from S3 but is given full admin access. The correct answer will always be to create a policy that grants only the specific read action needed. Traps include giving broad permissions like "S3FullAccess" or "AdministratorAccess" when a minimal policy would work. - IAM Roles vs IAM Users: A common question asks "what should you give an EC2 instance to access DynamoDB?" The answer is an IAM Role — not a user, not hardcoded credentials. The trap is offering an access key or a password, which would be insecure. - Policies: You must understand the structure of an IAM policy document. The exam may show a JSON snippet and ask you what it does. key elements to recognise: 'Effect' (Allow or Deny), 'Action' (the service and operation, e.g. 's3:ListBucket'), and 'Resource' (the ARN — Amazon Resource Name — which is a unique identifier for an AWS resource, like 'arn:aws:s3:::my-bucket/*'). - Resource-based vs Identity-based policies: Some services like S3 allow you to attach policies directly to the resource (e.g., a bucket policy) rather than to a user or role. The exam tests when you would use a resource-based policy instead of an identity-based one. For example, if you want to allow a user from another AWS account to access your S3 bucket, you need a bucket policy (resource-based) because you cannot control users in other accounts. - Cross-account access: You will be asked how to give a user from Account A access to a resource in Account B. The correct pattern is: create a role in Account B with permissions to the resource, and allow Account A's user to assume that role. The trap is trying to attach a policy directly to the user in Account A. - MFA: Multi-Factor Authentication questions appear often. You must know that MFA can be enforced using an IAM policy condition called 'aws:MultiFactorAuthPresent'. The exam may ask how to force MFA for sensitive actions like deleting resources. - Password policies: The exam expects you to know you can set password complexity rules in IAM, and that you cannot enforce password history length beyond 24 passwords. - Root user protection: Questions will test that the root user should be used only for account-level tasks like changing the account name or contacting AWS support. Using the root user for daily tasks is a security violation.

Common traps to watch for:

Giving an IAM User the same name as a service (like "Admin") — the exam uses realistic names.

Misreading 'Deny' vs 'Allow' in a policy — Deny always overrides Allow, even if an Allow exists in a different policy.

Thinking that IAM is region-specific — it is not, IAM is global.

Assuming that services assume roles automatically — you must explicitly attach the role to the EC2 instance or grant the service permission to assume the role via a trust policy.

Memorise these exact definitions:

IAM User: a permanent identity for a person or application that interacts with AWS.

IAM Group: a collection of IAM Users.

IAM Role: an identity for temporary access, usually for AWS services or cross-account access.

IAM Policy: a JSON document that defines permissions (Allow or Deny).

Least Privilege: granting only the permissions required to perform a task.

Key Takeaways

IAM is a global service — permissions you set apply across all AWS regions, not just one.

The principle of least privilege means granting only the exact permissions needed and nothing more.

Never use the AWS account root user for everyday tasks — lock it away after initial setup.

IAM Roles provide temporary security credentials and are the secure way to give AWS services access to other services.

A single IAM Policy can be attached to multiple users, groups, and roles, making permission management scalable.

In IAM, an explicit Deny in any policy overrides any Allow, even if the Allow is from another policy.

Easy to Mix Up

These come up on the exam all the time. Here's how to tell them apart.

IAM User

Has long-term credentials (password or access key)

Represents a person or application permanently

Created for a specific individual who needs ongoing access

IAM Role

Provides temporary credentials that expire

Represents a service or cross-account access scenario

Assumed by an entity that does not have its own permanent credentials

IAM Group

A collection of IAM Users

Cannot contain permissions on its own — must have policies attached

Used to organise users by job function, e.g., Developers, Admins

IAM Policy

A JSON document that defines Allow or Deny rules

Can be attached to users, groups, or roles

Defines what actions are permitted on which resources

Identity-based Policy

Attached to an IAM User, Group, or Role

Controls what the identity can do

Must include a 'Resource' element specifying which resources the action applies to

Resource-based Policy

Attached directly to a resource (e.g., an S3 bucket)

Controls who can access the resource (even users from other accounts)

Does not need a 'Resource' element — the resource is implied

Root User

Has unrestricted, irrevocable access to all resources

Cannot have its permissions reduced

Should only be used for account-level tasks

IAM Admin User

Has full access but can be restricted or deleted by the root user

Permissions can be revoked or modified

Can be used for all daily administrative tasks

Watch Out for These

Mistake

If I create an IAM User and attach the AdministratorAccess policy, the user has full access to everything in my account forever.

Correct

An IAM User with AdministratorAccess has full access, but you can revoke it at any time by removing the policy. Also, the root user has access that cannot be revoked, so the admin user is still below root.

Beginners often think permissions are permanent or that the root user is the same as an admin user. In reality, the root user has irreversible full access, whereas an IAM admin user is still an IAM User that can be deleted or restricted.

Mistake

IAM Policies written in JSON are only manageable through the AWS web console.

Correct

You can manage IAM Policies using the AWS CLI, SDKs, and infrastructure-as-code tools like AWS CloudFormation or Terraform, in addition to the console.

Newcomers who only use the web console assume that is the only interface. Professionals use code to manage policies because it is repeatable and auditable.

Mistake

An IAM Role is the same thing as an IAM User, just with a different name.

Correct

An IAM Role is not a permanent identity — it does not have long-term credentials like a password or access key. It is assumed temporarily by an entity that needs permissions for a short time.

The word 'role' sounds like a type of user, so beginners conflate them. The key distinction is temporary vs permanent and who uses it (services vs humans).

Mistake

IAM Groups can be nested inside other IAM Groups to organise complex hierarchies.

Correct

IAM Groups cannot contain other groups. They are flat containers for IAM Users only. If you need hierarchies, you must use organisational units in AWS Organizations, not IAM Groups.

People familiar with directory services like Active Directory (now Microsoft Entra ID) expect group nesting. IAM purposely kept groups simple to avoid complexity.

Do You Actually Know This?

Reveal each answer, then mark whether you got it right. Score 60%+ to unlock the next chapter.

Frequently Asked Questions

What is the difference between an IAM User and an IAM Role?

An IAM User is a permanent identity with long-term credentials (password or access key) used by a person or application. An IAM Role is a temporary identity assumed by an entity that needs time-limited permissions, like an EC2 instance accessing a database.

Can I use the same IAM Policy for multiple users?

Yes. You attach a single policy to an IAM Group, and all users in that group inherit the permissions. You can also attach the policy directly to individual users or roles. This makes it easy to manage permissions at scale.

What is the root user and why should I avoid using it?

The root user is the email address you used to create the AWS account. It has unrestricted, irrevokable access to all resources. It should only be used for a few account-level tasks (like closing the account or changing the account name) and never for daily work. Anyone who gains access to the root user can permanently destroy your entire cloud infrastructure.

What is Multi-Factor Authentication (MFA) in IAM?

MFA adds an extra layer of security by requiring a second form of authentication, typically a time-based one-time code from a mobile app (like Google Authenticator) or a hardware device. You can enforce MFA using an IAM policy condition that checks if 'aws:MultiFactorAuthPresent' is true.

Can I restrict access to specific IP addresses using IAM?

Yes. You can use a 'Condition' block in an IAM Policy with the key 'aws:SourceIp' to allow or deny actions based on the user's IP address. For example, you might allow admin actions only from your office's public IP range.

What is the difference between an Identity-based Policy and a Resource-based Policy?

An Identity-based Policy is attached to an IAM User, Group, or Role and controls what that identity can do. A Resource-based Policy is attached directly to a resource (like an S3 bucket) and controls who can access that resource, even if the user is from another AWS account.

Terms Worth Knowing

Ready to put this to the test?

You've just covered Identity and Access Management (IAM) Basics — now see how well it sticks with free DVA-C02 practice questions. Full explanations included, no account needed.

Done with this chapter?