2025-08-29 20:45:35 -07:00
2025-08-28 22:54:52 -07:00
2025-08-28 22:54:52 -07:00
2025-08-28 22:54:52 -07:00

Terraform Hetzner Setup

This Terraform configuration creates a single Hetzner Cloud server in Nuremberg and manages an SSH key. It also outputs the IPv4 and IPv6 addresses of the server.

⚠️ Note: Hetzner Cloud Terraform provider does not support object storage buckets natively. You will need to create any buckets manually or use an S3-compatible provider.


Project Structure

terraform-hetzner/ ├── main.tf # SSH key, server resource ├── provider.tf # Hetzner provider configuration ├── variables.tf # Input variables (API token) ├── outputs.tf # Outputs IPv4 and IPv6 addresses


Prerequisites

  • Terraform >= 1.3
  • Hetzner Cloud account
  • Hetzner Cloud API token
  • Your SSH public key

Steps to Run

  1. Clone this repository or copy the files to a folder:
git clone <your-repo-url>
cd terraform

2. Set your Hetzner API token in the environment

export HCLOUD_TOKEN="your-api-token"

4. Initialize Terraform
terraform init
terraform apply -var="hcloud_token=$HCLOUD_TOKEN"
Description
No description provided
Readme 33 KiB
Languages
HCL 60.2%
Jinja 39.8%