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.
Creating a Network Connector
Section titled “Creating a Network Connector”const connector = yield* AWS.Lambda.NetworkConnector("Egress", { subnetIds: [subnetA.subnetId, subnetB.subnetId], securityGroupIds: [securityGroup.groupId], operatorRole: role.roleArn,});Dual-Stack Networking
Section titled “Dual-Stack Networking”const connector = yield* AWS.Lambda.NetworkConnector("DualStack", { subnetIds: [subnet.subnetId], securityGroupIds: [securityGroup.groupId], networkProtocol: "DualStack",});Using a Connector with MicroVMs
Section titled “Using a Connector with MicroVMs”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],});