AWS Lambda: unable to delete arn because it is a replicated function

拟墨画扇 提交于 2020-12-31 06:18:50

问题


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.

  1. Firstly, Login to CloudFront Console and go to your Distribution.
  2. Under the Behaviors Tab - tick the listed Behavior and edit
  3. Scroll down to Lambda Function Associations and remove any Association by clicking the X.
  4. Press yes,edit to save the changes. --- Now that you have removed the Associations it's time to delete the Lambda@edge replicas
  5. Go to Lambda Console and open your lambda( you wish to delete).
  6. On the top menus - Qualifiers -> Versions-> choose the listed drop-down version
  7. It will open that @edgeLambda Version
  8. On the top menus - Actions -> Delete version
  9. This way , deleting all the versions - you are left with $LATEST
  10. 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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!