AWS Lambda:The provided execution role does not have permissions to call DescribeNetworkInterfaces on EC2

前端 未结 6 1526
难免孤独
难免孤独 2021-02-06 21:17

Today I have a new AWS Lambda question, and can\'t find anywhere in Google.

I new a Lambda function, there is no question. But when I input any code in this function[eg.

6条回答
  •  爱一瞬间的悲伤
    2021-02-06 21:59

    If you are using terraform, just add:

    resource "aws_iam_role_policy_attachment" "AWSLambdaVPCAccessExecutionRole" {
        role       = aws_iam_role.lambda.name
        policy_arn = "arn:aws:iam::aws:policy/service-role/AWSLambdaVPCAccessExecutionRole"
    }
    

提交回复
热议问题