How to remove SDPM resources from your AWS account.
SDPM deploys multiple CloudFormation stacks. Because of their dependencies, manual deletion through the CloudFormation console is tedious. We recommend using go-to-k/delstack for a one-shot, dependency-aware deletion.
Stack list (deleted in reverse dependency order):
SdpmWebUi(Layer 4)SdpmAgent(Layer 4)SdpmRuntimeSdpmDataSdpmAuth(if using the default Cognito setup)SdpmCloudFrontWaf(only when WAF is enabled, us-east-1 only)
go-to-k/delstack deletes CloudFormation stacks in the correct dependency order while force-cleaning up stubborn resources (versioned S3 buckets, ECR repositories, etc.).
macOS / Linux:
brew install go-to-k/tap/delstackWith Go:
go install github.com/go-to-k/delstack@latestOther installation methods are documented in delstack's README.
Run the following in your deployment region (e.g. us-east-1).
# Delete Layer 4 full stack
delstack --region us-east-1 \
-s SdpmWebUi \
-s SdpmAgent \
-s SdpmRuntime \
-s SdpmData \
-s SdpmAuth
# Add this if WAF was enabled (always us-east-1)
delstack --region us-east-1 -s SdpmCloudFrontWafFor a Layer 3 deployment, omit SdpmWebUi and SdpmAgent.
- Automatic dependency resolution: deletes stacks in the correct order.
- Force-delete S3 buckets: empties versioned buckets before deletion.
- Force-delete ECR repositories: handles repos that would otherwise fail with
DELETE_FAILED. - Interactive confirmation: shows the list of resources and asks for
yesbefore deleting.
AWS CloudShell ships with Go pre-installed, so you can install and run delstack there:
# Install in CloudShell
go install github.com/go-to-k/delstack@latest
# Put it on PATH
export PATH=$PATH:$(go env GOPATH)/bin
# Delete
delstack --region us-east-1 -s SdpmWebUi -s SdpmAgent -s SdpmRuntime -s SdpmData -s SdpmAuthIf you have a local CDK environment, you can also use:
cd infra
npx cdk destroy --allThis often fails when S3 buckets or ECR repositories contain leftover resources, so delstack is still recommended.
If you prefer the GUI, delete the stacks in reverse order:
SdpmWebUiSdpmAgentSdpmRuntimeSdpmDataSdpmAuthSdpmCloudFrontWaf(check the us-east-1 region)
If a stack fails with DELETE_FAILED because of leftover S3 buckets or ECR repositories, empty those resources manually and retry.
Confirm the following resources are gone:
- CloudFormation: the stacks listed above
- S3: buckets with
sdpm-*orcdk-*prefix - DynamoDB:
sdpm-*tables - ECR:
sdpm-*repositories - SSM Parameter Store:
/sdpm/* - CloudWatch Logs:
/aws/lambda/sdpm-*,/aws/bedrock/*
- Data is not recoverable. Export your decks and slides from S3 first if you want to keep them.
- The CDK bootstrap stack (
CDKToolkit) is intentionally excluded because it may be shared with other CDK projects. Delete it manually only if you want a full cleanup. - Bedrock Model Invocation Logging (enabled via
--enable-invocation-logging) is an account/region-level setting and is cleaned up whenSdpmDatais deleted.