Skip to content

GCP.VpcAccess reference

Source: packages/gcp/src/VpcAccess/Connector.ts

A Serverless VPC Access connector.

Connectors let Cloud Run, Cloud Functions, and App Engine reach resources in a VPC. The API has no labels or description field — Alchemy treats existence at the computed name as ownership, and list returns every connector in the project so pnpm nuke:gcp can still clean leaks.

connectorId, location, network, ipCidrRange, and subnet are immutable. machineType and min/max instances (or throughput) update in place.

Generated name on the default VPC

const connector = yield* GCP.VpcAccess.Connector("Egress", {
ipCidrRange: "10.8.0.0/28",
minInstances: 2,
maxInstances: 3,
});

Explicit id, machine type, and scaling

const connector = yield* GCP.VpcAccess.Connector("Egress", {
connectorId: "app-egress",
location: "us-central1",
network: "default",
ipCidrRange: "10.8.0.0/28",
machineType: "e2-micro",
minInstances: 2,
maxInstances: 4,
});
const connector = yield* GCP.VpcAccess.Connector("Egress", {
subnet: { name: subnet.subnetworkName },
minInstances: 2,
maxInstances: 3,
});

Connector: Looking up an existing connector

Section titled “Connector: Looking up an existing connector”

Connector.lookup references a connector Alchemy doesn’t manage (created in the console or by another stack). It is read during plan/deploy, never created, updated or deleted, and binds like a declared connector.

const connector = GCP.VpcAccess.Connector.lookup({
connectorId: "my-connector",
});