Skip to content

GCP.NetworkManagement reference

Source: src/GCP/NetworkManagement/ConnectivityTest.ts

A Network Management Connectivity Test (reachability analysis).

Changing testId or location replaces the test. Endpoints, protocol, related projects, round-trip, firewall bypass, description, and labels update in place. Create runs analysis as part of the long-running operation.

ConnectivityTest: Creating a ConnectivityTest

Section titled “ConnectivityTest: Creating a ConnectivityTest”

IP-to-IP TCP test

const test = yield* GCP.NetworkManagement.ConnectivityTest("DnsPath", {
source: {
ipAddress: "10.0.0.1",
networkType: "GCP_NETWORK",
network: "projects/my-project/global/networks/app-vpc",
},
destination: { ipAddress: "10.0.0.2", port: 443 },
protocol: "TCP",
labels: { env: "prod" },
});

Named test with round trip

const test = yield* GCP.NetworkManagement.ConnectivityTest("DnsPath", {
testId: "app-dns-path",
source: { ipAddress: "8.8.8.8", networkType: "NON_GCP_NETWORK" },
destination: { ipAddress: "1.1.1.1", port: 443 },
protocol: "TCP",
roundTrip: true,
description: "public dns path",
});

Source: src/GCP/NetworkManagement/NetworkMonitoringProvider.ts

A Network Intelligence Center Network Monitoring Provider.

The API has no labels, description, or patch method. Identity is the id, location, and provider type; changing any of them replaces the provider. Alchemy stamps ownership into the generated id so list / nuke can find leaked rows.

NetworkMonitoringProvider: Creating a NetworkMonitoringProvider

Section titled “NetworkMonitoringProvider: Creating a NetworkMonitoringProvider”

External provider

const provider = yield* GCP.NetworkManagement.NetworkMonitoringProvider(
"AppNeta",
{ providerType: "EXTERNAL" },
);

Named provider

const provider = yield* GCP.NetworkManagement.NetworkMonitoringProvider(
"AppNeta",
{
networkMonitoringProviderId: "app-neta",
location: "global",
providerType: "EXTERNAL",
},
);

Source: src/GCP/NetworkManagement/OrganizationsVpcFlowLogsConfig.ts

An organization-level VPC Flow Logs configuration.

Organization configs apply across the organization when no target resource is set. Changing the id, organization, location, or target replaces the config. Description, labels, state, sampling, metadata, cross-project annotations, and the export filter update in place.

OrganizationsVpcFlowLogsConfig: Creating an Organization VpcFlowLogsConfig

Section titled “OrganizationsVpcFlowLogsConfig: Creating an Organization VpcFlowLogsConfig”

Organization-wide logs

const logs = yield* GCP.NetworkManagement.OrganizationsVpcFlowLogsConfig(
"OrgLogs",
{
aggregationInterval: "INTERVAL_1_MIN",
labels: { env: "prod" },
},
);

Named org config

const logs = yield* GCP.NetworkManagement.OrganizationsVpcFlowLogsConfig(
"OrgLogs",
{
vpcFlowLogsConfigId: "org-vpc-logs",
organization: "123456789",
description: "org vpc flow logs",
crossProjectMetadata: "CROSS_PROJECT_METADATA_ENABLED",
},
);

Source: src/GCP/NetworkManagement/VpcFlowLogsConfig.ts

A project-level VPC Flow Logs configuration.

Project configs require exactly one target (network, subnet, interconnectAttachment, or vpnTunnel). Changing the id, location, or target resource replaces the config. Description, labels, state, sampling, metadata, and the export filter update in place. Creating with state=DISABLED is rejected by the API, so Alchemy creates ENABLED and then patches.

VpcFlowLogsConfig: Creating a VpcFlowLogsConfig

Section titled “VpcFlowLogsConfig: Creating a VpcFlowLogsConfig”

Log an entire VPC

const network = yield* GCP.Compute.Network("AppVpc", {
autoCreateSubnetworks: false,
});
const logs = yield* GCP.NetworkManagement.VpcFlowLogsConfig("VpcLogs", {
network: network.selfLink ?? network.networkName,
labels: { env: "prod" },
});

Named config with sampling

const logs = yield* GCP.NetworkManagement.VpcFlowLogsConfig("VpcLogs", {
vpcFlowLogsConfigId: "app-vpc-logs",
network: "projects/my-project/global/networks/app-vpc",
aggregationInterval: "INTERVAL_1_MIN",
flowSampling: 0.5,
description: "app vpc flow logs",
});