-
Notifications
You must be signed in to change notification settings - Fork 2
Description
Is your feature request related to a problem? Please describe.
When I try to delete a CloudFormation stack that includes a CloudFront distribution with attached Lambda@Edge functions, the deletion fails. Currently, even when using the force option, the stack cannot be deleted completely until the Lambda@edge functions are deployed globally.
Describe the solution you'd like
I would like delstack to automatically delete or clean up the Lambda@Edge functions associated with the stack when the deletion is executed (especially when the force flag is used). This would ensure a smoother, automated teardown without manual intervention in the AWS Console.
Additional context
See this library for example code: https://github.com/thunder-so/thunder/blob/master/lib/static/hosting.ts
Attempting to delete the stack produces errors such as this:
Status: DELETE_FAILED
Status reason: Resource handler returned message: "Lambda was unable to delete arn:aws:lambda:us-east-1:000000000:function:example-HostingRedirectRewriteFu-AR2g4Rn6czJO:1 because it is a replicated function.
Please see our documentation for Deleting Lambda@Edge Functions and Replicas. (Service: Lambda, Status Code: 400, Request ID: 000000-77b1-463a-8d88-393c3f84883c) (SDK Attempt Count: 1)" (RequestToken: 0000000-4f59-2e75-2377-91791957b76b, HandlerErrorCode: InvalidRequest)