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
Root user vs IAM user
📖 Scenario: You are setting up an AWS account for your small business. You want to understand the difference between the root user and IAM users to keep your account secure.
🎯 Goal: Create an AWS IAM user with limited permissions and compare it with the root user access.
📋 What You'll Learn
Create a variable called root_user representing the root user with full access
Create a dictionary called iam_users with two IAM users and their permission levels
Write a function called check_access that takes a username and returns their access level
Add a final statement that shows the access level of the root user and one IAM user
💡 Why This Matters
🌍 Real World
Understanding root and IAM users helps keep AWS accounts secure by limiting access.
💼 Career
Cloud engineers and administrators must manage user permissions carefully to protect resources.
Progress0 / 4 steps
1
Create root user and IAM users data
Create a variable called root_user with the value 'full_access'. Then create a dictionary called iam_users with these exact entries: 'alice': 'read_only' and 'bob': 'write_access'.
AWS
Hint
Think of root_user as the main account with all permissions. IAM users have specific permissions.
2
Add a function to check user access
Write a function called check_access that takes a parameter username. If username is 'root', return the value of root_user. Otherwise, return the permission level from iam_users for that username.
AWS
Hint
Use an if statement to check if the username is 'root'. Use iam_users.get() to safely get permissions for IAM users.
3
Use the function to get access levels
Create a variable called root_access and set it to the result of calling check_access with 'root'. Then create a variable called alice_access and set it to the result of calling check_access with 'alice'.
AWS
Hint
Call the function check_access with the usernames 'root' and 'alice' and save the results.
4
Add a final statement to show access levels
Create a dictionary called access_summary with keys 'root' and 'alice' and their corresponding access levels from root_access and alice_access.
AWS
Hint
Use a dictionary to summarize the access levels for 'root' and 'alice'.
Practice
(1/5)
1. Which AWS user has full access to all resources and billing information by default?
easy
A. IAM user with admin permissions
B. Federated user
C. IAM user with read-only permissions
D. Root user
Solution
Step 1: Understand AWS user types
The root user is the original account owner with full control over all AWS services and billing.
Step 2: Compare with IAM users
IAM users have permissions assigned and do not have full access by default.
Final Answer:
Root user -> Option D
Quick Check:
Full access = Root user [OK]
Hint: Root user = full control, IAM users = limited [OK]
Common Mistakes:
Confusing IAM admin user with root user
Thinking IAM users have full billing access by default
Assuming federated users have root privileges
2. Which of the following is the correct way to create an IAM user in AWS Management Console?
easy
A. Use AWS Billing dashboard to add a user
B. Go to IAM > Users > Add user, then set permissions
C. Log in as root user and create a new AWS account
D. Create a new user under AWS Organizations
Solution
Step 1: Locate IAM user creation
IAM users are created in the IAM service under Users > Add user.
Step 2: Understand permissions assignment
After adding a user, you assign permissions directly or via groups.
Final Answer:
Go to IAM > Users > Add user, then set permissions -> Option B
Quick Check:
IAM user creation = IAM console [OK]
Hint: Create IAM users only in IAM console, not billing or orgs [OK]
Common Mistakes:
Trying to create IAM users in Billing dashboard
Confusing AWS Organizations with IAM user creation
Creating new AWS accounts instead of IAM users
3. If an IAM user tries to delete an S3 bucket but gets an Access Denied error, what is the most likely reason?
medium
A. The IAM user does not have delete permissions for the bucket
B. The root user disabled S3 service
C. The bucket is owned by another AWS account
D. IAM users cannot delete S3 buckets
Solution
Step 1: Check IAM user permissions
IAM users need explicit permissions to delete S3 buckets; lacking these causes Access Denied.
Step 2: Evaluate other options
Root user cannot disable S3 service; buckets owned by others can cause issues but usually different errors; IAM users can delete buckets if permitted.
Final Answer:
The IAM user does not have delete permissions for the bucket -> Option A
Quick Check:
Access Denied = missing permissions [OK]
Hint: Access Denied usually means missing permission, not service disabled [OK]
Common Mistakes:
Assuming root user disables services
Believing IAM users cannot delete buckets at all
Ignoring bucket ownership issues
4. An administrator accidentally used the root user credentials for daily tasks and now wants to improve security. What should they do to fix this?
medium
A. Create IAM users with appropriate permissions and avoid using root user for daily tasks
B. Delete the root user and use only IAM users
C. Share root user credentials with team members for convenience
D. Disable MFA on root user to simplify login
Solution
Step 1: Understand root user best practices
Root user should be used only for account setup and billing, not daily tasks.
Step 2: Implement IAM users for daily work
Create IAM users with limited permissions for daily tasks to improve security.
Final Answer:
Create IAM users with appropriate permissions and avoid using root user for daily tasks -> Option A
Quick Check:
Use IAM users daily, root only for emergencies [OK]
Hint: Use IAM users daily; keep root user locked down [OK]
Common Mistakes:
Trying to delete root user (impossible)
Sharing root credentials widely
Disabling MFA on root user
5. A company wants to restrict billing access to only the root user but allow IAM users to manage resources. Which AWS best practice should they follow?
hard
A. Create IAM users with billing permissions and avoid using root user
B. Grant all IAM users full admin access including billing
C. Use the root user only for billing and create IAM users with resource permissions
D. Disable root user and use IAM users for all tasks
Solution
Step 1: Understand billing access control
Billing access is sensitive and should be limited to the root user for security.
Step 2: Assign resource management to IAM users
IAM users should have permissions to manage resources but not billing.
Final Answer:
Use the root user only for billing and create IAM users with resource permissions -> Option C
Quick Check:
Billing = root only; resource management = IAM users [OK]
Hint: Keep billing to root user; IAM users manage resources [OK]
Common Mistakes:
Giving IAM users billing permissions unnecessarily