Skip to content

Delete Your Application

Note: Make sure to save or backup any data that you want to retain prior to deleting the full application stack or the DynamoDB Database.

Delete your application

When you are finished with your application, you can delete your SAM application using one of the methods below.

  1. From AWS CloudFormation console After signing into the console, you can delete your application. Note that there can be a companion stack, which will need to be deleted as well.
  2. You can also delete application components using the AWS CLI. From the terminal, run aws cloudformation delete-stack --stack-name <stack-name> --region <region-name> to delete the application. This may be less reliable if there is a companion stack created automatically.

Note: Find the name for your stack and region by opening the /samconfig.toml file located in the root of your application directory.

Delete your DynamoDB database

Note: If the DynamoDB DeletionPolicy is set to Retain in the /template.yaml used to create the application, then this command should not delete the DynamoDB table. However, one should make sure to backup any required data from the database prior to running this command. This can be done from the "Backups" tab on DynamoDB page in the AWS Management Console.

To delete a DynamoDB table, run aws dynamodb delete-table --table-name <table-name>. Table name can be found in /template.yaml and the default table name is bace-db.

You can also do this through the DynamoDB console.

Delete the associated ECR repository

Your application may be deployed with an automatically created ECR repository.

This can be deleted in the Amazon ECR console.