Serverless – The provided execution role does not have permissions to call CreateNetworkInterface on EC2

Issue – while deploying Serverless Lambda
(sls deploy command ) function I got below error message

An error occurred: EsLambdaFunction – The provided execution role does not have permissions to call CreateNetworkInterface on EC2 (Service: AWSLambdaInternal; Status Code: 400; Error Code: InvalidParameterValueException; Request ID: xxx).

Resolution – In order to resolve the issue; I have updated IAM Role to add below policy actions; which was executing this serverless lambda function and added

           "ec2:DescribeInstances",
           "ec2:CreateNetworkInterface",
           "ec2:AttachNetworkInterface",
           "ec2:DescribeNetworkInterfaces",
           "ec2:DeleteNetworkInterface"

After adding above mentioned policy action; I am successfully able to deploy lambda function.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s