A hands-on lab in twelve slides, in the console and the CLI: check that alice cannot read the project bucket and give her a console password; create the role s3-reader in the console, trusted by alice alone, with AmazonS3ReadOnlyAccess; see bob refused; assume the role as alice in the console with Switch Role and in the CLI with aws sts assume-role; see what it allows and what it denies; assume it with a CLI profile; clean up.
The slides
The tool is a hands-on lab in twelve slides, one step each, with the steps to follow beside a terminal, a policy to paste,
or a picture of the role, who may assume it, and its sessions:
- Introduction: what the lab makes.
- 1. Before the role
- Check alice, bob and the bucket:
alice is refused the bucket. - Give alice a console password: for Switch Role.
- 2. The role
- Create the role in the console, as jane: a custom trust policy naming
alice, and AmazonS3ReadOnlyAccess. - Read the role from the CLI: its trust policy and its permissions policy.
- 3. Assuming the role
- Show that bob cannot assume the role: STS refuses him.
- Switch to the role in the console: as
alice, and back. - Assume the role in the CLI with STS:
aws sts assume-role, and the three environment variables.
- 4. What the role allows
- See what the role allows: listing and reading the bucket.
- See what the role denies: an upload, and the list of users.
- Assume the role with a CLI profile:
role_arn and source_profile.
- 5. Clean up: the role, the console password, the profile.
The buttons on the left and right edges move between slides. So do the arrow keys and a swipe.
The lab starts where the
S3 lab leaves the bucket and the users alice and bob, before its
clean-up. The lesson
IAM Roles explains what it uses.
The placeholders
The CLI outputs come from a real run on 2026-11-15, with demo users standing for alice and bob. The account ID and
the keys are AWS's documentation placeholders (111122223333, ASIAIOSFODNN7EXAMPLE).
Sources