Hetzner.Network reference
Network
Section titled “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.
Network: Creating a Network
Section titled “Network: 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" }, ],});Network: Routes and protection
Section titled “Network: 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,});Network: Labels
Section titled “Network: Labels”const network = yield* Hetzner.Network("vpc", { ipRange: "10.0.0.0/16", labels: { env: "prod", role: "vpc" },});