'Can't delete Lambda@Edge even though previously associated CloudFront distribution was already destroyed
Even though CloudFront distribution which was assiciated with a number of Lambda functions deployed @edge was already destroyed a couple of days ago, I still can't delete my lambda: it keeps referencing me to the "documentation for Deleting Lambda@Edge Functions and Replicas." which says only one thing: you should wait for a couple of hours (not days)
Any suggestions what else could be preventing the lambda from being deleted?
P.S. I also double-checked that ALL versions of lambda do not have an association with any cloudfront distributions
Solution 1:[1]
We were in the same boat... couldn't delete the functions for days.
How we fixed it:
- Create a new distribution
- Associate the lambda with the new distribution
- Remove the association you just made
- Delete the lambda versions
- Delete the lambda
There might be some time in between these steps, but that finally got us unstuck!
Solution 2:[2]
Somebody already gave a very good reply about this subject: https://stackoverflow.com/a/61454243/12451088
Although, long story short, if the CloudFront distribution is deleted, check that there are no IAM roles associated to this Lambda function. In my case, I needed to delete it as there was one role associated. Removing this role let me delete all the versions of the Lambda function.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | aiguofer |
| Solution 2 | Lluis Marquez |
