Provisions infrastructure for a Golang application on Hetzner cloud. The code packs a Golang, PostgreSQL, S3(minio) images using packer then launches the infrastructure using Terraform with helpers such as bash, hcloud and supfile. The main reason behind the setup is the make it as cost effective as possible to launch a small to medium project.
- Make sure you have hcloud, supfile, packer and terraform installed locally.
- Start a new project on Hetzner and get your API token.
vars.jsonand add your config/secrets.
cloud-init/base.ymlwith your public key.
./infra.sh upto start the provisioning
./infra.sh downto remove all images, volumes and instances.
https://s3-1.example.com/ where example.com is your domain and notice we update Cloudflare DNS automatically while provisioning.
Get code on https://github.com/gadelkareem/iac_hetzner