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

前端 未结 6 1517
难免孤独
难免孤独 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:44

    This is actually such a common issue.

    You can resolve this by adding a custom Inline Policy to the Lambda execution role under the Permissions tab.

    Just add this:

      "Version": "2012-10-17",
      "Statement": [
        {
          "Effect": "Allow",
          "Action": [
            "ec2:DescribeNetworkInterfaces",
            "ec2:CreateNetworkInterface",
            "ec2:DeleteNetworkInterface",
            "ec2:DescribeInstances",
            "ec2:AttachNetworkInterface"
          ],
          "Resource": "*"
        }
      ]
    }
    

    There's a full tutorial with pictures here if you need more information or are confused: https://ao.gl/the-provided-execution-role-does-not-have-permissions-to-call-createnetworkinterface-on-ec2/

提交回复
热议问题