# Root Terragrunt config for foxhunt production # All child modules inherit provider, backend, and common inputs from here. locals { region = "fr-par" zone = "fr-par-2" project_id = get_env("SCW_DEFAULT_PROJECT_ID") } # Remote state in GitLab Terraform state backend (project root/foxhunt, ID=1) # Token stored in k8s secret gitlab-terraform-state-token # Set TF_HTTP_USERNAME and TF_HTTP_PASSWORD env vars before running terragrunt. remote_state { backend = "http" generate = { path = "backend.tf" if_exists = "overwrite" } config = { address = "${get_env("GITLAB_TF_STATE_URL", "https://tf.fxhnt.ai")}/api/v4/projects/1/terraform/state/${path_relative_to_include()}" lock_address = "${get_env("GITLAB_TF_STATE_URL", "https://tf.fxhnt.ai")}/api/v4/projects/1/terraform/state/${path_relative_to_include()}/lock" unlock_address = "${get_env("GITLAB_TF_STATE_URL", "https://tf.fxhnt.ai")}/api/v4/projects/1/terraform/state/${path_relative_to_include()}/lock" lock_method = "POST" unlock_method = "DELETE" } } # Generate provider config for all child modules generate "provider" { path = "provider.tf" if_exists = "overwrite" contents = <<-EOF terraform { required_version = ">= 1.8.0" required_providers { scaleway = { source = "scaleway/scaleway" version = "~> 2.46" } random = { source = "hashicorp/random" version = "~> 3.6" } } } provider "scaleway" { region = "${local.region}" zone = "${local.zone}" project_id = "${local.project_id}" } EOF } # Common inputs available to all child modules inputs = { region = local.region zone = local.zone project_id = local.project_id }