IAM security and governance
- Work through concepts, commands and troubleshooting in all eight modules.
- Review changesets and verify resource lifecycle behavior in a sandbox.
- Explain deployment results using stack events, outputs and service evidence.
1-hour schedule
| # | Time | Module | Core content | Learning views |
|---|---|---|---|---|
| 1 | 00–06 · 6 min | Caller permissions | Scope permissions for stack operations, reads, updates and deletes. | Concepts, commands, lab, production and troubleshooting |
| 2 | 06–13 · 7 min | CloudFormation service roles | Separate caller authority from the service role used to provision resources. | Concepts, commands, lab, production and troubleshooting |
| 3 | 13–21 · 8 min | iam:PassRole boundary | Constrain which roles a deployment principal can pass to CloudFormation. | Concepts, commands, lab, production and troubleshooting |
| 4 | 21–29 · 8 min | IAM capability acknowledgements | Review CAPABILITY_IAM and CAPABILITY_NAMED_IAM before deploying IAM resources. | Concepts, commands, lab, production and troubleshooting |
| 5 | 29–37 · 8 min | Secrets and dynamic references | Keep plaintext out of templates and use supported secret references with narrow access. | Concepts, commands, lab, production and troubleshooting |
| 6 | 37–45 · 8 min | CloudFormation Guard | Validate templates against organization rules in a pre-deployment workflow. | Concepts, commands, lab, production and troubleshooting |
| 7 | 45–52 · 7 min | CloudFormation Hooks | Use hooks to evaluate resource operations and provide guardrail feedback. | Concepts, commands, lab, production and troubleshooting |
| 8 | 52–60 · 8 min | SCPs, stack policies and controls | Layer organizational boundaries, IAM and stack-level protections correctly. | Concepts, commands, lab, production and troubleshooting |
How to use this course
Each module includes concepts, a diagram, a walkthrough, commands, a lab, a production case, troubleshooting, a quiz, narration and official references. Progress is saved in this browser.
Lab requirements: AWS CLI v2, a sandbox account and least-privilege permissions. Verify account/Region before labs and clean up afterward.
Setup
Prepare AWS CLI v2, a sandbox account and deployment permissions. Verify identity and Region; do not run labs in a production account.
aws --version
aws sts get-caller-identity --profile sandbox
aws configure list --profile sandboxLabs may create resources. Follow each lab's cleanup steps and verify stack status when finished.
Caller permissions
Core concepts
Scope permissions for stack operations, reads, updates and deletes.
- Check the resource reference for properties and update behavior.
- Make the relationship between template, parameters, execution identity and target environment explicit.
- Record an observable expected result and cleanup method.
Request path
Template → Validate → Change set → Review → Execute → Caller permissions → Verify eventsKeep reviewable inputs and results at each stage; a change set does not apply proposed changes until execution.
Deployment state sequence
- Identify the requirement: Caller permissions
- Validate the inputs and inspect the proposed resource action
- Execute in a sandbox and verify the resulting stack events
Commands and notes
aws iam simulate-principal-policy --policy-source-arn arn:aws:iam::123456789012:role/CfnDeploy --action-names cloudformation:UpdateStackConfirm profile, account and Region first. Replace example names with sandbox resources.
Hands-on lab
Apply this module to a disposable sandbox stack. Record the input, command, expected CloudFormation event or result, and cleanup step. Verify the outcome before moving to the next module: Scope permissions for stack operations, reads, updates and deletes.
- Run the command and save its output.
- Compare it with the expected result and record differences.
- Delete the lab stack and confirm there are no leftover resources.
Production case review
Production review: make this behavior explicit in the template and change review. Confirm ownership, blast radius, rollback or retention behavior, and the evidence an operator can use during an incident. Topic: Scope permissions for stack operations, reads, updates and deletes.
Troubleshooting path
If the operation fails, capture the stack status, logical resource ID and earliest failed event. Separate template, permission, quota, service stabilization and dependency causes; fix the source, then create a fresh change set before retrying. Topic: Scope permissions for stack operations, reads, updates and deletes.
aws cloudformation describe-stack-events --stack-name app-dev --region us-east-1Narration script
Scope permissions for stack operations, reads, updates and deletes.
The key is to record the desired state in a template, execute it through a stack, and use event evidence to verify the result.
Official learning resources
Work through the AWS User Guide and CloudFormation Workshop. This lesson emphasizes reviewable text-based labs.
CloudFormation service roles
Core concepts
Separate caller authority from the service role used to provision resources.
- Check the resource reference for properties and update behavior.
- Make the relationship between template, parameters, execution identity and target environment explicit.
- Record an observable expected result and cleanup method.
Request path
Template → Validate → Change set → Review → Execute → CloudFormation service roles → Verify eventsKeep reviewable inputs and results at each stage; a change set does not apply proposed changes until execution.
Deployment state sequence
- Identify the requirement: CloudFormation service roles
- Validate the inputs and inspect the proposed resource action
- Execute in a sandbox and verify the resulting stack events
Commands and notes
aws cloudformation describe-stacks --stack-name app-dev --query Stacks[0].RoleARNConfirm profile, account and Region first. Replace example names with sandbox resources.
Hands-on lab
Apply this module to a disposable sandbox stack. Record the input, command, expected CloudFormation event or result, and cleanup step. Verify the outcome before moving to the next module: Separate caller authority from the service role used to provision resources.
- Run the command and save its output.
- Compare it with the expected result and record differences.
- Delete the lab stack and confirm there are no leftover resources.
Production case review
Production review: make this behavior explicit in the template and change review. Confirm ownership, blast radius, rollback or retention behavior, and the evidence an operator can use during an incident. Topic: Separate caller authority from the service role used to provision resources.
Troubleshooting path
If the operation fails, capture the stack status, logical resource ID and earliest failed event. Separate template, permission, quota, service stabilization and dependency causes; fix the source, then create a fresh change set before retrying. Topic: Separate caller authority from the service role used to provision resources.
aws cloudformation describe-stack-events --stack-name app-dev --region us-east-1Narration script
Separate caller authority from the service role used to provision resources.
The key is to record the desired state in a template, execute it through a stack, and use event evidence to verify the result.
Official learning resources
Work through the AWS User Guide and CloudFormation Workshop. This lesson emphasizes reviewable text-based labs.
iam:PassRole boundary
Core concepts
Constrain which roles a deployment principal can pass to CloudFormation.
- Check the resource reference for properties and update behavior.
- Make the relationship between template, parameters, execution identity and target environment explicit.
- Record an observable expected result and cleanup method.
Request path
Template → Validate → Change set → Review → Execute → iam:PassRole boundary → Verify eventsKeep reviewable inputs and results at each stage; a change set does not apply proposed changes until execution.
Deployment state sequence
- Identify the requirement: iam:PassRole boundary
- Validate the inputs and inspect the proposed resource action
- Execute in a sandbox and verify the resulting stack events
Commands and notes
aws iam simulate-principal-policy --policy-source-arn arn:aws:iam::123456789012:role/CfnDeploy --action-names iam:PassRoleConfirm profile, account and Region first. Replace example names with sandbox resources.
Hands-on lab
Apply this module to a disposable sandbox stack. Record the input, command, expected CloudFormation event or result, and cleanup step. Verify the outcome before moving to the next module: Constrain which roles a deployment principal can pass to CloudFormation.
- Run the command and save its output.
- Compare it with the expected result and record differences.
- Delete the lab stack and confirm there are no leftover resources.
Production case review
Production review: make this behavior explicit in the template and change review. Confirm ownership, blast radius, rollback or retention behavior, and the evidence an operator can use during an incident. Topic: Constrain which roles a deployment principal can pass to CloudFormation.
Troubleshooting path
If the operation fails, capture the stack status, logical resource ID and earliest failed event. Separate template, permission, quota, service stabilization and dependency causes; fix the source, then create a fresh change set before retrying. Topic: Constrain which roles a deployment principal can pass to CloudFormation.
aws cloudformation describe-stack-events --stack-name app-dev --region us-east-1Narration script
Constrain which roles a deployment principal can pass to CloudFormation.
The key is to record the desired state in a template, execute it through a stack, and use event evidence to verify the result.
Official learning resources
Work through the AWS User Guide and CloudFormation Workshop. This lesson emphasizes reviewable text-based labs.
IAM capability acknowledgements
Core concepts
Review CAPABILITY_IAM and CAPABILITY_NAMED_IAM before deploying IAM resources.
- Check the resource reference for properties and update behavior.
- Make the relationship between template, parameters, execution identity and target environment explicit.
- Record an observable expected result and cleanup method.
Request path
Template → Validate → Change set → Review → Execute → IAM capability acknowledgements → Verify eventsKeep reviewable inputs and results at each stage; a change set does not apply proposed changes until execution.
Deployment state sequence
- Identify the requirement: IAM capability acknowledgements
- Validate the inputs and inspect the proposed resource action
- Execute in a sandbox and verify the resulting stack events
Commands and notes
aws cloudformation get-template-summary --template-body file://template.yamlConfirm profile, account and Region first. Replace example names with sandbox resources.
Hands-on lab
Apply this module to a disposable sandbox stack. Record the input, command, expected CloudFormation event or result, and cleanup step. Verify the outcome before moving to the next module: Review CAPABILITY_IAM and CAPABILITY_NAMED_IAM before deploying IAM resources.
- Run the command and save its output.
- Compare it with the expected result and record differences.
- Delete the lab stack and confirm there are no leftover resources.
Production case review
Production review: make this behavior explicit in the template and change review. Confirm ownership, blast radius, rollback or retention behavior, and the evidence an operator can use during an incident. Topic: Review CAPABILITY_IAM and CAPABILITY_NAMED_IAM before deploying IAM resources.
Troubleshooting path
If the operation fails, capture the stack status, logical resource ID and earliest failed event. Separate template, permission, quota, service stabilization and dependency causes; fix the source, then create a fresh change set before retrying. Topic: Review CAPABILITY_IAM and CAPABILITY_NAMED_IAM before deploying IAM resources.
aws cloudformation describe-stack-events --stack-name app-dev --region us-east-1Narration script
Review CAPABILITY_IAM and CAPABILITY_NAMED_IAM before deploying IAM resources.
The key is to record the desired state in a template, execute it through a stack, and use event evidence to verify the result.
Official learning resources
Work through the AWS User Guide and CloudFormation Workshop. This lesson emphasizes reviewable text-based labs.
Secrets and dynamic references
Core concepts
Keep plaintext out of templates and use supported secret references with narrow access.
- Check the resource reference for properties and update behavior.
- Make the relationship between template, parameters, execution identity and target environment explicit.
- Record an observable expected result and cleanup method.
Request path
Template → Validate → Change set → Review → Execute → Secrets and dynamic references → Verify eventsKeep reviewable inputs and results at each stage; a change set does not apply proposed changes until execution.
Deployment state sequence
- Identify the requirement: Secrets and dynamic references
- Validate the inputs and inspect the proposed resource action
- Execute in a sandbox and verify the resulting stack events
Commands and notes
cfn-guard validate --rules policy.guard --data template.yamlConfirm profile, account and Region first. Replace example names with sandbox resources.
Hands-on lab
Apply this module to a disposable sandbox stack. Record the input, command, expected CloudFormation event or result, and cleanup step. Verify the outcome before moving to the next module: Keep plaintext out of templates and use supported secret references with narrow access.
- Run the command and save its output.
- Compare it with the expected result and record differences.
- Delete the lab stack and confirm there are no leftover resources.
Production case review
Production review: make this behavior explicit in the template and change review. Confirm ownership, blast radius, rollback or retention behavior, and the evidence an operator can use during an incident. Topic: Keep plaintext out of templates and use supported secret references with narrow access.
Troubleshooting path
If the operation fails, capture the stack status, logical resource ID and earliest failed event. Separate template, permission, quota, service stabilization and dependency causes; fix the source, then create a fresh change set before retrying. Topic: Keep plaintext out of templates and use supported secret references with narrow access.
aws cloudformation describe-stack-events --stack-name app-dev --region us-east-1Narration script
Keep plaintext out of templates and use supported secret references with narrow access.
The key is to record the desired state in a template, execute it through a stack, and use event evidence to verify the result.
Official learning resources
Work through the AWS User Guide and CloudFormation Workshop. This lesson emphasizes reviewable text-based labs.
CloudFormation Guard
Core concepts
Validate templates against organization rules in a pre-deployment workflow.
- Check the resource reference for properties and update behavior.
- Make the relationship between template, parameters, execution identity and target environment explicit.
- Record an observable expected result and cleanup method.
Request path
Template → Validate → Change set → Review → Execute → CloudFormation Guard → Verify eventsKeep reviewable inputs and results at each stage; a change set does not apply proposed changes until execution.
Deployment state sequence
- Identify the requirement: CloudFormation Guard
- Validate the inputs and inspect the proposed resource action
- Execute in a sandbox and verify the resulting stack events
Commands and notes
aws cloudformation list-types --visibility PUBLIC --type RESOURCEConfirm profile, account and Region first. Replace example names with sandbox resources.
Hands-on lab
Apply this module to a disposable sandbox stack. Record the input, command, expected CloudFormation event or result, and cleanup step. Verify the outcome before moving to the next module: Validate templates against organization rules in a pre-deployment workflow.
- Run the command and save its output.
- Compare it with the expected result and record differences.
- Delete the lab stack and confirm there are no leftover resources.
Production case review
Production review: make this behavior explicit in the template and change review. Confirm ownership, blast radius, rollback or retention behavior, and the evidence an operator can use during an incident. Topic: Validate templates against organization rules in a pre-deployment workflow.
Troubleshooting path
If the operation fails, capture the stack status, logical resource ID and earliest failed event. Separate template, permission, quota, service stabilization and dependency causes; fix the source, then create a fresh change set before retrying. Topic: Validate templates against organization rules in a pre-deployment workflow.
aws cloudformation describe-stack-events --stack-name app-dev --region us-east-1Narration script
Validate templates against organization rules in a pre-deployment workflow.
The key is to record the desired state in a template, execute it through a stack, and use event evidence to verify the result.
Official learning resources
Work through the AWS User Guide and CloudFormation Workshop. This lesson emphasizes reviewable text-based labs.
CloudFormation Hooks
Core concepts
Use hooks to evaluate resource operations and provide guardrail feedback.
- Check the resource reference for properties and update behavior.
- Make the relationship between template, parameters, execution identity and target environment explicit.
- Record an observable expected result and cleanup method.
Request path
Template → Validate → Change set → Review → Execute → CloudFormation Hooks → Verify eventsKeep reviewable inputs and results at each stage; a change set does not apply proposed changes until execution.
Deployment state sequence
- Identify the requirement: CloudFormation Hooks
- Validate the inputs and inspect the proposed resource action
- Execute in a sandbox and verify the resulting stack events
Commands and notes
aws cloudformation list-types --type HOOK --visibility PRIVATEConfirm profile, account and Region first. Replace example names with sandbox resources.
Hands-on lab
Apply this module to a disposable sandbox stack. Record the input, command, expected CloudFormation event or result, and cleanup step. Verify the outcome before moving to the next module: Use hooks to evaluate resource operations and provide guardrail feedback.
- Run the command and save its output.
- Compare it with the expected result and record differences.
- Delete the lab stack and confirm there are no leftover resources.
Production case review
Production review: make this behavior explicit in the template and change review. Confirm ownership, blast radius, rollback or retention behavior, and the evidence an operator can use during an incident. Topic: Use hooks to evaluate resource operations and provide guardrail feedback.
Troubleshooting path
If the operation fails, capture the stack status, logical resource ID and earliest failed event. Separate template, permission, quota, service stabilization and dependency causes; fix the source, then create a fresh change set before retrying. Topic: Use hooks to evaluate resource operations and provide guardrail feedback.
aws cloudformation describe-stack-events --stack-name app-dev --region us-east-1Narration script
Use hooks to evaluate resource operations and provide guardrail feedback.
The key is to record the desired state in a template, execute it through a stack, and use event evidence to verify the result.
Official learning resources
Work through the AWS User Guide and CloudFormation Workshop. This lesson emphasizes reviewable text-based labs.
SCPs, stack policies and controls
Core concepts
Layer organizational boundaries, IAM and stack-level protections correctly.
- Check the resource reference for properties and update behavior.
- Make the relationship between template, parameters, execution identity and target environment explicit.
- Record an observable expected result and cleanup method.
Request path
Template → Validate → Change set → Review → Execute → SCPs, stack policies and controls → Verify eventsKeep reviewable inputs and results at each stage; a change set does not apply proposed changes until execution.
Deployment state sequence
- Identify the requirement: SCPs, stack policies and controls
- Validate the inputs and inspect the proposed resource action
- Execute in a sandbox and verify the resulting stack events
Commands and notes
aws organizations describe-organizationConfirm profile, account and Region first. Replace example names with sandbox resources.
Hands-on lab
Apply this module to a disposable sandbox stack. Record the input, command, expected CloudFormation event or result, and cleanup step. Verify the outcome before moving to the next module: Layer organizational boundaries, IAM and stack-level protections correctly.
- Run the command and save its output.
- Compare it with the expected result and record differences.
- Delete the lab stack and confirm there are no leftover resources.
Production case review
Production review: make this behavior explicit in the template and change review. Confirm ownership, blast radius, rollback or retention behavior, and the evidence an operator can use during an incident. Topic: Layer organizational boundaries, IAM and stack-level protections correctly.
Troubleshooting path
If the operation fails, capture the stack status, logical resource ID and earliest failed event. Separate template, permission, quota, service stabilization and dependency causes; fix the source, then create a fresh change set before retrying. Topic: Layer organizational boundaries, IAM and stack-level protections correctly.
aws cloudformation describe-stack-events --stack-name app-dev --region us-east-1Narration script
Layer organizational boundaries, IAM and stack-level protections correctly.
The key is to record the desired state in a template, execute it through a stack, and use event evidence to verify the result.
Official learning resources
Work through the AWS User Guide and CloudFormation Workshop. This lesson emphasizes reviewable text-based labs.
Cheat sheet
Command card
aws sts get-caller-identity
aws cloudformation validate-template --template-body file://template.yaml
aws cloudformation deploy --template-file template.yaml --stack-name app-dev
aws cloudformation describe-stacks --stack-name app-dev
aws cloudformation describe-stack-events --stack-name app-dev
aws cloudformation detect-stack-drift --stack-name app-dev
aws cloudformation delete-stack --stack-name app-devBefore an update
- Confirm account, Region, profile and execution role.
- Review replacements, deletions and retention behavior in the change set.
- Check drift, backups, alarms and rollback ownership.
Capstone lab and final quiz
Lab: review and deploy a controlled stack
Open the runnable SQS capstone lab and template ↗
- Write a template with a low-risk resource and parameterize the environment name.
- Run template checks, create a change set and review resource actions.
- Execute the change set in a sandbox and inspect stack events and outputs.
- Run drift detection, then clean up resources according to retention policy.
Final quiz
Sources and version notes
CloudFormation resource properties and CLI behavior evolve. Check current AWS documentation before deployment.