hetzner-tools-go

module
v0.0.0-...-12d3de5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 17, 2024 License: Apache-2.0

README

Hetzner-Tools-Go

version Apache License v2 GitHub go.mod Go version of a Go module

This is just a personal project for helper functions to talk to the Hetzner-API Hetzner.

Motivation

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.:

  1. Deploy a 1-server-k3s-cluster by using terraform-hcloud-kube-hetzner
  2. Retrieve the public IPv4 of the server
  3. Retrieve all DNS-Records (of type A) for the respective Zone
  4. Update all my DNS-Record of the DNS-Zone to point to the new IP

Underneath

It mainly uses

How to run

Get Credentials

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.:

Using .env file
HCLOUD_API_TOKEN="YOUR_HCLOUD_API_TOKEN_HERE"
HETZNER_DNS_API_TOKEN="YOUR_HETZNER_DNS_API_TOKEN_HERE"
HETZNER_DNS_ZONE_ID="example.com"
Using CLI arguments
go run ./hetzner-tools-go/main.go  dns list --dns-api-token="YOUR_HCLOUD_API_TOKEN_HERE" --hcloud-dns-zone-id="example.com"

Clone the repo and use go run

  1. Change the directory to the root of the repository
  2. Run the wanted command e.g. go run hetzner-tools-go/main.go server list

Installing the command

go install github.com/jdvgh/hetzner-tools-go/hetzner-tools-go@main

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL