Skip to content

GCP.ServiceNetworking reference

Source: src/GCP/ServiceNetworking/Connection.ts

A private services access connection (VPC Network Peering to a Google or third-party service producer).

The API has no labels or description. Alchemy treats existence at (network, service) as ownership. list returns connections whose consumer VPC carries Alchemy ownership markers so pnpm nuke:gcp can still clean leaks.

network and service are immutable. reservedPeeringRanges update in place.

Private services access on a VPC

const network = yield* GCP.Compute.Network("Vpc", {
autoCreateSubnetworks: false,
});
const range = yield* GCP.Compute.GlobalAddress("PsaRange", {
addressType: "INTERNAL",
purpose: "VPC_PEERING",
network: network.selfLink,
prefixLength: 24,
});
const connection = yield* GCP.ServiceNetworking.Connection("Psa", {
network: network.networkName,
reservedPeeringRanges: [range.addressName],
});

Explicit service and additional ranges

const connection = yield* GCP.ServiceNetworking.Connection("Psa", {
network: network.networkName,
service: "servicenetworking.googleapis.com",
reservedPeeringRanges: [range.addressName, extra.addressName],
});