Solution :
I had faced this issue in the recent past. I did lot of research on it.
I found the following solution to solve your issue.
If the error message is saying that "This Lambda function is not authorized to perform: CreateNetworkInterface" then it is more practical that Lambda role needs to be modified with appropriate policy. So fixed the problem by adding the lambda with the policy actions as follows:
NetworkLambdaRole:
Type: "AWS::IAM::Role"
Properties:
RoleName: "Network-Lambda-Role"
AssumeRolePolicyDocument:
Version: '2012-10-17'
Statement:
-
Effect: "Allow"
Principal:
Service:
- "lambda.amazonaws.com"
Action:
- "sts:AssumeRole"
Policies:
- PolicyName: "network-lambda-role-policy"
PolicyDocument:
Version: '2012-10-17'
Statement:
- Effect: "Allow"
Action: [
"ec2:DescribeInstances",
"ec2:CreateNetworkInterface",
"ec2:AttachNetworkInterface",
"ec2:DescribeNetworkInterfaces",
"ec2:DeleteNetworkInterface"
]
Resource: "*"