Skip to content

StaticIp

A StaticIp is a reserved public address that survives VM replacement. On AWS this is an Elastic IP, on GCP a regional Address, on Hetzner a Floating IP, and on DigitalOcean a Floating IP.

Vm and LoadBalancer reference it as an object (not a string-only ID) so the graph creates the address first. Attachment happens at create time only — imported VMs are not re-associated.

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
region string no Abstract region (us-east, eu-central, …)
ipVersion 'ipv4' | 'ipv6' no Address family (default ipv4)
import { LoadBalancer, StaticIp, Vm, Vpc } from '@kykucloud/types'
const vpc = new Vpc({ name: 'web-vpc', cidr: '10.0.0.0/16', region: 'eu-central' })
const ip = new StaticIp({
name: 'web-ip',
region: 'eu-central',
})
const server = new Vm({
name: 'web-server',
instanceType: 'small',
image: 'ubuntu-24.04',
network: vpc,
staticIp: ip,
})
const lb = new LoadBalancer({
name: 'web-lb',
lbType: 'application',
vpc,
listeners: [{ port: 80, protocol: 'http', targets: [{ vm: server, port: 80 }] }],
staticIp: ip,
})
Provider Supported Backend
AWS Elastic IP (AllocateAddress)
GCP Compute Address (regional)
Hetzner Floating IP
DigitalOcean Floating IP
  • Outputs: address is the allocated public IP. AWS also exposes allocationId.
  • AWS: IPv6 Elastic IPs are not supported. Name lookup uses the Name tag.
  • DigitalOcean: Floating IPs have no name field. Idempotent create relies on state providerId (the address). Object-ref attach at VM create is skipped; pass the address string to attach.
  • Attachment: Create-time only. Destroy the VM/LB before the StaticIp.