问题
I'm trying to delete an AWS Lambda function through the GUI, but am getting a response: There was an error deleting your function: Lambda was unable to delete arn:aws:lambda:us-east-1:624929674184:function:lambda-auth:1 because it is a replicated function.
How can one delete replicated Lambda functions?
回答1:
Replicated functions are something Lambda@Edge
uses, so I assume that's the case here even though it's not stated. You should review this document on how to delete these. You can't manually delete them at this time:
You can delete a Lambda@Edge function only when the replicas of the function have been deleted by CloudFront. Replicas of a Lambda function are automatically deleted in the following situations:
After you have removed the last association for the function from all of your CloudFront distributions. If more than one distribution uses a function, the replicas are removed only after the function is disassociated from the last one.
After you delete the last distribution that a function was associated with.
Replicas are typically deleted within a few hours.
Note:
Replicas cannot be manually deleted at this time. This helps prevent a situation where a replica is removed that you're still using, which would result in an error.
回答2:
I have figured out the solution to delete Lambda@edge replica.
- Firstly, Login to CloudFront Console and go to your Distribution.
- Under the Behaviors Tab - tick the listed Behavior and edit
- Scroll down to Lambda Function Associations and remove any Association by clicking the X.
- Press yes,edit to save the changes. --- Now that you have removed the Associations it's time to delete the Lambda@edge replicas
- Go to Lambda Console and open your lambda( you wish to delete).
- On the top menus - Qualifiers -> Versions-> choose the listed drop-down version
- It will open that @edgeLambda Version
- On the top menus - Actions -> Delete version
- This way , deleting all the versions - you are left with $LATEST
- Deleting that also - you are finally able to delete the Lambda@edge Function
Note!> Please remember to delete any IAM Roles and Permissions associated with Lambda@edge Functions.
I hope this will work :)
Please refer the link Delete Lambda@Edge Functions and Replicas, you will find it much useful.
来源:https://stackoverflow.com/questions/50748523/aws-lambda-unable-to-delete-arn-because-it-is-a-replicated-function