mirror of
https://gitlab.sarex.io/infra/terraform-contour-mirror.git
synced 2026-08-09 05:21:36 +03:00
Add prod kafka test topic
This commit is contained in:
parent
48ff34fad3
commit
594926c48c
@ -18,7 +18,17 @@ environments:
|
|||||||
allow_partition_decrease: false
|
allow_partition_decrease: false
|
||||||
|
|
||||||
kafka:
|
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:
|
namespaces:
|
||||||
- name: pulse
|
- name: pulse
|
||||||
|
|||||||
@ -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" {
|
resource "yandex_mdb_postgresql_user" "this" {
|
||||||
for_each = local.databases_map
|
for_each = local.databases_map
|
||||||
|
|
||||||
|
|||||||
@ -3,7 +3,7 @@ output "databases" {
|
|||||||
value = {
|
value = {
|
||||||
for key, db in local.databases_map : key => {
|
for key, db in local.databases_map : key => {
|
||||||
cluster_id = db.cluster_id
|
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
|
port = 6432
|
||||||
database_name = yandex_mdb_postgresql_database.this[key].name
|
database_name = yandex_mdb_postgresql_database.this[key].name
|
||||||
user_name = yandex_mdb_postgresql_user.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)"
|
description = "Map for secrets module (cluster_id:db_name:user_name => credentials)"
|
||||||
value = {
|
value = {
|
||||||
for key, db in local.databases_map : key => {
|
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
|
database_name = yandex_mdb_postgresql_database.this[key].name
|
||||||
user_name = yandex_mdb_postgresql_user.this[key].name
|
user_name = yandex_mdb_postgresql_user.this[key].name
|
||||||
password = random_password.user_password[key].result
|
password = random_password.user_password[key].result
|
||||||
|
|||||||
@ -4,6 +4,7 @@ variable "databases" {
|
|||||||
cluster_id = string
|
cluster_id = string
|
||||||
database = object({
|
database = object({
|
||||||
name = string
|
name = string
|
||||||
|
host = optional(string, "")
|
||||||
lc_collate = optional(string, "en_US.UTF-8")
|
lc_collate = optional(string, "en_US.UTF-8")
|
||||||
lc_type = optional(string, "en_US.UTF-8")
|
lc_type = optional(string, "en_US.UTF-8")
|
||||||
extensions = optional(list(string), [])
|
extensions = optional(list(string), [])
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user