(app-staging-synthesizer): clean up staging resources on deletion #25722
Labels
@aws-cdk/app-staging-synthesizer-alpha
Related to the @aws-cdk/app-staging-synthesizer-alpha package
effort/medium
Medium work item – several days of effort
feature-request
A feature should be added or improved.
p2
Describe the feature
When using the
AppStagingSynthesizer
, staging resources that live alongside your cdk app do not get deleted when the app gets deleted. This is because these resources are not empty, and CloudFormation cannot delete un-empty S3 buckets and ECR repos.We solve this problem in the CDK with custom resources, but these custom resources are assets themselves that need to live in a staging bucket. This creates a chicken-and-egg problem for the
AppStagingSynthesizer
, because there's nowhere to put the cleanup custom resource asset.Use Case
Users using
cdk deploy
andcdk destroy
on theAppStagingSynthesizer
as part of development. We don't destroy the staging resources, so the user has to manage their deletion themselves. Otherwise, if youcdk deploy
a resource with the same name,cdk deploy
will fail.Proposed Solution
Potentially, we can minimize these custom resources and provide them as inline code directly in the template. If we can do that, we can clean up staging resources on deletion and remove a big friction point for users.
Other Information
No response
Acknowledgements
CDK version used
CDK v1.83.0
Environment details (OS name and version, etc.)
mac
The text was updated successfully, but these errors were encountered: