Skip to content

Conversation

melmathari
Copy link

@melmathari melmathari commented Sep 18, 2025

Closes #209

Description

Create Terraform template for Hetzner Cloud servers with networking and volumes

Type of Change

  • New module
  • Bug fix
  • Feature/enhancement
  • Documentation
  • Other

Testing & Validation

  • Tests pass (bun test)
  • Code formatted (bun run fmt)
  • Changes tested locally

/claim #209

# Directory
cd registry/melmathari/templates/hetzner-cloud/

# Initialize
terraform init

# Validate
terraform validate

# Plan (see what will be created)
terraform plan

# Apply - This will create real resources and cost money
terraform apply

# Destroy everything
terraform destroy
# Hetzner Cloud API Token - REPLACE WITH YOUR ACTUAL TOKEN
# Get your token from: https://console.hetzner.cloud/ -> Projects -> Security -> API Tokens
# IMPORTANT: Keep this token secure and never commit it to version control
hcloud_token = "TOKEN_GOES_HERE"

# Optional: Override default parameter values for local testing
# server_type     = "cx22"
# server_image    = "ubuntu-22.04"
# server_location = "fsn1"
# volume_size     = 20

# Optional: SSH key ID if you want SSH access
# ssh_key_id = "YOUR_SSH_KEY"

Files & Resources

plan.debug
.terraform.lock.zip

Video

Please note in the video the memory size of certain servers was not set properly. I have updated this in the last version.

chrome_bL0ejpcoui.mp4
image

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a comprehensive Hetzner Cloud server template for Coder workspaces that supports dynamic server configuration, persistent storage, and networking.

  • Implements dynamic server configuration through JSON metadata for server types, locations, and images
  • Provides server type/location validation to prevent invalid resource combinations
  • Creates persistent volumes for home directories that survive workspace restarts with proper lifecycle management

Reviewed Changes

Copilot reviewed 6 out of 8 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
registry/melmathari/templates/hetzner-cloud/main.tf Main Terraform configuration implementing the Hetzner Cloud template with dynamic parameters, validation, and resource provisioning
registry/melmathari/templates/hetzner-cloud/hetzner-config.json JSON configuration defining available server types, locations, images, and availability constraints
registry/melmathari/templates/hetzner-cloud/cloud-config.yaml.tftpl Cloud-init template for server initialization and Coder agent setup
registry/melmathari/templates/hetzner-cloud/README.md Comprehensive documentation covering setup, configuration, troubleshooting, and usage
registry/melmathari/README.md Author profile and bio information
.github/typos.toml Updated spell checker configuration to allow Hetzner-specific terms

melmathari and others added 8 commits September 19, 2025 08:49
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@matifali
Copy link
Member

@melmathari, you should be able to run bun fmt to fix all formatting issues.

@melmathari
Copy link
Author

melmathari commented Sep 19, 2025

@matifali I just did, just checked my logs from yesterday I didn't use write, so was under the assumption that it already did so before I committed. Happy to take another look if anything else pops up.

Appreciate your time and feedback.

@melmathari
Copy link
Author

melmathari commented Sep 19, 2025

@matifali Apologies as i'm new to the project, i accidentally named the folder images instead of .images. Also saw that the other checks now all passed, which is great.

Appreciate your time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Hetzner Cloud server template example
2 participants