This example demonstrates the basic usage of the terraform-hcloud-tailscale-server module.
- A single Hetzner Cloud server with Ubuntu 22.04
- Automatic Tailscale installation and configuration
- Basic firewall rules for Tailscale connectivity
- A user account with sudo privileges
- Copy
terraform.tfvars.exampletoterraform.tfvarsand fill in your values:
cp terraform.tfvars.example terraform.tfvars- Edit
terraform.tfvarswith your actual values:
hcloud_token = "your-hetzner-cloud-api-token"
tailscale_api_key = "your-tailscale-api-key"
tailscale_tailnet = "your-tailnet-name"
ssh_key_name = "your-ssh-key-name"- Initialize and apply:
terraform init
terraform plan
terraform apply- Terraform >= 0.13
- Hetzner Cloud API token
- Tailscale API key
- SSH key uploaded to Hetzner Cloud
server_ip_address: The public IPv4 address of the created serverserver_name: The name of the created server
To destroy the resources:
terraform destroy