3

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

Andrei Lesnitsky
  • 1,038
  • 7
  • 14

2 Answers2

3

We were in the same boat... couldn't delete the functions for days.

How we fixed it:

  1. Create a new distribution
  2. Associate the lambda with the new distribution
  3. Remove the association you just made
  4. Delete the lambda versions
  5. Delete the lambda

There might be some time in between these steps, but that finally got us unstuck!

aiguofer
  • 1,887
  • 20
  • 34
  • This is the only solution that worked for me. I had two functions that were stuck. One of them I was able to eventually delete after a day but the other one I couldn't. Adding it to another Cloudfront Distribution, waiting for it to deploy, then deleting it from the Cloudfront Distribution then waiting again to delete the function worked for me. – Andrew Curioso Mar 21 '23 at 14:43
0

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.