provisioning-catalog/providers/hetzner/nickel/catalog.ncl

47 lines
2.4 KiB
Text
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

let s = import "../../prov_lib/nickel/provider_catalog.ncl" in
# Hetzner Cloud catalog declaration consumed by fleet-protocol's Provider
# contract. Snapshot pricing in cents-per-hour (1 EUR = 10_000 Cents).
# Live prices come from the hcloud API via hetzner/nulib/hetzner/prices.nu;
# this file is the declarative reference the daemon and fleet-sim use when
# offline. Refresh periodically against the public Hetzner price list.
#
# Hetzner billing semantics (2026-05):
# - Per-hour granularity, no per-second.
# - Monthly cap at 730h (~30.4 days × 24h). Hours beyond that are free.
# - Power-off still incurs charge for IPs + volumes but server compute
# freezes — modelled here as stop_start_free=false (conservative).
{
catalog = {
name = "hetzner",
billing_policy = {
granularity_s = 3600,
minimum_s = 3600,
monthly_cap_hours = 730,
rounding = "ceil_hour",
} | s.BillingPolicy,
supports = {
resize = true,
resize_needs_reboot = true,
stop_start_free = false,
spot = false,
sustained_use_discount = false,
} | s.Supports,
# ARM (cax*) + x86 (cpx*) shared-vCPU lineup. Add/remove rows as Hetzner
# publishes new SKUs. hourly_cents = EUR/h × 10_000.
instance_types = [
{ id = "cax11", arch = "arm64", cpu = 2, ram_gb = 4, disk_gb = 40, hourly_cents = 48 } | s.InstanceType,
{ id = "cax21", arch = "arm64", cpu = 4, ram_gb = 8, disk_gb = 80, hourly_cents = 86 } | s.InstanceType,
{ id = "cax31", arch = "arm64", cpu = 8, ram_gb = 16, disk_gb = 160, hourly_cents = 223 } | s.InstanceType,
{ id = "cax41", arch = "arm64", cpu = 16, ram_gb = 32, disk_gb = 320, hourly_cents = 458 } | s.InstanceType,
{ id = "cpx11", arch = "x86_64", cpu = 2, ram_gb = 2, disk_gb = 40, hourly_cents = 52 } | s.InstanceType,
{ id = "cpx21", arch = "x86_64", cpu = 3, ram_gb = 4, disk_gb = 80, hourly_cents = 80 } | s.InstanceType,
{ id = "cpx31", arch = "x86_64", cpu = 4, ram_gb = 8, disk_gb = 160, hourly_cents = 155 } | s.InstanceType,
{ id = "cpx41", arch = "x86_64", cpu = 8, ram_gb = 16, disk_gb = 240, hourly_cents = 275 } | s.InstanceType,
{ id = "cpx51", arch = "x86_64", cpu = 16, ram_gb = 32, disk_gb = 360, hourly_cents = 555 } | s.InstanceType,
],
} | s.ProviderCatalog,
}