CI/CD and multi-account delivery

AWS CloudFormation · 60 minutes · 8 modules
AWS CloudFormationAWS CLI v2Core hour
Learning objectives
  • 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

#TimeModuleCore contentLearning views
100–06 · 6 minRepository and review workflowVersion templates, parameter sets and policy tests with traceable change reviews.Concepts, commands, lab, production and troubleshooting
206–13 · 7 minLint, validate and packageRun static checks and package local artifacts before deployment.Concepts, commands, lab, production and troubleshooting
313–21 · 8 minOIDC and short-lived credentialsFederate CI identity to AWS STS instead of storing long-lived keys.Concepts, commands, lab, production and troubleshooting
421–29 · 8 minChange set approval gatesRequire review of the exact change set before production execution.Concepts, commands, lab, production and troubleshooting
529–37 · 8 minEnvironment promotionPromote the same reviewed template artifact across environments with explicit inputs.Concepts, commands, lab, production and troubleshooting
637–45 · 8 minStackSets and permission modelsSelect service-managed or self-managed permissions for account and Region rollout.Concepts, commands, lab, production and troubleshooting
745–52 · 7 minCanary waves and failure toleranceLimit rollout blast radius with staged targets and monitored failure tolerance.Concepts, commands, lab, production and troubleshooting
852–60 · 8 minAudit, alarms and rollback evidenceRetain artifacts and approvals, monitor alarms and verify workload health after deployment.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 sandbox

Labs may create resources. Follow each lab's cleanup steps and verify stack status when finished.

Repository and review workflow

Hour 7 · 1 / 8

Core concepts

Version templates, parameter sets and policy tests with traceable change reviews.

  • 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

Focus: Repository and review workflow
Template → Validate → Change set → Review → Execute → Repository and review workflow → Verify events

Keep reviewable inputs and results at each stage; a change set does not apply proposed changes until execution.

Deployment state sequence

  1. Identify the requirement: Repository and review workflow
  2. Validate the inputs and inspect the proposed resource action
  3. Execute in a sandbox and verify the resulting stack events

Commands and notes

cfn-lint template.yaml

Confirm 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: Version templates, parameter sets and policy tests with traceable change reviews.

  1. Run the command and save its output.
  2. Compare it with the expected result and record differences.
  3. 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: Version templates, parameter sets and policy tests with traceable change reviews.

Release gate Inspect replacements and deletions; confirm approval, backups and rollback ownership.

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: Version templates, parameter sets and policy tests with traceable change reviews.

aws cloudformation describe-stack-events --stack-name app-dev --region us-east-1

Narration script

Version templates, parameter sets and policy tests with traceable change reviews.

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.

AWS CloudFormation User Guide ↗

Lint, validate and package

Hour 7 · 2 / 8

Core concepts

Run static checks and package local artifacts before deployment.

  • 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

Focus: Lint, validate and package
Template → Validate → Change set → Review → Execute → Lint, validate and package → Verify events

Keep reviewable inputs and results at each stage; a change set does not apply proposed changes until execution.

Deployment state sequence

  1. Identify the requirement: Lint, validate and package
  2. Validate the inputs and inspect the proposed resource action
  3. Execute in a sandbox and verify the resulting stack events

Commands and notes

aws cloudformation package --template-file template.yaml --s3-bucket cfn-artifacts-example --output-template-file packaged.yaml

Confirm 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: Run static checks and package local artifacts before deployment.

  1. Run the command and save its output.
  2. Compare it with the expected result and record differences.
  3. 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: Run static checks and package local artifacts before deployment.

Release gate Inspect replacements and deletions; confirm approval, backups and rollback ownership.

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: Run static checks and package local artifacts before deployment.

aws cloudformation describe-stack-events --stack-name app-dev --region us-east-1

Narration script

Run static checks and package local artifacts before deployment.

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.

AWS CloudFormation User Guide ↗

OIDC and short-lived credentials

Hour 7 · 3 / 8

Core concepts

Federate CI identity to AWS STS instead of storing long-lived keys.

  • 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

Focus: OIDC and short-lived credentials
Template → Validate → Change set → Review → Execute → OIDC and short-lived credentials → Verify events

Keep reviewable inputs and results at each stage; a change set does not apply proposed changes until execution.

Deployment state sequence

  1. Identify the requirement: OIDC and short-lived credentials
  2. Validate the inputs and inspect the proposed resource action
  3. Execute in a sandbox and verify the resulting stack events

Commands and notes

aws sts get-caller-identity --profile ci-deploy

Confirm 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: Federate CI identity to AWS STS instead of storing long-lived keys.

  1. Run the command and save its output.
  2. Compare it with the expected result and record differences.
  3. 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: Federate CI identity to AWS STS instead of storing long-lived keys.

Release gate Inspect replacements and deletions; confirm approval, backups and rollback ownership.

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: Federate CI identity to AWS STS instead of storing long-lived keys.

aws cloudformation describe-stack-events --stack-name app-dev --region us-east-1

Narration script

Federate CI identity to AWS STS instead of storing long-lived keys.

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.

AWS CloudFormation User Guide ↗

Change set approval gates

Hour 7 · 4 / 8

Core concepts

Require review of the exact change set before production execution.

  • 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

Focus: Change set approval gates
Template → Validate → Change set → Review → Execute → Change set approval gates → Verify events

Keep reviewable inputs and results at each stage; a change set does not apply proposed changes until execution.

Deployment state sequence

  1. Identify the requirement: Change set approval gates
  2. Validate the inputs and inspect the proposed resource action
  3. Execute in a sandbox and verify the resulting stack events

Commands and notes

aws cloudformation create-change-set --stack-name app-prod --change-set-name release-42 --change-set-type UPDATE --template-body file://packaged.yaml

