You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -141,14 +144,25 @@ The template uses `hetzner-config.json` for dynamic configuration:
141
144
-**Server Types**: Add new server types with their specifications
142
145
-**Locations**: Add new Hetzner datacenters as they become available
143
146
-**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.
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
+
152
166
**Important**: Always verify image names match Hetzner's official names exactly to avoid provisioning errors.
153
167
154
168
### Optional Variables
@@ -191,9 +205,9 @@ The template includes:
191
205
192
206
## Troubleshooting
193
207
194
-
### Invalid Server Type/Location Combination
208
+
### Server Type Options Change When Selecting Location
195
209
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.
197
211
198
212
### Image Not Found Errors
199
213
@@ -239,13 +253,45 @@ If you can't connect to development servers:
239
253
2. Check that the private network is configured correctly
240
254
3. Ensure the server has a public IP address
241
255
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
+
242
288
## Notes
243
289
244
290
> [!NOTE]
245
291
> This template is designed to be a starting point! Edit the Terraform configuration to extend the template to support your specific use case.
246
292
247
293
> [!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.
249
295
250
296
> [!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