Jump into concepts and practice - no test required
or
Recommended
Test this pattern10 questions across easy, medium, and hard to know if this pattern is strong
Recall & Review
beginner
What is an IAM role in AWS?
An IAM role is like a set of permissions that you can give to AWS services or users to let them do specific tasks without sharing your personal credentials.
Click to reveal answer
beginner
How is an IAM role different from an IAM user?
An IAM user is a person or service with long-term credentials, while an IAM role is a temporary set of permissions that can be assumed by users or services when needed.
Click to reveal answer
beginner
What does it mean to 'assume' an IAM role?
To 'assume' a role means to temporarily take on the permissions defined by that role to perform tasks, like borrowing a key to access a room for a short time.
Click to reveal answer
intermediate
Why use IAM roles instead of sharing access keys?
IAM roles improve security by avoiding sharing permanent keys. They provide temporary permissions that expire, reducing risk if credentials are exposed.
Click to reveal answer
beginner
Give an example of when you would use an IAM role.
You use an IAM role when an EC2 instance needs to access S3 storage. Instead of storing keys on the instance, the EC2 assumes a role with permission to read S3.
Click to reveal answer
What is the main purpose of an IAM role in AWS?
ATo monitor AWS usage
BTo create permanent user accounts
CTo grant temporary permissions to users or services
DTo store data securely
✗ Incorrect
IAM roles provide temporary permissions that can be assumed by users or services.
Which of the following can assume an IAM role?
AOnly root account
BOnly AWS services
COnly IAM users
DBoth IAM users and AWS services
✗ Incorrect
Both IAM users and AWS services can assume roles to gain temporary permissions.
What happens when you assume an IAM role?
AYou get permanent access keys
BYou receive temporary security credentials
CYour user account is deleted
DYou create a new IAM user
✗ Incorrect
Assuming a role provides temporary security credentials for access.
Why is using IAM roles considered more secure than sharing access keys?
ARoles provide temporary credentials that reduce risk
BRoles allow unlimited access
CRoles never expire
DRoles are easier to remember
✗ Incorrect
Temporary credentials from roles reduce the risk of long-term key exposure.
Which AWS service commonly uses IAM roles to access other services securely?
AAmazon EC2
BAmazon S3
CAWS Lambda
DAmazon RDS
✗ Incorrect
Amazon EC2 instances often assume IAM roles to securely access other AWS services.
Explain what an IAM role is and how it helps improve security in AWS.
Think about borrowing permissions instead of sharing keys.
You got /4 concepts.
Describe a real-life scenario where you would use an IAM role in AWS.
Consider how an EC2 server accesses S3 without storing keys.
You got /4 concepts.
Practice
(1/5)
1. What is the main purpose of an IAM role in AWS?
easy
A. To monitor network traffic
B. To store user passwords securely
C. To create virtual machines
D. To grant permissions to entities without sharing long-term credentials
Solution
Step 1: Understand IAM role purpose
An IAM role allows AWS entities to assume permissions temporarily without needing permanent credentials like passwords.
Step 2: Compare options
Only To grant permissions to entities without sharing long-term credentials correctly describes this purpose. Options B, C, and D describe unrelated AWS features.
Final Answer:
To grant permissions to entities without sharing long-term credentials -> Option D
Quick Check:
IAM roles = temporary permissions without passwords [OK]
Hint: Roles give permissions without passwords or keys [OK]
Common Mistakes:
Confusing roles with user accounts
Thinking roles store passwords
Mixing roles with AWS services like EC2
2. Which of the following is the correct way to specify a trust policy for an IAM role?
C. Because the action should be sts:AssumeRole, not iam:PassRole
D. Because EC2 instances cannot assume roles
Solution
Step 1: Identify the required action in trust policy
The trust policy must allow the action sts:AssumeRole for the trusted entity to assume the role.
Step 2: Analyze the given policy
The policy uses iam:PassRole, which is incorrect for trust. This prevents EC2 from assuming the role.
Final Answer:
Because the action should be sts:AssumeRole, not iam:PassRole -> Option C
Quick Check:
Trust policy action must be sts:AssumeRole [OK]
Hint: Trust policy action must be sts:AssumeRole [OK]
Common Mistakes:
Using iam:PassRole instead of sts:AssumeRole
Changing Effect to Deny by mistake
Believing EC2 cannot assume roles
5. You want to allow an AWS Lambda function to assume an IAM role that grants access to S3 buckets. Which two policies must you configure correctly to make this work?
hard
A. A trust policy allowing lambda.amazonaws.com to assume the role and an IAM permissions policy granting S3 access
B. A trust policy allowing s3.amazonaws.com to assume the role and an IAM permissions policy granting Lambda execution
C. An IAM user policy granting Lambda permissions and a trust policy allowing EC2 to assume the role
D. A permissions policy granting S3 access and a trust policy denying all principals
Solution
Step 1: Identify trust policy requirements
The trust policy must allow the Lambda service (lambda.amazonaws.com) to assume the role.
Step 2: Identify permissions policy requirements
The role's permissions policy must grant access to S3 buckets for the Lambda function.
Step 3: Evaluate options
A trust policy allowing lambda.amazonaws.com to assume the role and an IAM permissions policy granting S3 access correctly pairs the trust policy for Lambda and permissions for S3. Other options have incorrect principals or deny access.
Final Answer:
A trust policy allowing lambda.amazonaws.com to assume the role and an IAM permissions policy granting S3 access -> Option A
Quick Check:
Trust policy + permissions policy = role works [OK]
Hint: Trust policy for who assumes; permissions policy for what they can do [OK]