Network
Source:
src/Hetzner/Network.ts
A Hetzner Cloud private Network — an isolated IPv4 range that Cloud
Servers and Load Balancers attach to. Subnets, routes, delete protection,
and labels are synced on the Network itself; network_actions are not
modeled as their own resources.
Creating a Network
Section titled “Creating a Network”Basic Network
const network = yield* Hetzner.Network("vpc", { ipRange: "10.0.0.0/16",});Network with a cloud subnet
const network = yield* Hetzner.Network("vpc", { ipRange: "10.0.0.0/16", subnets: [ { type: "cloud", ipRange: "10.0.1.0/24", networkZone: "eu-central" }, ],});Routes and protection
Section titled “Routes and protection”const network = yield* Hetzner.Network("vpc", { ipRange: "10.0.0.0/16", subnets: [ { type: "cloud", ipRange: "10.0.1.0/24", networkZone: "eu-central" }, ], routes: [{ destination: "10.10.0.0/24", gateway: "10.0.1.2" }], deleteProtection: true,});Labels
Section titled “Labels”const network = yield* Hetzner.Network("vpc", { ipRange: "10.0.0.0/16", labels: { env: "prod", role: "vpc" },});