Reputation: 1265
Couldn't delete lambda stack via aws cdk:
Lambda was unable to delete lambda because it is a replicated function.
Upvotes: 1
Views: 1394
Reputation: 459
When deleting a CloudFormation Stack with CloudFront resource and associated Lambda@edge - CloudFormation first initiate a delete request for the CloudFront resource and the links to lambda@edge, since the lambda@edge is replicated to edges locations it takes up to a few hours to complete the links deletion.
My workaround is to run the complete clean-up in two phases -
Delete the stack and ignore the DELETE_FAILED
status if just the lambda was failed to be deleted (and the other resources were deleted successfully)
Re-delete the DELETE_FAILED
stack after a few hours (Or do it automatically using a cleanup lambda triggered by cron event to clean-up the CloudFormation stacks with DELETE_FAILED
status)
Upvotes: 1
Reputation: 11740
If you are able to get in such a situation then yo most likely have freshly deleted a stack that did have lambda edge functions. In that case replicated functions get revealed (you dont see them while the edge function is inplace/being used). You dont need to do anything, just maybe to be patient - the replicated function will disappear after some time.
Upvotes: 0