Confirm 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: Require review of the exact change set before production execution.

  1. Run the command and save its output.
  2. Compare it with the expected result and record differences.
  3. 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: Require review of the exact change set before production execution.

Release gate Inspect replacements and deletions; confirm approval, backups and rollback ownership.

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: Require review of the exact change set before production execution.

aws cloudformation describe-stack-events --stack-name app-dev --region us-east-1

Narration script

Require review of the exact change set before production execution.

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.

AWS CloudFormation User Guide ↗

Environment promotion

Hour 7 · 5 / 8

Core concepts

Promote the same reviewed template artifact across environments with explicit inputs.

  • 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

Focus: Environment promotion
Template → Validate → Change set → Review → Execute → Environment promotion → Verify events

Keep reviewable inputs and results at each stage; a change set does not apply proposed changes until execution.

Deployment state sequence

  1. Identify the requirement: Environment promotion
  2. Validate the inputs and inspect the proposed resource action
  3. Execute in a sandbox and verify the resulting stack events

Commands and notes

aws cloudformation execute-change-set --stack-name app-prod --change-set-name release-42

Confirm 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: Promote the same reviewed template artifact across environments with explicit inputs.

  1. Run the command and save its output.
  2. Compare it with the expected result and record differences.
  3. 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: Promote the same reviewed template artifact across environments with explicit inputs.

Release gate Inspect replacements and deletions; confirm approval, backups and rollback ownership.

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: Promote the same reviewed template artifact across environments with explicit inputs.

aws cloudformation describe-stack-events --stack-name app-dev --region us-east-1

Narration script

Promote the same reviewed template artifact across environments with explicit inputs.

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.

AWS CloudFormation User Guide ↗

StackSets and permission models

Hour 7 · 6 / 8

Core concepts

Select service-managed or self-managed permissions for account and Region rollout.

  • 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

Focus: StackSets and permission models
Template → Validate → Change set → Review → Execute → StackSets and permission models → Verify events

Keep reviewable inputs and results at each stage; a change set does not apply proposed changes until execution.

Deployment state sequence

  1. Identify the requirement: StackSets and permission models
  2. Validate the inputs and inspect the proposed resource action
  3. Execute in a sandbox and verify the resulting stack events

Commands and notes

aws cloudformation list-stack-sets --status ACTIVE

Confirm 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: Select service-managed or self-managed permissions for account and Region rollout.

  1. Run the command and save its output.
  2. Compare it with the expected result and record differences.
  3. 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: Select service-managed or self-managed permissions for account and Region rollout.

Release gate Inspect replacements and deletions; confirm approval, backups and rollback ownership.

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: Select service-managed or self-managed permissions for account and Region rollout.

aws cloudformation describe-stack-events --stack-name app-dev --region us-east-1

Narration script

Select service-managed or self-managed permissions for account and Region rollout.

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.

AWS CloudFormation User Guide ↗

Canary waves and failure tolerance

Hour 7 · 7 / 8

Core concepts

Limit rollout blast radius with staged targets and monitored failure tolerance.

  • 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

Focus: Canary waves and failure tolerance
Template → Validate → Change set → Review → Execute → Canary waves and failure tolerance → Verify events

Keep reviewable inputs and results at each stage; a change set does not apply proposed changes until execution.

Deployment state sequence

  1. Identify the requirement: Canary waves and failure tolerance
  2. Validate the inputs and inspect the proposed resource action
  3. Execute in a sandbox and verify the resulting stack events

Commands and notes

aws cloudformation list-stack-instances --stack-set-name baseline

Confirm 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: Limit rollout blast radius with staged targets and monitored failure tolerance.

  1. Run the command and save its output.
  2. Compare it with the expected result and record differences.
  3. 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: Limit rollout blast radius with staged targets and monitored failure tolerance.

Release gate Inspect replacements and deletions; confirm approval, backups and rollback ownership.

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: Limit rollout blast radius with staged targets and monitored failure tolerance.

aws cloudformation describe-stack-events --stack-name app-dev --region us-east-1

Narration script

Limit rollout blast radius with staged targets and monitored failure tolerance.

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.

AWS CloudFormation User Guide ↗

Audit, alarms and rollback evidence

Hour 7 · 8 / 8

Core concepts

Retain artifacts and approvals, monitor alarms and verify workload health after deployment.

  • 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

Focus: Audit, alarms and rollback evidence
Template → Validate → Change set → Review → Execute → Audit, alarms and rollback evidence → Verify events

Keep reviewable inputs and results at each stage; a change set does not apply proposed changes until execution.

Deployment state sequence

  1. Identify the requirement: Audit, alarms and rollback evidence
  2. Validate the inputs and inspect the proposed resource action
  3. Execute in a sandbox and verify the resulting stack events

Commands and notes

aws cloudformation describe-stack-set-operation --stack-set-name baseline --operation-id OPERATION_ID

Confirm 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: Retain artifacts and approvals, monitor alarms and verify workload health after deployment.

  1. Run the command and save its output.
  2. Compare it with the expected result and record differences.
  3. 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: Retain artifacts and approvals, monitor alarms and verify workload health after deployment.

Release gate Inspect replacements and deletions; confirm approval, backups and rollback ownership.

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: Retain artifacts and approvals, monitor alarms and verify workload health after deployment.

aws cloudformation describe-stack-events --stack-name app-dev --region us-east-1

Narration script

Retain artifacts and approvals, monitor alarms and verify workload health after deployment.

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.

AWS CloudFormation User Guide ↗

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-dev

Before 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 ↗

  1. Write a template with a low-risk resource and parameterize the environment name.
  2. Run template checks, create a change set and review resource actions.
  3. Execute the change set in a sandbox and inspect stack events and outputs.
  4. 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.