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!

1 Risposta
2
Risposta accettata

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
ESPERTO
con risposta 9 mesi fa
profile picture
ESPERTO
verificato un mese fa
profile pictureAWS
ESPERTO
verificato 9 mesi fa
profile pictureAWS
ESPERTO
verificato 9 mesi fa
  • Great, thank you so much

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande