Skip to content

Some CLI Tools/Libs for communcating with Hetzner services - written in Go

License

Notifications You must be signed in to change notification settings

jdvgh/hetzner-tools-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Some CLI Tools/Libs for communcating with Hetzner services - written in Go

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages