Description
PR #9106 adds --express/--no-express support to sam deploy and sam sync for CloudFormation Express mode, but sam delete does not expose the same flag.
As noted in PR #9106 comment:
Usage: sam delete [OPTIONS]
Try 'sam delete -h' for help.
Error: No such option: --express
For teams using express mode during development, delete is part of the same iteration loop as deploy/sync. Without express support on sam delete, teardown remains on the slower standard path even when stacks were created or updated with --express.
Use Case
During fast development iteration, developers want to tear down stacks quickly without waiting for full resource stabilization and cleanup. CloudFormation Express mode supports this for delete operations:
aws cloudformation delete-stack --stack-name my-stack \
--deployment-config '{"Mode": "EXPRESS"}'
See the CloudFormation Express mode documentation and the delete-stack API reference.
Proposed Behavior
Add --express/--no-express to sam delete, consistent with sam deploy and sam sync:
- When enabled, pass
DeploymentConfig={"Mode": "EXPRESS"} to the CloudFormation DeleteStack API
- Default: off (for backwards compatibility)
- Persist to
samconfig.toml via --save-params as express = true/false
- After delete completes in express mode, surface a message that some resources may still be removing in the background (similar to deploy/sync)
Current Workaround
Use the AWS CLI directly:
aws cloudformation delete-stack --stack-name <stack-name> \
--deployment-config '{"Mode": "EXPRESS"}'
Note: this bypasses sam delete's guided cleanup of S3 artifacts, ECR images, and companion stacks.
Related
Description
PR #9106 adds
--express/--no-expresssupport tosam deployandsam syncfor CloudFormation Express mode, butsam deletedoes not expose the same flag.As noted in PR #9106 comment:
For teams using express mode during development, delete is part of the same iteration loop as deploy/sync. Without express support on
sam delete, teardown remains on the slower standard path even when stacks were created or updated with--express.Use Case
During fast development iteration, developers want to tear down stacks quickly without waiting for full resource stabilization and cleanup. CloudFormation Express mode supports this for delete operations:
aws cloudformation delete-stack --stack-name my-stack \ --deployment-config '{"Mode": "EXPRESS"}'See the CloudFormation Express mode documentation and the delete-stack API reference.
Proposed Behavior
Add
--express/--no-expresstosam delete, consistent withsam deployandsam sync:DeploymentConfig={"Mode": "EXPRESS"}to the CloudFormationDeleteStackAPIsamconfig.tomlvia--save-paramsasexpress = true/falseCurrent Workaround
Use the AWS CLI directly:
Note: this bypasses
sam delete's guided cleanup of S3 artifacts, ECR images, and companion stacks.Related
--expresstosam deployandsam sync)