This question already exists here but I think it will have more impact on SO.
I created an AWS Lambda@Edge function in order to rewrite Cloudfront URLs before they reach the Origin.
AWS Lambda@Edge Function are automatically replicated through all regions when published, so I was not surprised to see this in every region:
Here began the problems:
I deleted the Lambda@Edge because it was a test and I wanted to start a fresh new one, but the replicas weren't deleted at the same time.
It was no big deal at the time, I thought that I simply could create a new Lambda@Edge function.
But you can't because the Cloudfront trigger can only be used one function at a time (as the replicas use it, you cannot create a new one).
Moreover, the trigger cannot be deleted either.
So now I'm stuck with Lambda@Edge replicas everywhere that I cannot delete and I cannot create similar ones.
TL;DR
I'd be grateful to get some help on this
François
EDIT:
I definitely think it's a bug because in my replica's page, the link to the Master ARN responds with a 404.
Choose the Behaviors tab. Choose the check box next to the cache behavior that has the Lambda@Edge function association that you want to delete, and then choose Edit. Scroll down to Lambda Function Associations, and then choose the X icon next to each Lambda@Edge function association that you want to delete.
The major difference is in the API Gateway and the Lambda are regional service. Lambda@Edge is a global service. Lambda@Edge allows you to execute the logic across multiple location. This is the main difference between Lambda and Lambda@Edge, remaining all the things are mostly similar.
In the right pane of the CloudFront console, select the check box for the distribution that you want to delete. Choose Disable to disable the distribution, and choose Yes, Disable to confirm. Then choose Close.
I found part of an answer:
It turns out that I needed to delete the trigger in the behavior of Cloudfront.
Simply:
Edit
Still, I can't delete the replicas but at least I can create new lambdas for this trigger...
There is now a documentation here stating that replicas are deleted after a "few hours" - which would imply that I then can also delete the Lambda function.
Update 2020-01-05: If you delete the Lambdas it takes ~1 h and everything is gone! So it is just slower but behave similar to normal Lambdas?
I asked this problem to AWS support and its answer was like: "you cannot delete replicated lambda functions for now, but we understand many people requires this".
AWS Lambda@Edge http://docs.aws.amazon.com/es_es/lambda/latest/dg/lambda-edge.html
When you create a trigger, Lambda replicates the function to AWS Regions and CloudFront edge locations around the globe. Note that replicas can't be edited or deleted.
Hi francois, yves, reki I have figured out the solution to delete Lambda@edge replica.
Note!> Please remember to delete any IAM Roles and Permissions associated with Lambda@edge Functions.
I hope this will works for you, Enjoy :)
Even I tried * To delete trigger then create lambda (in my case lambda reaches nearly 30)*,but i couldnt create new lambda@edge. Finally i did this
Removed the cloud-front distribution which is associated with lambda function, now its simple to move further. Please assure that distribution only used by that related lambda.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With