Skip to content
v2.276.0

NetworkConnectorComputeType Enum Added in v2.276.0 ​

The compute resource type a network connector is provisioned for.

A connector serves exactly one type; a WebFunction can only use a connector created for WEB_FUNCTION.

Example ​

ts
import * as ec2 from 'aws-cdk-lib/aws-ec2';

declare const vpc: ec2.Vpc;
declare const code: lambda.WebFunctionCode;

const securityGroup = new ec2.SecurityGroup(this, 'EgressSecurityGroup', { vpc });

const connector = new lambda.NetworkConnector(this, 'Egress', {
  configuration: lambda.NetworkConnectorConfiguration.vpcEgress({
    computeType: lambda.NetworkConnectorComputeType.WEB_FUNCTION,
    vpc,
    vpcSubnets: { subnetType: ec2.SubnetType.PRIVATE_WITH_EGRESS },
    securityGroups: [securityGroup],
  }),
});

new lambda.WebFunction(this, 'MyWebFunction', {
  code,
  runtime: lambda.WebFunctionRuntime.NODEJS_24_X,
  defaultEndpointAuth: lambda.WebFunctionAuthType.IAM_AUTH,
  egressNetworkConnector: connector,
});

Members ​

MemberDescription
WEB_FUNCTIONLambda WebFunction.
MICRO_VMLambda MicroVM.

Referenced by ​