terraform-contour-mirror/modules/kafka-topics-yc/outputs.tf
2026-07-07 17:10:06 +03:00

29 lines
1.6 KiB
HCL

output "topic_names" {
description = "Kafka topics managed by this service manifest state."
value = keys(yandex_mdb_kafka_topic.this)
}
output "user_names" {
description = "Kafka users managed by this service manifest state."
value = [for user in yandex_mdb_kafka_user.this : user.name]
}
output "kafka_outputs_map" {
description = "Map for k8s-secret module. Key format: clusterRef:user."
value = {
for key, item in local.user_clusters : key => {
host = try(var.kafka_cluster_refs[item.cluster_ref].host, "")
hostname = try(format("%s:%s", var.kafka_cluster_refs[item.cluster_ref].host, tostring(var.kafka_cluster_refs[item.cluster_ref].port)), "")
port = tostring(try(var.kafka_cluster_refs[item.cluster_ref].port, 9091))
username = item.user
password = try(random_password.kafka_user[key].result, "")
sasl_mechanism = try(var.kafka_cluster_refs[item.cluster_ref].sasl_mechanism, "SCRAM-SHA-512")
security_protocol = try(var.kafka_cluster_refs[item.cluster_ref].security_protocol, "SASL_SSL")
bootstrap_server = try(format("%s:%s", var.kafka_cluster_refs[item.cluster_ref].host, tostring(var.kafka_cluster_refs[item.cluster_ref].port)), "")
bootstrap_servers = try(format("%s:%s", var.kafka_cluster_refs[item.cluster_ref].host, tostring(var.kafka_cluster_refs[item.cluster_ref].port)), "")
bootstrap_servers_json = try(jsonencode([format("%s:%s", var.kafka_cluster_refs[item.cluster_ref].host, tostring(var.kafka_cluster_refs[item.cluster_ref].port))]), "[]")
}
}
sensitive = true
}