Learning Objectives
- Understand what AWS IAM users represent and when to create them
- Learn how to authenticate users securely with MFA
- Recognize why the root user should stay locked away
The Permanent Residents
Imagine your castle has permanent residents—people who live and work there every day. They each have their own key to the main gate. That’s an IAM user.
An IAM user represents a person or application that needs long-term access to AWS. Each user gets a unique identity with credentials—either a password for console access or access keys for CLI and API calls.
Here’s the thing: unlike a medieval castle where one master key opens everything, AWS lets you give each resident only the keys they need. A scribe doesn’t need access to the armory. A knight doesn’t need access to the treasury.
Creating Your First Resident
Let’s create an IAM user using the AWS CLI:
bash
aws iam create-user --user-name alice-developer
aws iam create-login-profile \
--user-name alice-developer \
--password TempPassword123! \
--password-reset-required
Alice now exists in your AWS account. But she can’t do anything yet—she has no permissions. We’ll fix that when we talk about policies in Chapter 3.
The Root User: Your Master Key
Every AWS account starts with a root user—the account owner with unlimited access. This is your castle’s master key, and it should stay in a locked vault.
Why? If someone steals the master key, they control everything. The root user can delete your entire infrastructure, rack up massive bills, or lock you out of your own account.
Best practice: Use the root user only for initial setup, then lock it away. Enable MFA on it. Never use it for daily work. Create IAM users instead—even for yourself.
Multi-Factor Authentication (MFA)
Think of MFA as a two-key system. One key is your password. The other is a temporary code from your phone or hardware token. Even if someone steals your password, they can’t get in without the second key.
Enable MFA for all users who access the console:
bash
aws iam enable-mfa-device \
--user-name alice-developer \
--serial-number arn:aws:iam::123456789012:mfa/alice \
--authentication-code1 123456 \
--authentication-code2 789012
In DevOps, we automate everything—but humans still log in to troubleshoot, configure, and approve changes. Protect those human accounts like you’d protect the castle throne room.
Reflection: Do you currently use the root user for daily tasks? If yes, what’s your plan to stop?
