++ skip whole provider.tf block for brusnika-stage rabbitmq unit
Some checks failed
Terraform Terragrunt (contour) / validate (push) Successful in 52s
Terraform Terragrunt (contour) / plan (push) Failing after 26s
Terraform Terragrunt (contour) / apply (push) Has been skipped

This commit is contained in:
Kochetkov S 2026-08-07 12:26:15 +03:00
parent 1d411af014
commit d99ba1989d

View File

@ -32,6 +32,12 @@ generate "provider" {
path = "provider.tf" path = "provider.tf"
if_exists = "overwrite_terragrunt" if_exists = "overwrite_terragrunt"
contents = <<EOF_PROVIDER contents = <<EOF_PROVIDER
%{if path_relative_to_include() == "rabbitmq" && get_env("INFRA_ENV", "") == "brusnika-stage"~}
# rabbitmq module >= 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 { terraform {
required_version = ">= 1.5.0" required_version = ">= 1.5.0"
@ -40,17 +46,9 @@ terraform {
vault = { source = "hashicorp/vault", version = "~> 4.2" } vault = { source = "hashicorp/vault", version = "~> 4.2" }
kafka = { source = "Mongey/kafka", version = "0.10.4" } kafka = { source = "Mongey/kafka", version = "0.10.4" }
postgresql = { source = "cyrilgdn/postgresql", version = "~> 1.21" } 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" } rabbitmq = { source = "cyrilgdn/rabbitmq", version = "~> 1.8" }
%{endif~}
minio = { source = "aminueza/minio", version = "~> 2.0" } 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" } random = { source = "hashicorp/random", version = "~> 3.1" }
%{endif~}
tls = { source = "hashicorp/tls", version = "~> 4.0" } tls = { source = "hashicorp/tls", version = "~> 4.0" }
} }
} }
@ -111,5 +109,6 @@ provider "kafka" {
# MinIO provider is configured INSIDE modules/minio-buckets (endpoint from # MinIO provider is configured INSIDE modules/minio-buckets (endpoint from
# infrastructure.yaml, admin creds from Vault via the s3 unit), so it is not # infrastructure.yaml, admin creds from Vault via the s3 unit), so it is not
# generated here. # generated here.
%{endif~}
EOF_PROVIDER EOF_PROVIDER
} }