This is the AWS CDK v2 Developer Guide. The older CDK v1 entered maintenance on June 1, 2022 and ended support on June 1, 2023.
cdk destroy
Delete one or more AWS CDK stacks from your AWS environment.
When you delete a stack, resources in the stack will be destroyed, unless they were configured with a
DeletionPolicy
of Retain
.
During stack deletion, this command will output progress information similar to cdk deploy
behavior.
Usage
$
cdk destroy
<arguments>
<options>
Arguments
- CDK stack logical ID
-
The logical ID of the CDK stack from your app to delete.
Type: String
Required: No
Options
For a list of global options that work with all CDK CLI commands, see Global options.
--all
BOOLEAN
-
Destroy all available stacks.
Default value:
false
--exclusively, -e
BOOLEAN
-
Only destroy requested stacks and don’t include dependencies.
--force, -f
BOOLEAN
-
Do not ask for confirmation before destroying the stacks.
--help, -h
BOOLEAN
-
Show command reference information for the
cdk destroy
command.
Examples
Delete a stack named MyStackName
$
cdk destroy --app='node bin/main.js' MyStackName