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

AWS error fixes · Updated 17 November 2026

**Short answer:** You attached a Lambda function to a VPC, and Lambda checks that the function's execution role can create and manage the network interfaces it needs in your subnets. The role lacks ec2:CreateNetworkInterface (and its companions). Attach the AWS managed policy AWSLambdaVPCAccessExecutionRole to the execution role, wait a few seconds for IAM to propagate, and save the VPC configuration again.

## When it appears

```
An error occurred (InvalidParameterValueException) when calling the UpdateFunctionConfiguration operation:
The provided execution role does not have permissions to call CreateNetworkInterface on EC2
```

It's raised on `CreateFunction` or `UpdateFunctionConfiguration` with a `VpcConfig`, from the console's **Configuration > VPC** page, and from CloudFormation, SAM, CDK or Terraform. The check runs against the *function's execution role*, not your own permissions.

Lambda does this check up front because VPC functions reach your subnets through Hyperplane elastic network interfaces that the Lambda service creates and manages using the execution role's permissions. The interfaces are shared by functions with the same subnet and security group combination, and appear in the EC2 console with a description starting with `AWS Lambda VPC ENI`. If the role can't create them, the function could never run, so Lambda rejects the configuration instead.

## Fix it

```
ROLE=$(aws lambda get-function-configuration --function-name orders-api \
  --query Role --output text | awk -F/ '{print $NF}')

aws iam attach-role-policy --role-name "$ROLE" \
  --policy-arn arn:aws:iam::aws:policy/service-role/AWSLambdaVPCAccessExecutionRole

aws lambda update-function-configuration --function-name orders-api \
  --vpc-config SubnetIds=subnet-0a1b2c3d4e5f60718,subnet-0f1e2d3c4b5a69788,SecurityGroupIds=sg-0123456789abcdef0
```

The managed policy grants the network interface actions Lambda needs (create, describe, delete, and assign/unassign private IPs) plus CloudWatch Logs writes. If your role has a path, take the role name from the ARN after the last slash, as above.

## If the policy is attached and it still fails

- **IAM propagation**: a role or attachment created seconds ago may not be visible yet. In templates this shows up as a race; add a dependency on the policy attachment, or retry.
- **Permissions boundary** on the role that doesn't include the EC2 network interface actions.
- **Service control policy** in AWS Organizations denying `ec2:CreateNetworkInterface`, often with conditions on subnets or tags. Check with your organisation's admins; see [explicit deny in an SCP](https://cloudconsole.dev/errors/explicit-deny-service-control-policy).
- **A custom inline policy** scoped to specific resources: `ec2:DescribeNetworkInterfaces` doesn't support resource-level permissions, so it must use `"Resource": "*"`.
- **Wrong role**: the function's role isn't the one you edited. Read it from `get-function-configuration`.

## After the function is in the VPC

- **Internet and AWS APIs**: a function in private subnets has no internet access. Calls to S3, DynamoDB, Secrets Manager and others need a NAT gateway or VPC endpoints, or they time out (often surfacing as [Task timed out](https://cloudconsole.dev/errors/lambda-task-timed-out)).
- **Don't use public subnets** expecting internet access; Lambda's interfaces don't get public IPs.
- **Deleting the VPC later**: Lambda's managed interfaces can take a while to be released, which can block subnet or security group deletion with a [DependencyViolation](https://cloudconsole.dev/errors/ec2-dependencyviolation).

## Questions

### Which policy does a Lambda function need to run in a VPC?

The AWS managed policy AWSLambdaVPCAccessExecutionRole on the function's execution role, which includes the EC2 network interface permissions and CloudWatch Logs access.

### Why do I still get the CreateNetworkInterface error after attaching the policy?

Wait for IAM propagation and retry. If it persists, a permissions boundary or service control policy is probably denying the EC2 actions.

### Does a Lambda function in a VPC have internet access?

Not by default. It needs private subnets routed to a NAT gateway, or VPC endpoints for the AWS services it calls.

## When this happens away from your desk

This error blocks a deploy rather than paging you, but the VPC change that follows can cause timeouts in production. CloudConsole, a phone app for AWS, is being built to show Lambda errors, logs and alarms on your phone so you can watch the rollout.

[About the CloudConsole app](https://cloudconsole.dev/aws-console-app) · [Download on the App Store](https://apps.apple.com/app/cloudconsole-for-aws/id6835419710)

## Sources

- [Giving Lambda functions access to resources in an Amazon VPC](https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html)
- [AWSLambdaVPCAccessExecutionRole (AWS managed policy)](https://docs.aws.amazon.com/aws-managed-policy/latest/reference/AWSLambdaVPCAccessExecutionRole.html)

## Related

- [Lambda: Task timed out after 3.00 seconds](https://cloudconsole.dev/errors/lambda-task-timed-out)
- [DependencyViolation: resource has a dependent object](https://cloudconsole.dev/errors/ec2-dependencyviolation)
- [AccessDenied with an explicit deny in a service control policy](https://cloudconsole.dev/errors/explicit-deny-service-control-policy)
- [aws lambda update-function-configuration](https://cloudconsole.dev/cli/lambda-update-function-configuration)
- [AccessDeniedException: User is not authorized to perform this action because no identity-based policy allows it](https://cloudconsole.dev/errors/accessdenied-no-identity-based-policy-allows)
- [CodeStorageExceededException: Code storage limit exceeded](https://cloudconsole.dev/errors/lambda-codestorageexceeded)

---

Source: https://cloudconsole.dev/errors/lambda-execution-role-createnetworkinterface

CloudConsole is an independent iPhone and Android app for Amazon Web Services by Cloudconcur Ltd. It is not affiliated with Amazon Web Services.
