Skip to content

NetworkConnector

Source: src/AWS/Lambda/NetworkConnector.ts

A Lambda network connector that gives Lambda compute resources — notably {@link MicrovmImage} MicroVMs — a managed egress path into your VPC. The connector provisions elastic network interfaces (ENIs) in the subnets you specify so workloads can reach private resources such as databases, caches, and internal APIs.

Creation is asynchronous: the connector starts in PENDING while ENIs are provisioned (this can take several minutes) and the provider waits until it reaches ACTIVE. The connector name is immutable, so renaming it replaces the connector; the VPC configuration and operator role can be updated in place.

const connector = yield* AWS.Lambda.NetworkConnector("Egress", {
subnetIds: [subnetA.subnetId, subnetB.subnetId],
securityGroupIds: [securityGroup.groupId],
operatorRole: role.roleArn,
});
const connector = yield* AWS.Lambda.NetworkConnector("DualStack", {
subnetIds: [subnet.subnetId],
securityGroupIds: [securityGroup.groupId],
networkProtocol: "DualStack",
});

A connector is the producer; a {@link MicrovmImage} (or a per-run RunMicrovm call) is the consumer. Reference it by ARN in egressNetworkConnectors.

const image = yield* AWS.Lambda.MicrovmImage("Sandbox", {
main: import.meta.filename,
buildRole,
egressNetworkConnectors: [connector.networkConnectorArn],
});