0
0
AWScloud~20 mins

IAM roles concept in AWS - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
IAM Roles Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Understanding IAM Role Trust Policies

Which statement best describes the purpose of the trust policy in an AWS IAM role?

AIt defines which AWS services or users can assume the role.
BIt specifies the permissions granted to the role for accessing AWS resources.
CIt encrypts the role's credentials to enhance security.
DIt logs all actions performed by the role for auditing.
Attempts:
2 left
💡 Hint

Think about who is allowed to use the role, not what the role can do.

service_behavior
intermediate
2:00remaining
Role Assumption Behavior

What happens when an AWS Lambda function assumes an IAM role with limited permissions?

AThe Lambda function can perform any action in AWS regardless of the role's permissions.
BThe Lambda function ignores the role's permissions and uses the account root permissions.
CThe Lambda function can perform only the actions allowed by the role's permissions.
DThe Lambda function cannot access AWS resources unless explicitly granted permissions in its code.
Attempts:
2 left
💡 Hint

Consider how roles limit what a service can do.

Architecture
advanced
3:00remaining
Cross-Account Access Using IAM Roles

You want an EC2 instance in Account A to access an S3 bucket in Account B securely. Which setup correctly enables this using IAM roles?

ACreate an IAM role in Account A with permissions to access the S3 bucket in Account B without any trust policy in Account B.
BCreate an IAM role in Account B with permissions to access the S3 bucket and a trust policy allowing Account A's EC2 instance to assume it. Then configure the EC2 instance to assume this role.
CCreate an IAM user in Account B with S3 access and share its access keys with the EC2 instance in Account A.
DAttach an IAM role with S3 access directly to the EC2 instance in Account A without any trust policy changes.
Attempts:
2 left
💡 Hint

Think about how trust policies enable cross-account role assumption.

security
advanced
2:30remaining
Least Privilege Principle with IAM Roles

You have an IAM role used by an application that only needs to read data from DynamoDB. Which policy best follows the least privilege principle?

AA policy granting only the dynamodb:GetItem and dynamodb:Query actions on the specific DynamoDB table.
BA policy granting full access to all DynamoDB actions on all tables.
CA policy granting read and write permissions on all DynamoDB tables.
DA policy granting only the dynamodb:Scan action on all DynamoDB tables.
Attempts:
2 left
💡 Hint

Least privilege means giving only the exact permissions needed.

Best Practice
expert
3:00remaining
Automating Temporary Credentials with IAM Roles

You want to automate a process that runs on an on-premises server and needs temporary AWS credentials with limited permissions. Which approach follows AWS best practices?

AUse the root account credentials to authenticate the on-premises server for full access.
BCreate an IAM user with long-term access keys and embed them in the on-premises server configuration.
CManually generate IAM user credentials daily and update the on-premises server configuration.
DUse AWS Security Token Service (STS) to assume an IAM role with limited permissions and retrieve temporary credentials programmatically.
Attempts:
2 left
💡 Hint

Think about temporary credentials and automation without long-term keys.