From 594926c48cb36478e12d81e9e763dae4b3602b9b Mon Sep 17 00:00:00 2001 From: Kochetkov S Date: Wed, 20 May 2026 14:10:13 +0300 Subject: [PATCH] Add prod kafka test topic --- infrastructure.yaml | 12 +++++++++++- modules/yc-database/main.tf | 5 ----- modules/yc-database/outputs.tf | 4 ++-- modules/yc-database/variables.tf | 1 + 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/infrastructure.yaml b/infrastructure.yaml index 32486a3..e3679e8 100644 --- a/infrastructure.yaml +++ b/infrastructure.yaml @@ -18,7 +18,17 @@ environments: allow_partition_decrease: false kafka: - topics: [] + topics: + - name: sarex.prod.kafka-topics-test.events.v1 + owner: kafka-topics-test + clusterRef: prod + partitions: 1 + replicationFactor: 1 + config: + cleanup.policy: delete + retention.ms: "604800000" + min.insync.replicas: "1" + deletionPolicy: orphan namespaces: - name: pulse diff --git a/modules/yc-database/main.tf b/modules/yc-database/main.tf index 4a0d3ee..e9a5bef 100644 --- a/modules/yc-database/main.tf +++ b/modules/yc-database/main.tf @@ -16,11 +16,6 @@ resource "random_password" "user_password" { } } -data "yandex_mdb_postgresql_cluster" "existing" { - for_each = toset([for db in var.databases : db.cluster_id]) - cluster_id = each.value -} - resource "yandex_mdb_postgresql_user" "this" { for_each = local.databases_map diff --git a/modules/yc-database/outputs.tf b/modules/yc-database/outputs.tf index 3e8e70e..fb5c270 100644 --- a/modules/yc-database/outputs.tf +++ b/modules/yc-database/outputs.tf @@ -3,7 +3,7 @@ output "databases" { value = { for key, db in local.databases_map : key => { cluster_id = db.cluster_id - host = try(data.yandex_mdb_postgresql_cluster.existing[db.cluster_id].host[0].fqdn, "") + host = try(db.database.host, "") port = 6432 database_name = yandex_mdb_postgresql_database.this[key].name user_name = yandex_mdb_postgresql_user.this[key].name @@ -17,7 +17,7 @@ output "database_outputs_map" { description = "Map for secrets module (cluster_id:db_name:user_name => credentials)" value = { for key, db in local.databases_map : key => { - host = try(data.yandex_mdb_postgresql_cluster.existing[db.cluster_id].host[0].fqdn, "") + host = try(db.database.host, "") database_name = yandex_mdb_postgresql_database.this[key].name user_name = yandex_mdb_postgresql_user.this[key].name password = random_password.user_password[key].result diff --git a/modules/yc-database/variables.tf b/modules/yc-database/variables.tf index 16b2a8b..1001404 100644 --- a/modules/yc-database/variables.tf +++ b/modules/yc-database/variables.tf @@ -4,6 +4,7 @@ variable "databases" { cluster_id = string database = object({ name = string + host = optional(string, "") lc_collate = optional(string, "en_US.UTF-8") lc_type = optional(string, "en_US.UTF-8") extensions = optional(list(string), [])