Skip to main content
Now that you’ve reached the end of the workshop, clean up all resources that were created to avoid unexpected charges and retained resources. Follow the steps in order so CloudFormation and the AWS CDK can successfully remove stacks. Overview of the main cleanup steps
  • Empty all S3 buckets that contain data (CloudFormation cannot delete non-empty buckets).
  • Delete any RDS/Aurora snapshots (manual snapshots can cause DB instances to be retained).
  • Run CDK/CloudFormation stack deletion.
  • Manually remove resources that were created outside CloudFormation (Auto Scaling groups, launch templates, EC2 instances, CloudWatch log groups, ECR repositories, IAM roles, etc.).
  • Remove the CDK bootstrap CloudFormation stack if present and no other stacks depend on it.
Cleanup checklist (quick reference) Empty S3 buckets Around seven S3 buckets were created during the exercises. You must empty each bucket before CloudFormation can delete them.
A screenshot of the AWS S3 console showing an "Empty bucket" confirmation page with warnings about permanently deleting objects. It includes a text field requiring you to type "permanently delete" and buttons to Cancel or Empty the bucket.
Steps:
  1. Open the S3 console and select a bucket used by the workshop.
  2. Choose the “Empty” action, type the confirmation text (for example, “permanently delete”) and proceed.
  3. Repeat for each bucket.
  4. Alternatively, use the AWS CLI: aws s3 rm s3://<bucket-name> --recursive to remove all objects, then delete the bucket.
Delete RDS / Aurora snapshots If an Aurora cluster or RDS instance was created, check for both automated and manual snapshots. CloudFormation will often retain DB instances when manual snapshots exist. Steps:
  • Open the RDS console and view Snapshots for the instance/cluster.
  • Delete any manual snapshots you no longer need.
  • Confirm no DB instances remain in the console after snapshots are removed.
Destroy CDK stacks From the environment where you ran the CDK deployments, run CDK destroy to remove CDK-created stacks. You may be prompted to confirm deletions for each stack. Example (run from the CDK project directory):
You may see an interactive prompt and delete progress messages like:
While CDK is deleting stacks, you should remove any resources that CDK/CloudFormation cannot or will not remove (for example, resources created in a different region or created manually). The sections below cover common manual cleanup items. Warning: manual deletions are irreversible and may terminate running instances. Double-check resource identities and regions before proceeding. Auto Scaling group and launch templates If you created an Auto Scaling group manually for the introductory exercise, delete the group in the EC2 Auto Scaling console. Deleting the Auto Scaling group will terminate instances managed by that group.
A screenshot of the AWS EC2 Auto Scaling Groups console. It shows one auto scaling group named "FisStackAsg" using the "ASGLaunchTemplate" launch template and a "Create Auto Scaling group" button.
When deleting an Auto Scaling group that contains running instances you will be asked to confirm:
A screenshot of the AWS EC2 console showing a "Delete Auto Scaling group" confirmation dialog that warns the group contains running instances and will terminate them. The dialog asks you to type "delete" to confirm and shows Cancel and Delete buttons.
After removing the Auto Scaling group:
  • Delete any associated launch templates. Note: deleting a launch template does not terminate EC2 instances already created from it — ensure those instances are terminated or were already terminated when you removed the ASG.
  • If you used a different region for manual testing, switch the console region to ensure you delete resources in the correct region.
Region example (resources panel):
A screenshot of the AWS EC2 console (Asia Pacific — Tokyo) showing the Resources panel with counts for instances, volumes, security groups, Auto Scaling Groups, and related items. The left navigation menu and an Account attributes box (showing a Default VPC) are also visible.
CloudWatch log groups Delete any CloudWatch Log Groups you created manually (for example, log groups used by the earlier exercise). Log groups can persist indefinitely and may incur charges. Options:
  • Delete via the CloudWatch Logs console.
  • Use the AWS CLI: aws logs delete-log-group --log-group-name /aws/your-log-group.
CDK stack deletion (expanded) Some projects include multiple CDK/CloudFormation stacks (for example: LoadTesting, Observability, FisServerless, Applications, Services). Running cdk destroy --all will prompt for confirmation to delete multiple stacks and then proceed to remove each stack. Example partial output during deletion:
Once CDK/CloudFormation deletions complete, you should see confirmation that stacks were destroyed. If a stack fails to delete, inspect CloudFormation events to identify retained resources (often S3 buckets or snapshots), remove or empty them, and retry. Remaining manual cleanup items
  • ECR: Delete any ECR repositories created by your stacks or local builds.
  • Bootstrap stack: If you used a CDK bootstrap stack for deployment, delete the CloudFormation bootstrap stack after confirming no other stacks depend on it.
  • EC2 instances: Confirm any launcher or test EC2 instances are terminated.
  • IAM roles: Delete manually created IAM roles (for example, an admin role). Deleting IAM roles in the console requires confirmation where you type the role name.
A screenshot of the AWS Identity and Access Management (IAM) console showing a confirmation dialog to delete the role "fisworkshop-admin." The modal shows the role's last activity (17 minutes ago) and prompts the user to type the role name to confirm deletion.
Final verification
  • Revisit CloudFormation and ensure there are no remaining stacks from the workshop.
  • Verify the S3 buckets are empty or deleted.
  • Confirm RDS snapshots are removed and no DB instances remain.
  • Check ECR for leftover repositories and delete them.
  • Make sure there are no lingering EC2 instances, Auto Scaling groups, launch templates, CloudWatch log groups, or IAM roles.
Before attempting to delete a CloudFormation stack, ensure dependent resources (non-empty S3 buckets, manual snapshots, or manually created resources in other regions) are removed. Otherwise CloudFormation may fail to delete the stack.
If you follow these steps in order — emptying S3, removing RDS snapshots, running CDK destroy, and cleaning up manual resources — you should be able to fully clean up the environment created by this guide. Complete every step to avoid unexpected retained resources and charges. Links and references

Watch Video