Skip to content

Vpc

A Vpc represents an isolated virtual network. It is the foundational network resource — every Vm, LoadBalancer, Database, and Cache must reference a Vpc. In AWS this is an EC2-VPC, in GCP a VPC Network, in Hetzner a Network, and in DigitalOcean a VPC.

Property Type Required Description
name string yes Unique resource name
id string no Explicit ID (auto-generated UUID if omitted)
provider string no Provider label for multi-provider configs
tags Record<string, string> no Arbitrary key-value metadata
cidr string yes CIDR block (e.g. 10.0.0.0/16)
region string | RegionMap yes Abstract region name or per-provider map
distributeAcrossAzs number no Number of AZs to distribute subnets across (default 3)
import { Vpc } from '@kykucloud/types'
const myVpc = new Vpc({
name: 'my-vpc',
cidr: '10.0.0.0/16',
region: 'eu-central',
distributeAcrossAzs: 2,
})
Provider Supported Backend
AWS EC2-VPC with IGW, NAT gateways, route tables, subnets
GCP VPC Network
Hetzner Network
DigitalOcean VPC
  • CIDR validation: DigitalOcean requires private ranges (10.x, 172.16-31.x, 192.168.x).
  • AWS VPC auto-creates a full network stack: Internet Gateway, NAT gateways per public subnet, Elastic IPs, and public/private route tables. NAT gateways incur ongoing costs.
  • Hetzner Network zones are abstract (eu-central), not location-specific (fsn1, nbg1).
  • Immutable: VPC CIDR and region cannot be changed after creation on AWS.
  • Name length: AWS 255 chars (tags), GCP 62 chars, Hetzner 63 chars, DO 255 chars. Deploy prefix adds 9 characters.