sam delete - Amazon Serverless Application Model
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

sam delete

This page provides reference information for the Amazon Serverless Application Model Command Line Interface (Amazon SAM CLI) sam delete command.

For an introduction to the Amazon SAM CLI, see What is the Amazon SAM CLI?.

The sam delete command deletes an Amazon SAM application by deleting the Amazon CloudFormation stack, the artifacts that were packaged and deployed to Amazon S3 and Amazon ECR, and the Amazon SAM template file.

This command also checks whether there is an Amazon ECR companion stack deployed, and if so prompts the user about deleting that stack and Amazon ECR repositories. If --no-prompts is specified, then companion stacks and Amazon ECR repositories are deleted by default.

Usage

$ sam delete <options>

Options

--config-env TEXT

The environment name specifying the default parameter values in the configuration file to use. The default value is default. For more information about configuration files, see Amazon SAM CLI configuration file.

--config-file PATH

The path and file name of the configuration file containing default parameter values to use. The default value is samconfig.toml in the root of the project directory. For more information about configuration files, see Amazon SAM CLI configuration file.

--debug

Turns on debug logging to print the debug message that the Amazon SAM CLI generates and to display timestamps.

--help

Shows this message and exits.

--no-prompts

Specify this option to have Amazon SAM operate in non-interactive mode. The stack name must be provided, either with the --stack-name option, or in the configuration toml file.

--profile TEXT

The specific profile from your credential file that gets Amazon credentials.

--region TEXT

The Amazon Region to deploy to. For example, us-east-1.

--s3-bucket

The path of the Amazon S3 bucket you want to delete.

--s3-prefix

The prefix of the Amazon S3 bucket you want to delete.

--save-params

Save the parameters that you provide at the command line to the Amazon SAM configuration file.

--stack-name TEXT

The name of the Amazon CloudFormation stack that you want to delete.