- 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.
Empty S3 buckets
Around seven S3 buckets were created during the exercises. You must empty each bucket before CloudFormation can delete them.

- Open the S3 console and select a bucket used by the workshop.
- Choose the “Empty” action, type the confirmation text (for example, “permanently delete”) and proceed.
- Repeat for each bucket.
- Alternatively, use the AWS CLI:
aws s3 rm s3://<bucket-name> --recursiveto remove all objects, then delete the bucket.
- 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.


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

- Delete via the CloudWatch Logs console.
- Use the AWS CLI:
aws logs delete-log-group --log-group-name /aws/your-log-group.
cdk destroy --all will prompt for confirmation to delete multiple stacks and then proceed to remove each stack.
Example partial output during deletion:
- 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.

- 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.
- AWS CloudFormation documentation
- AWS CDK documentation
- Amazon S3 documentation
- Amazon RDS documentation