Skip to content

PrimaryIp

Source: src/Hetzner/PrimaryIp.ts

An unassigned Hetzner Cloud Primary IP. Provide type and either a location or a datacenter; Alchemy generates a unique name unless you set name. Assignee wiring is a later resource.

type, location, and datacenter are immutable — changing any of them replaces the Primary IP (new address). name, autoDelete, labels, and deleteProtection update in place.

IPv6 in Nuremberg

const ip = yield* Hetzner.PrimaryIp("web-ipv6", {
type: "ipv6",
location: "nbg1",
});

IPv4 placed by datacenter

const ip = yield* Hetzner.PrimaryIp("web-ipv4", {
type: "ipv4",
datacenter: "nbg1-dc3",
});
const ip = yield* Hetzner.PrimaryIp("mail", {
name: "mail-ipv4",
type: "ipv4",
location: "fsn1",
autoDelete: false,
labels: { role: "mail" },
});