Cannot add VPC to my lambda function

0

Hi,

I've run into a problem where I can't add a VPC to my Lambda function. I followed the steps outlined in this Stack Overflow post (https://stackoverflow.com/questions/41177965/the-provided-execution-role-does-not-have-permissions-to-call-describenetworkint), but I'm still getting the error message "The provided execution role does not have permissions to call CreateNetworkInterface on EC2". Do you have any suggestions on how to resolve this issue?

PS: I've attached three permission to my IAM user: AmazonEC2ContainerRegistryFullAccess, AWSLambda_FullAccess, AWSLambdaVPCAccessExecutionRole.

Thanks!

Jimmy
已提问 9 个月前338 查看次数
1 回答
2
已接受的回答

Hello.

Please set the following IAM policy for the IAM role used by Lambda, not for the IAM user.
https://docs.aws.amazon.com/lambda/latest/dg/lambda-intro-execution-role.html#permissions-executionrole-features

AWSLambdaVPCAccessExecutionRole

AWSLambdaVPCAccessExecutionRole grants permissions to manage ENIs within an Amazon VPC and write to CloudWatch Logs.

You can check the IAM role used by Lambda from the Lambda screen.
lambda

profile picture
专家
已回答 9 个月前
profile picture
专家
已审核 1 个月前
profile pictureAWS
专家
已审核 9 个月前
profile pictureAWS
专家
已审核 9 个月前
  • Great, thank you so much

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则