From 867eed40529dfb133e066768157c6dbe2099a21a Mon Sep 17 00:00:00 2001 From: Kochetkov S Date: Tue, 11 Aug 2026 13:36:04 +0300 Subject: [PATCH] ++ fix infrastructre.yaml --- infrastructure.yaml | 19 +++---------------- live/rabbitmq/terragrunt.hcl | 18 ++++++++++++++---- 2 files changed, 17 insertions(+), 20 deletions(-) diff --git a/infrastructure.yaml b/infrastructure.yaml index 4836c0d..b06ce8c 100644 --- a/infrastructure.yaml +++ b/infrastructure.yaml @@ -1,9 +1,5 @@ current_environment: yc-k8s-test -# Contour branch — one declarative source for ALL closed contours. The concrete -# contour is selected by INFRA_ENV (falls back to current_environment). Entities -# use the SAME schema/contract as the product master branch; only the backend is -# in-cluster (see live/terragrunt.hcl providers). ++ ++ ++ ++ ++ environments: ugmk: namespaces: @@ -350,9 +346,6 @@ environments: buckets: [] kafka: - # Broker has no authorizer configured (authorizer.class.name unset) — - # any ACL write is rejected with "Security features are disabled". - # Topics/users still work; skip ACLs until the broker enables one. create_acls: false kafka_cluster_refs: main: @@ -579,20 +572,16 @@ environments: vhost: test-vhost durable: true - # brusnika-stage — приёмочный тест декларативного контракта секретов v2 - # (см. SECRETS-CONTRACT-PLAN.md) перед массовым переключением на схемы. brusnika-stage: namespaces: - name: test-terraform manage: true - image_pull_secret: false # regcred сюда приходит через v2 ownership=referenced, не через legacy fan-out + image_pull_secret: false - name: rabbitmq-module-test manage: true image_pull_secret: false - # In-cluster RabbitMQ (bitnami, ns django). Admin creds - secrets/rabbitmq/auth - # в Vault, засеяно вручную из существующего django/rabbitmq-secret (см. план, - # раздел 11 "Предусловие"). + rabbitmq: amqp_host: rabbitmq-service.django.svc.cluster.local amqp_port: 5672 @@ -617,9 +606,7 @@ environments: configure: ".*" write: ".*" read: ".*" - # Пилот внешнего модуля terraform-modules/rabbitmq (RABBITMQ-MODULE-PILOT.md) - - # отдельные vhost/user/queue от test-terraform, чтобы не трогать уже рабочий - # secrets-contract-probe. Задействует все сущности, которые умеет модуль. + topic_permissions: - vhost: rabbitmq-module-test user: rabbitmq-module-test diff --git a/live/rabbitmq/terragrunt.hcl b/live/rabbitmq/terragrunt.hcl index 4babf31..52a0e0f 100644 --- a/live/rabbitmq/terragrunt.hcl +++ b/live/rabbitmq/terragrunt.hcl @@ -16,6 +16,16 @@ locals { ) env_config = try(local.infra_config.environments[local.env_name], {}) + + contracts = dependency.contracts.outputs.rabbitmq_module_inputs +} + +dependency "contracts" { + config_path = "../contracts" + mock_outputs = { + rabbitmq_module_inputs = { vhosts = [], users = [], permissions = [], queues = [] } + } + mock_outputs_allowed_terraform_commands = ["init", "validate", "plan", "state", "import"] } remote_state { @@ -54,12 +64,12 @@ inputs = { amqp_host = try(local.env_config.rabbitmq.amqp_host, "rabbitmq.rabbitmq.svc.cluster.local") amqp_port = try(local.env_config.rabbitmq.amqp_port, 5672) - vhosts = try(local.env_config.rabbitmq.vhosts, []) - users = try(local.env_config.rabbitmq.users, []) - permissions = try(local.env_config.rabbitmq.permissions, []) + vhosts = concat(try(local.env_config.rabbitmq.vhosts, []), local.contracts.vhosts) + users = concat(try(local.env_config.rabbitmq.users, []), local.contracts.users) + permissions = concat(try(local.env_config.rabbitmq.permissions, []), local.contracts.permissions) topic_permissions = try(local.env_config.rabbitmq.topic_permissions, []) exchanges = try(local.env_config.rabbitmq.exchanges, []) - queues = try(local.env_config.rabbitmq.queues, []) + queues = concat(try(local.env_config.rabbitmq.queues, []), local.contracts.queues) bindings = try(local.env_config.rabbitmq.bindings, []) policies = try(local.env_config.rabbitmq.policies, []) }