Skip to content

Commit

Permalink
fix: remove connector name from init module
Browse files Browse the repository at this point in the history
  • Loading branch information
upendra-vedullapalli committed Oct 20, 2022
1 parent 06d4391 commit 2cb453f
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 29 deletions.
9 changes: 4 additions & 5 deletions examples/init/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@ module "init" {
# This is an example only; if you're adding this block to a live configuration,
# make sure to use the latest release of the init module, found here:
# https://github.com/entur/terraform-aiven-kafka-connect-init/releases
source = "github.com/entur/terraform-aiven-kafka-connect-init//modules/init?ref=v1.1.1"
access_token = var.api_token
project_name = "my-aiven-project-name"
service_name = "my-aiven-service-name"
connector_name = "my-connector-name"
source = "github.com/entur/terraform-aiven-kafka-connect-init//modules/init?ref=v1.1.1"
access_token = var.api_token
project_name = "my-aiven-project-name"
service_name = "my-aiven-service-name"
}

# ci: x-release-please-end
9 changes: 4 additions & 5 deletions examples/init_test/main.tf
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
variable "api_token" {}
module "init" {
source = "../../modules/init"
access_token = var.api_token
project_name = "my-aiven-project-name"
service_name = "my-aiven-service-name"
connector_name = "my-connector-name"
source = "../../modules/init"
access_token = var.api_token
project_name = "my-aiven-project-name"
service_name = "my-aiven-service-name"
}
10 changes: 4 additions & 6 deletions modules/init/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,16 @@ data "aiven_kafka_user" "kafka_admin" {
}

locals {
access_token = var.access_token
connector = {
name = var.connector_name
project = data.aiven_project.entur-aiven-project.project
service = var.service_name
aiven = {
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}"
}
default_configuration = {
"name" : var.connector_name
"tasks.max" : var.tasks_max,
"key.converter" : var.key_converter,
"value.converter" : var.value_converter,
Expand Down
11 changes: 3 additions & 8 deletions modules/init/outputs.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
output "connector" {
description = "Description of connector resources(name, project, service etc)"
value = local.connector
output "aiven" {
description = "Aiven configuration like (project, service etc)"
value = local.aiven
}

output "schema_registry" {
Expand All @@ -12,8 +12,3 @@ output "default_configuration" {
description = "A map of default configuration options for any connector"
value = local.default_configuration
}

output "access_token" {
description = "Aiven API access token"
value = var.access_token
}
5 changes: 0 additions & 5 deletions modules/init/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@ variable "service_registry_username" {
default = "avnadmin"
}

variable "connector_name" {
type = string
description = "Unique name for this connector"
}

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"
Expand Down

0 comments on commit 2cb453f

Please sign in to comment.