Skip to content

Feature request: add --express flag to sam delete #9115

Description

@KyleDoherty1

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions