-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cecf6e8
commit bf07ee5
Showing
3 changed files
with
108 additions
and
0 deletions.
There are no files selected for viewing
66 changes: 66 additions & 0 deletions
66
solutions/mm2-migration-external-k8s-kafka/infra-integration-setup/main.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
resource "aiven_kafka_mirrormaker" "mm2" { | ||
project = var.aiven_project_name | ||
cloud_name = var.cloud_name_primary | ||
plan = var.mm2_plan | ||
service_name = "${var.service_prefix}-mm2" | ||
|
||
/*kafka_mirrormaker_user_config { | ||
ip_filter = ["0.0.0.0/0"] | ||
} */ | ||
|
||
kafka_mirrormaker_user_config { | ||
kafka_mirrormaker { | ||
refresh_groups_enabled = true | ||
refresh_groups_interval_seconds = 10 | ||
refresh_topics_enabled = true | ||
refresh_topics_interval_seconds = 60 | ||
sync_group_offsets_enabled = true | ||
sync_group_offsets_interval_seconds = 10 | ||
sync_topic_configs_enabled = true | ||
tasks_max_per_cpu = 2 | ||
emit_checkpoints_enabled = true | ||
emit_checkpoints_interval_seconds = 10 | ||
offset_lag_max = 0 | ||
} | ||
} | ||
} | ||
/* | ||
resource "time_sleep" "wait_mm2_readiness" { | ||
depends_on = [ | ||
aiven_kafka_mirrormaker.mm2 | ||
] | ||
create_duration = "360s" | ||
} | ||
// Strimzi Kafka External Endpoint as a pre-req to create service integration for mm2 | ||
resource "aiven_service_integration_endpoint" "strimzi_external_endpoint" | ||
{ | ||
depends_on = [time_sleep.wait_mm2_readiness] | ||
endpoint_name = "strimzi_kafka_source_endpoint" | ||
project = var.aiven_project_name | ||
endpoint_type = "external_kafka" | ||
external_kafka_user_config { | ||
bootstrap_servers = var.strimzi_bootstrap_url | ||
security_protocol = "PLAINTEXT" | ||
} | ||
} | ||
//////---------- | ||
// AIVEN KAFKA EXTERNAL ENDPOINT for allowing more than 1 destination service integration for more than 1 replication flows | ||
//// ---------- | ||
resource "aiven_service_integration_endpoint" "aiven_kafka_destination_endpoint" | ||
{ | ||
depends_on = [time_sleep.wait_mm2_readiness] | ||
endpoint_name = "aiven_kafka_destination_endpoint" | ||
project = var.aiven_project_name | ||
endpoint_type = "external_kafka" | ||
external_kafka_user_config { | ||
bootstrap_servers = data.aiven_kafka.kafka_source.service_uri | ||
security_protocol = "SSL" | ||
ssl_ca_cert = data.aiven_project.source_project.ca_cert | ||
ssl_client_key = data.aiven_kafka.kafka_source.kafka[0].access_key | ||
ssl_client_cert = data.aiven_kafka.kafka_source.kafka[0].access_cert | ||
ssl_endpoint_identification_algorithm = "https" | ||
} | ||
} | ||
*/ |
16 changes: 16 additions & 0 deletions
16
solutions/mm2-migration-external-k8s-kafka/infra-integration-setup/provider.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
terraform { | ||
required_providers { | ||
aiven = { | ||
source = "aiven/aiven" | ||
version = "4.19.1" | ||
} | ||
time = { | ||
source = "hashicorp/time" | ||
version = "0.7.2" | ||
} | ||
} | ||
} | ||
|
||
provider "aiven" { | ||
api_token = var.aiven_api_token | ||
} |
26 changes: 26 additions & 0 deletions
26
solutions/mm2-migration-external-k8s-kafka/infra-integration-setup/variables.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
variable "aiven_api_token" { | ||
description = "Aiven API token" | ||
type = string | ||
} | ||
|
||
variable "aiven_project_name" { | ||
type = string | ||
} | ||
variable "service_prefix" { | ||
type = string | ||
} | ||
variable "cloud_name_primary" { | ||
type = string | ||
} | ||
|
||
variable "mm2_plan" { | ||
type = string | ||
} | ||
|
||
variable "strimzi_bootstrap_url" { | ||
type = string | ||
} | ||
|
||
variable "aiven_kafka_bootstrap_url" { | ||
type = string | ||
} |