Deploy a Web Application on Amazon EC2


Module 4: Clean Up Your Resources

In this module, we will clean up the resources that you deployed in previous modules


In this last part of the guide, you will learn how to remove all the different AWS resources you created early on. If your account is still on the free tier, this would not cost you anything, unless you have other free tier resources running already.

What You Will Learn

  • How to remove AWS resources created with a CDK application

 Time to Complete

< 2 minutes

 Module Prereqs

  • AWS Account with administrator-level access**
  • Recommended browser: The latest version of Chrome or Firefox

[**]Accounts created within the past 24 hours might not yet have access to the services required for this tutorial.


Cleaning up your AWS environment

You have now completed this guide, but you still need to clean up the resources created during this guide. If your account is still in the free tier, there will not be any monthly charges. Once out of the free tier, it will cost ~$9.45 USD per month, or $0.0126 USD / hour. 

To remove all the infrastructure you created, use the cdk destroy command - this will only remove infrastructure created during this guide. You will see a confirmation:

cdk destroy

Enter y to approve the changes and delete any stack resources.

Ec2CdkStack: destroying...

✅  Ec2CdkStack: destroyed

When the output shows Ec2CdkStack: destroyed, your resources have been removed.


Congratulations! You have finished the Build a Web Application on Amazon EC2 getting started guide. Continue your journey with AWS by following the next steps section below.

Was this page helpful?