π AWS CDK DESTROY AND PACKAGE CLEANUP
In this video we learn how to remove AWS infrastructure using cdk destroy and create reusable cleanup commands for the monorepo.
We destroy the CloudFormation stack created earlier, automatically remove the associated S3 bucket, and create package cleanup scripts to remove temporary build folders such as node_modules and cdk.out.
—
π― IN THIS VIDEO
– Destroying AWS CDK stacks
– Running cdk destroy
– Using –force
– Removing CloudFormation stacks
– Automatically deleting S3 buckets
– Understanding educational vs production systems
– Creating reusable destroy commands
– Running deployment scripts from pnpm
– Creating recursive cleanup scripts
– Removing node_modules
– Removing cdk.out
– Using pnpm -r
– Cleaning monorepo projects
– Returning projects to source-only state
—
π¦ TECHNOLOGIES COVERED
– AWS CDK
– AWS CloudFormation
– Amazon S3
– pnpm
– pnpm workspaces
– Bash scripts
– package.json
—
π» WHY THIS MATTERS
One of the major advantages of infrastructure-as-code is that complete environments can be created and destroyed automatically.
For learning environments this is especially useful because it allows you to:
– stop AWS costs instantly
– rebuild systems repeatedly
– experiment safely
– keep projects clean and reproducible
—
π COURSE PORTAL
https://richardbraycourses.co.uk
—
π COURSE REPOSITORY
https://github.com/RichardBrayCourses/aws02-deploy-website-to-aws-cloudfront
—
π AWS SERVERLESS WEB DEVELOPMENT COURSE
Build complete real-world AWS applications using:
React β TypeScript β Lambda β CDK β S3 β Aurora β Cognito β AI β DevOps