-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(aws-synthetics): add cleanup lambda #18448
Comments
I like the idea! Seems doable with a custom resource like s3. |
For this, s3 has an option like The end result behavior would be like S3 Auto Delete where it'll apply a tag, and on deletion of said tagged resource the CR will invoked to cleanup the underlying runtime Lambda. Do/should we cleanup CloudWatch stuff? I don't think anything else does. |
Looks like canaries can now be set with a |
Yup, that's correct! Thank goodness too. It's been a sec, but I can submit a PR to add that property. |
) Synthetics [used](https://aws.amazon.com/about-aws/whats-new/2022/05/amazon-cloudwatch-synthetics-support-canary-resources-deletion/) to have a property `deleteLambdaResourceOnCanaryDeletion` that has since been deprecated and erased from cloudformation docs. Although this property still works today synthetics makes no promises that this is supported in the future. Here in CDK land, this PR serves as a replacement to the `deleteLambdaResourceOnCanaryDeletion` property (called `enableAutoDeleteLambdas` on the L2 Canary) by implementing a custom resource similar to what we have in S3 and ECR. **This PR deprecates `enableAutoDeleteLambdas` in favor of `cleanup: cleanup.LAMBDA`, an enum that achieves the same thing but via custom resource** Closes #18448 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
Description
Currently, when you delete a synthetic it leaves behind a massive set of detrius. This includes CW resources, buckets, lambdas, and other resources. This is a limitation of the Synthetics API where it will not explicitly delete resources left behind.
Use Case
To fully cleanup resources upon stack deletion.
Proposed Solution
Similar to S3, provision an additional lambda that fires upon Canary deletion and removes all the associated Canary resources.
Other information
No response
Acknowledge
The text was updated successfully, but these errors were encountered: