From 1f7aa24dbdc3b4ab44bbd4f3ce6b7678b1602dc5 Mon Sep 17 00:00:00 2001 From: Upendra Vedullapalli Date: Sat, 25 Mar 2023 10:49:12 +0100 Subject: [PATCH] fix: move kafka user configuration out to child modules --- modules/init/main.tf | 18 ++++-------------- modules/init/outputs.tf | 5 ----- modules/init/variables.tf | 6 ------ 3 files changed, 4 insertions(+), 25 deletions(-) diff --git a/modules/init/main.tf b/modules/init/main.tf index ed9acc9..6246480 100644 --- a/modules/init/main.tf +++ b/modules/init/main.tf @@ -9,28 +9,18 @@ data "aiven_service_component" "schema-registry" { route = "dynamic" } -data "aiven_kafka_user" "kafka_admin" { - project = data.aiven_project.entur-aiven-project.project - service_name = var.service_name - username = var.service_registry_username -} - locals { aiven = { + access_token = var.access_token project = data.aiven_project.entur-aiven-project.project service = var.service_name - access_token = var.access_token - } - schema_registry = { - url = "https://${data.aiven_service_component.schema-registry.host}:${data.aiven_service_component.schema-registry.port}" - userinfo = "${data.aiven_kafka_user.kafka_admin.username}:${data.aiven_kafka_user.kafka_admin.password}" + schema_registry_url = "https://${data.aiven_service_component.schema-registry.host}:${data.aiven_service_component.schema-registry.port}" } default_configuration = { "tasks.max" : var.tasks_max, "key.converter" : var.key_converter, "value.converter" : var.value_converter, - "value.converter.schema.registry.url" : local.schema_registry.url, - "value.converter.basic.auth.credentials.source" : "USER_INFO", - "value.converter.schema.registry.basic.auth.user.info" : local.schema_registry.userinfo + "value.converter.schema.registry.url" : local.aiven.schema_registry_url, + "value.converter.basic.auth.credentials.source" : "USER_INFO" } } diff --git a/modules/init/outputs.tf b/modules/init/outputs.tf index 8b2aaa7..4674d24 100644 --- a/modules/init/outputs.tf +++ b/modules/init/outputs.tf @@ -3,11 +3,6 @@ output "aiven" { value = local.aiven } -output "schema_registry" { - description = "Details of Kafka schema registry component of Aiven Kafka service" - value = local.schema_registry -} - output "default_configuration" { description = "A map of default configuration options for any connector" value = local.default_configuration diff --git a/modules/init/variables.tf b/modules/init/variables.tf index 2fa91fd..6d01f2f 100644 --- a/modules/init/variables.tf +++ b/modules/init/variables.tf @@ -13,12 +13,6 @@ variable "service_name" { type = string } -variable "service_registry_username" { - description = "Aiven service registry username to connect to Kafka schema registry" - type = string - default = "avnadmin" -} - variable "tasks_max" { type = number description = "Maximum number of tasks that should be created for this connector. The connector may create fewer tasks if it cannot achieve this level of parallelism"