Skip to content

Commit c287a81

Browse files
committed
ReadMe
1 parent 210ee09 commit c287a81

File tree

1 file changed

+74
-28
lines changed
  • registry/melmathari/templates/hetzner-cloud

1 file changed

+74
-28
lines changed

registry/melmathari/templates/hetzner-cloud/README.md

Lines changed: 74 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Provision Hetzner Cloud servers as [Coder workspaces](https://coder.com/docs/wor
1313
This template provides a comprehensive Hetzner Cloud setup with:
1414

1515
- **Dynamic Configuration**: Server types, locations, and images loaded from JSON
16-
- **Smart Validation**: Prevents invalid server type/location combinations
16+
- **Location-Aware Filtering**: Available server types automatically filter based on selected location
1717
- **Multiple Server Types**: Shared, dedicated, and CPU-optimized instances
1818
- **Global Locations**: Germany, Finland, and USA datacenters
1919
- **Persistent Storage**: Home volumes that survive workspace restarts
@@ -72,19 +72,29 @@ This means that when the workspace restarts, any tools or files outside of the h
7272

7373
## Server Types
7474

75-
The template supports all major Hetzner Cloud server types:
75+
The template supports current Hetzner Cloud server types:
7676

77-
### Shared vCPU (Cost-effective)
77+
### ARM-based (Energy Efficient)
7878

79-
- **CX11**: 1 vCPU, 4 GB RAM
80-
- **CX21**: 2 vCPU, 8 GB RAM
81-
- **CX22**: 2 vCPU, 4 GB RAM (AMD)
82-
- **CX31**: 2 vCPU, 8 GB RAM
83-
- **CX32**: 4 vCPU, 8 GB RAM (AMD)
84-
- **CX41**: 4 vCPU, 16 GB RAM
85-
- **CX42**: 8 vCPU, 16 GB RAM (AMD)
86-
- **CX51**: 8 vCPU, 32 GB RAM
87-
- **CX52**: 16 vCPU, 32 GB RAM (AMD)
79+
- **CAX11**: 2 vCPU, 4 GB RAM
80+
- **CAX21**: 4 vCPU, 8 GB RAM
81+
- **CAX31**: 8 vCPU, 16 GB RAM
82+
- **CAX41**: 16 vCPU, 32 GB RAM
83+
84+
### Shared AMD (Cost-effective)
85+
86+
- **CX22**: 2 vCPU, 4 GB RAM
87+
- **CX32**: 4 vCPU, 8 GB RAM
88+
- **CX42**: 8 vCPU, 16 GB RAM
89+
- **CX52**: 16 vCPU, 32 GB RAM
90+
91+
### Intel CPU-Optimized
92+
93+
- **CPX11**: 2 vCPU, 2 GB RAM
94+
- **CPX21**: 3 vCPU, 4 GB RAM
95+
- **CPX31**: 4 vCPU, 8 GB RAM
96+
- **CPX41**: 8 vCPU, 16 GB RAM
97+
- **CPX51**: 16 vCPU, 32 GB RAM
8898

8999
### Dedicated vCPU (High Performance)
90100

@@ -95,23 +105,16 @@ The template supports all major Hetzner Cloud server types:
95105
- **CCX53**: 32 vCPU, 128 GB RAM
96106
- **CCX63**: 48 vCPU, 192 GB RAM
97107

98-
### CPU-Optimized
99-
100-
- **CPX11**: 2 vCPU, 2 GB RAM
101-
- **CPX21**: 3 vCPU, 4 GB RAM
102-
- **CPX31**: 4 vCPU, 8 GB RAM
103-
- **CPX41**: 8 vCPU, 16 GB RAM
104-
- **CPX51**: 16 vCPU, 64 GB RAM
105-
106108
## Locations
107109

108110
Available locations:
109111

110-
- **Falkenstein, Germany** (fsn1) - Primary location
111-
- **Nuremberg, Germany** (nbg1) - Secondary location
112-
- **Helsinki, Finland** (hel1) - EU Nordic
112+
- **Falkenstein, Germany** (fsn1) - Europe
113+
- **Nuremberg, Germany** (nbg1) - Europe
114+
- **Helsinki, Finland** (hel1) - Europe
113115
- **Ashburn, Virginia, USA** (ash) - US East Coast
114116
- **Hillsboro, Oregon, USA** (hil) - US West Coast
117+
- **Singapore** (sin) - Asia Pacific
115118

116119
## Supported Operating Systems
117120

@@ -141,14 +144,25 @@ The template uses `hetzner-config.json` for dynamic configuration:
141144
- **Server Types**: Add new server types with their specifications
142145
- **Locations**: Add new Hetzner datacenters as they become available
143146
- **Images**: Update with current Hetzner image names (verify with API)
144-
- **Availability**: Map server type restrictions per location
147+
- **Availability**: Map server type restrictions per location (only shown server types that are available)
148+
149+
**How it works**: When a user selects a location, the template automatically filters the server type dropdown to only show instances available in that location. This prevents configuration errors by design.
145150

146151
**Example**: Adding a new server type:
147152

148153
```json
149154
"cx62": { "name": "CX62 (16 vCPU, 64 GB RAM, AMD)", "vcpus": 16, "memory": 64 }
150155
```
151156

157+
If a server type has limited availability, add it to the `availability` section:
158+
159+
```json
160+
"availability": {
161+
"ccx63": ["fsn1", "nbg1"], // Only available in these locations
162+
"*": ["fsn1", "nbg1", "hel1", "ash", "hil"] // Default for all other types
163+
}
164+
```
165+
152166
**Important**: Always verify image names match Hetzner's official names exactly to avoid provisioning errors.
153167

154168
### Optional Variables
@@ -191,9 +205,9 @@ The template includes:
191205

192206
## Troubleshooting
193207

194-
### Invalid Server Type/Location Combination
208+
### Server Type Options Change When Selecting Location
195209

196-
The template includes validation to prevent selecting server types that aren't available in certain locations. If you encounter this error, choose a different server type or location combination.
210+
The template dynamically filters server types based on the selected location. For example, if you select a location where certain dedicated server types aren't available, those options won't appear in the server type dropdown. This prevents configuration errors before they happen.
197211

198212
### Image Not Found Errors
199213

@@ -239,13 +253,45 @@ If you can't connect to development servers:
239253
2. Check that the private network is configured correctly
240254
3. Ensure the server has a public IP address
241255

256+
## Local Testing
257+
258+
To test this template locally before deployment:
259+
260+
1. **Create a configuration file**:
261+
262+
```bash
263+
cp terraform.tfvars.example terraform.tfvars
264+
```
265+
266+
2. **Add your Hetzner Cloud API token** to `terraform.tfvars`:
267+
268+
```hcl
269+
hcloud_token = "your-actual-token-here"
270+
```
271+
272+
3. **Initialize and validate**:
273+
274+
```bash
275+
terraform init
276+
terraform validate
277+
terraform plan
278+
```
279+
280+
4. **Test dynamic filtering**: Try planning with different locations to verify server types filter correctly:
281+
```bash
282+
terraform plan -var="location=fsn1" # Should show CCX63
283+
terraform plan -var="location=ash" # Should NOT show CCX63
284+
```
285+
286+
See `TEST_GUIDE.md` for detailed testing instructions.
287+
242288
## Notes
243289

244290
> [!NOTE]
245291
> This template is designed to be a starting point! Edit the Terraform configuration to extend the template to support your specific use case.
246292
247293
> [!IMPORTANT]
248-
> The SSH key in this template is a placeholder. In a production environment, you should replace it with your actual SSH public key or remove the SSH key resource entirely if not needed.
294+
> The SSH key parameter defaults to 0 (no SSH key). To enable SSH access, set `ssh_key_id` to your actual SSH key ID from Hetzner Cloud.
249295
250296
> [!WARNING]
251-
> Some server types may not be available in all locations. The template includes validation to prevent invalid combinations, but availability can change over time.
297+
> Server types are automatically filtered based on location availability. If you don't see a specific server type in the dropdown, it's not available in your selected location.

0 commit comments

Comments
 (0)