This is just a personal project for helper functions to talk to the Hetzner-API Hetzner.
My personal use case is that I want to have my personal domain point to a new IP without having to do any manual steps e.g.:
- Deploy a 1-server-k3s-cluster by using terraform-hcloud-kube-hetzner
- Retrieve the public IPv4 of the server
- Retrieve all DNS-Records (of type A) for the respective Zone
- Update all my DNS-Record of the DNS-Zone to point to the new IP
It mainly uses
- Hetzner DNS API Hetzner DNS API
- Hetzner HCloud Go API Hetzner HCLoud Go
- Cobra-CLI to generate the CLI Cobra-CLI
- My personal bootstrapping project (which uses terraform-hcloud-kube-hetzner - as mentioned above in the underlyings) hetzner-k3s-bootstrap
Log into your Hetzner Account and get a DNS API key and an HCloud API Key.
You can either specify them in a local .env
file, or via the CLI arguments e.g.:
- DNS API Key Retrieval Hetzner DNS API Key Docs
- Hcloud API Key Hcloud API Key Docs
HCLOUD_API_TOKEN="YOUR_HCLOUD_API_TOKEN_HERE"
HETZNER_DNS_API_TOKEN="YOUR_HETZNER_DNS_API_TOKEN_HERE"
HETZNER_DNS_ZONE_ID="example.com"
go run ./hetzner-tools-go/main.go dns list --dns-api-token="YOUR_HCLOUD_API_TOKEN_HERE" --hcloud-dns-zone-id="example.com"
- Change the directory to the root of the repository
- Run the wanted command e.g.
go run hetzner-tools-go/main.go server list
go install github.com/jdvgh/hetzner-tools-go/hetzner-tools-go@main