This template allows deploying a forgejo en either Scaleway or Hetzner (untested) without much knowledge about them. It DOES require knowledge about Terragrunt and ansible. A wizard of sorts is provided but it will not guarantee success without some knowledge about the underlying technology.
63 lines
1.2 KiB
HCL
63 lines
1.2 KiB
HCL
# Hetzner Root Configuration
|
|
# This file contains common configuration for all Hetzner resources
|
|
|
|
locals {
|
|
# Project configuration
|
|
project_name = "forgejo"
|
|
environment = "production"
|
|
|
|
# Hetzner configuration
|
|
location = "nbg1" # Nuremberg, Germany
|
|
|
|
# Labels for resource organization
|
|
common_labels = {
|
|
project = "forgejo"
|
|
environment = "production"
|
|
managed-by = "terragrunt"
|
|
}
|
|
}
|
|
|
|
# Generate provider configuration
|
|
generate "provider" {
|
|
path = "provider.tf"
|
|
if_exists = "overwrite_terragrunt"
|
|
contents = <<EOF
|
|
terraform {
|
|
required_version = ">= 1.5.0"
|
|
|
|
required_providers {
|
|
hcloud = {
|
|
source = "hetznercloud/hcloud"
|
|
version = "~> 1.45"
|
|
}
|
|
}
|
|
}
|
|
|
|
provider "hcloud" {
|
|
# Token should be set via environment variable:
|
|
# HCLOUD_TOKEN
|
|
}
|
|
EOF
|
|
}
|
|
|
|
# Remote state configuration
|
|
remote_state {
|
|
backend = "local"
|
|
|
|
config = {
|
|
path = "${get_parent_terragrunt_dir()}/terraform.tfstate"
|
|
}
|
|
|
|
generate = {
|
|
path = "backend.tf"
|
|
if_exists = "overwrite_terragrunt"
|
|
}
|
|
}
|
|
|
|
# Input values available to all child configurations
|
|
inputs = {
|
|
project_name = local.project_name
|
|
environment = local.environment
|
|
location = local.location
|
|
common_labels = local.common_labels
|
|
}
|