From d99ba1989dca2540d772d5099e43c964aeade3e5 Mon Sep 17 00:00:00 2001 From: Kochetkov S Date: Fri, 7 Aug 2026 12:26:15 +0300 Subject: [PATCH] ++ skip whole provider.tf block for brusnika-stage rabbitmq unit --- live/terragrunt.hcl | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/live/terragrunt.hcl b/live/terragrunt.hcl index 3a53f99..8d18634 100644 --- a/live/terragrunt.hcl +++ b/live/terragrunt.hcl @@ -32,6 +32,12 @@ generate "provider" { path = "provider.tf" if_exists = "overwrite_terragrunt" contents = <= v1.0.0 (terraform-modules/rabbitmq, brusnika-stage pilot) +# declares its own required_providers and provider "rabbitmq" block, and this +# unit uses no other provider - the whole shared block below is intentionally +# skipped here to avoid "Duplicate required providers configuration". +%{else~} terraform { required_version = ">= 1.5.0" @@ -40,17 +46,9 @@ terraform { vault = { source = "hashicorp/vault", version = "~> 4.2" } kafka = { source = "Mongey/kafka", version = "0.10.4" } postgresql = { source = "cyrilgdn/postgresql", version = "~> 1.21" } -%{if !(path_relative_to_include() == "rabbitmq" && get_env("INFRA_ENV", "") == "brusnika-stage")~} - # rabbitmq module >= v1.0.0 (brusnika-stage only, terraform-modules/rabbitmq) - # declares its own required_providers - excluded here for that one unit to - # avoid "Duplicate required providers configuration". Every other unit and - # every other environment keeps this entry unchanged. rabbitmq = { source = "cyrilgdn/rabbitmq", version = "~> 1.8" } -%{endif~} minio = { source = "aminueza/minio", version = "~> 2.0" } -%{if !(path_relative_to_include() == "rabbitmq" && get_env("INFRA_ENV", "") == "brusnika-stage")~} random = { source = "hashicorp/random", version = "~> 3.1" } -%{endif~} tls = { source = "hashicorp/tls", version = "~> 4.0" } } } @@ -111,5 +109,6 @@ provider "kafka" { # MinIO provider is configured INSIDE modules/minio-buckets (endpoint from # infrastructure.yaml, admin creds from Vault via the s3 unit), so it is not # generated here. +%{endif~} EOF_PROVIDER }