IAM (Identity and Access Management) decides who can do what in the account. Every command you run is checked by IAM first.
The account's first identity is the root user. It can do anything, and nothing can limit it. So it is locked away: a long password plus MFA (multi-factor authentication), a code from a phone that a thief doesn't have. Root is only for the rare jobs that need it.
Everyone else gets an identity of their own:
| IAM has | It is | Chapter |
|---|---|---|
| users | one person, or one program | this one |
| groups | users who do the same job | this one |
| policies | the list of what is allowed | this one |
| roles | an identity for a server or a service | 4 |
Never share a password or keys. With one identity each, you can give each person exactly the right access, and see who did what.
IAM is global: users work in every region, so IAM commands need no --region.
aws iam list-users
Lists the account's users. The --query keeps only their names.
+---------+
|ListUsers|
+---------+
| admin | ← you, in CloudShell
+---------+