From 525a0cd6dc215b4aff58e4d5a190b6cfc8e8368d Mon Sep 17 00:00:00 2001 From: Harshini Rangaswamy Date: Wed, 13 Nov 2024 17:47:57 +0100 Subject: [PATCH 1/5] add: Exactly-once delivery for MM2 --- .../howto/exactly-once-delivery.md | 135 ++++++++++++++++++ sidebars.ts | 1 + src/components/ConsoleIcons/index.tsx | 8 ++ 3 files changed, 144 insertions(+) create mode 100644 docs/products/kafka/kafka-mirrormaker/howto/exactly-once-delivery.md diff --git a/docs/products/kafka/kafka-mirrormaker/howto/exactly-once-delivery.md b/docs/products/kafka/kafka-mirrormaker/howto/exactly-once-delivery.md new file mode 100644 index 000000000..be52b7899 --- /dev/null +++ b/docs/products/kafka/kafka-mirrormaker/howto/exactly-once-delivery.md @@ -0,0 +1,135 @@ +--- +title: Exactly-once delivery in Aiven for Apache Kafka MirrorMaker 2 +sidebar_label: Exactly-once delivery +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; +import ConsoleLabel from "@site/src/components/ConsoleIcons" +import ConsoleIcon from "@site/src/components/ConsoleIcons" + +Exactly-once delivery in Aiven for Apache Kafka MirrorMaker 2 replicates each message exactly once between clusters, preventing duplicates or data loss. + + +## Exactly-once delivery semantics + +Exactly-once delivery semantics provide a transactional guarantee for message +replication, ensuring that all messages in a batch are either fully committed to the +target cluster or not replicated at all. This maintains data consistency across clusters. + + +:::note +By default, exactly-once delivery operates without requiring ACL modifications. If no +ACLs are configured for the `TransactionalId` resource, exactly-once delivery functions +as expected. However, in external Apache Kafka setups where ACLs are applied to +the `TransactionalId` resource, these ACLs may block exactly-once delivery. Review and +adjust ACLs as needed to enable transactions for exactly-once delivery. +::: + +## Prerequisites + +- Aiven for Apache Kafka service with Aiven for Apache Kafka MirrorMaker 2 integration. +- Permission to create or modify replication flows. + +## Enable or disable exactly-once delivery + + + + +1. In the [Aiven console](https://console.aiven.io/), open your Aiven for Apache Kafka + service with the Aiven for Apache Kafka MirrorMaker 2 integration. +1. Click . +1. Click the Aiven for Apache Kafka MirrorMaker 2 integration. +1. Click in the sidebar. + - To create a new flow, click **Create replication flow** . + - To modify an existing flow, select . +1. Toggle **Exactly-once message delivery enabled** to enable or disable + exactly-once delivery. +1. Click **Create** or **Save**. + + + + +- To enable exactly-once delivery on a new replication flow: + + ```bash + avn mirrormaker replication-flow create \ + --source-cluster \ + --target-cluster \ + --replication_flow_config '{ "exactly_once_delivery_enabled": true }' + ``` + +- To enable exactly-once delivery on an existing replication flow: + + ```bash + avn mirrormaker replication-flow update \ + --source-cluster \ + --target-cluster \ + --replication_flow_config '{ "exactly_once_delivery_enabled": true }' + ``` + +- To disable exactly-once delivery on an existing replication flow: + + ```bash + avn mirrormaker replication-flow update \ + --source-cluster \ + --target-cluster \ + --replication_flow_config '{ "exactly_once_delivery_enabled": false }' + ``` + +Parameters: + +- ``: Name of your Aiven for Apache Kafka MirrorMaker 2 service. +- ``: Alias of the source Aiven for Apache Kafka cluster. +- ``: Alias of the target Aiven for Apache Kafka cluster. +- `exactly_once_delivery_enabled`: Set to `true` to enable exactly-once delivery. + + + + + +Use the +[ServiceKafkaMirrorMakerCreateReplicationFlow](https://api.aiven.io/doc/#tag/Service:_Kafka_MirrorMaker/operation/ServiceKafkaMirrorMakerCreateReplicationFlow) +API to create or update the replication flow by setting `exactly_once_delivery_enabled` +in the configuration. + +- Example API request to create a new flow with exactly-once delivery enabled: + + ```json + POST /v1/project//service//mirrormaker/replication-flows + { + "source_cluster": "", + "target_cluster": "", + "enabled": true, + "exactly_once_delivery_enabled": true + } + ``` + +- Example API request to update an existing flow to enable exactly-once delivery: + + ```json + PUT /v1/project//service//mirrormaker/replication-flows// + { + "exactly_once_delivery_enabled": true + } + ``` + +- Example API request to update an existing flow to disable exactly-once delivery: + + ```json + PUT /v1/project//service//mirrormaker/replication-flows// + { + "exactly_once_delivery_enabled": false + } + ``` + +Parameters: + +- ``: Name of your project. +- ``: Name of your Aiven for Apache Kafka MirrorMaker 2 service. +- ``: Alias of the source Aiven for Apache Kafka cluster. +- ``: Alias of the target Aiven for Apache Kafka cluster. +- `exactly_once_delivery_enabled`: Set to `true` to enable exactly-once delivery. + + + diff --git a/sidebars.ts b/sidebars.ts index fd17ab4d8..6198cb5c5 100644 --- a/sidebars.ts +++ b/sidebars.ts @@ -1060,6 +1060,7 @@ const sidebars: SidebarsConfig = { 'products/kafka/kafka-mirrormaker/howto/remove-mirrormaker-prefix', 'products/kafka/kafka-mirrormaker/howto/datadog-customised-metrics', 'products/kafka/kafka-mirrormaker/howto/log-analysis-offset-sync-tool', + 'products/kafka/kafka-mirrormaker/howto/exactly-once-delivery', ], }, { diff --git a/src/components/ConsoleIcons/index.tsx b/src/components/ConsoleIcons/index.tsx index 8f35521a3..bc893d786 100644 --- a/src/components/ConsoleIcons/index.tsx +++ b/src/components/ConsoleIcons/index.tsx @@ -500,6 +500,14 @@ export default function ConsoleLabel({name}): ReactElement { Query editor ); + case 'replicationflow': + return ( + <> + + Replication flow + + ); + default: return ( From 5cac60a1cb81df2b68beaee15a518e5ba5ab4184 Mon Sep 17 00:00:00 2001 From: Harshini Rangaswamy Date: Thu, 21 Nov 2024 13:26:43 +0100 Subject: [PATCH 2/5] add: Terraform content and minor changes --- .../howto/exactly-once-delivery.md | 195 ++++++++++++++---- 1 file changed, 153 insertions(+), 42 deletions(-) diff --git a/docs/products/kafka/kafka-mirrormaker/howto/exactly-once-delivery.md b/docs/products/kafka/kafka-mirrormaker/howto/exactly-once-delivery.md index be52b7899..4ab48de64 100644 --- a/docs/products/kafka/kafka-mirrormaker/howto/exactly-once-delivery.md +++ b/docs/products/kafka/kafka-mirrormaker/howto/exactly-once-delivery.md @@ -10,7 +10,6 @@ import ConsoleIcon from "@site/src/components/ConsoleIcons" Exactly-once delivery in Aiven for Apache Kafka MirrorMaker 2 replicates each message exactly once between clusters, preventing duplicates or data loss. - ## Exactly-once delivery semantics Exactly-once delivery semantics provide a transactional guarantee for message @@ -19,17 +18,21 @@ target cluster or not replicated at all. This maintains data consistency across :::note -By default, exactly-once delivery operates without requiring ACL modifications. If no -ACLs are configured for the `TransactionalId` resource, exactly-once delivery functions -as expected. However, in external Apache Kafka setups where ACLs are applied to -the `TransactionalId` resource, these ACLs may block exactly-once delivery. Review and -adjust ACLs as needed to enable transactions for exactly-once delivery. +Exactly-once delivery does not require ACL modifications by default. However, in +external Apache Kafka setups where ACLs are applied to the `TransactionalId` resource, +review and adjust these ACLs as needed to enable exactly-once delivery. ::: ## Prerequisites -- Aiven for Apache Kafka service with Aiven for Apache Kafka MirrorMaker 2 integration. -- Permission to create or modify replication flows. +- Aiven for Apache Kafka service with [Aiven for Apache Kafka MirrorMaker 2 integration + enabled](/docs/products/kafka/kafka-mirrormaker/get-started) +- Access to [create or modify replication flows](/docs/products/kafka/kafka-mirrormaker/howto/setup-replication-flow) +- Access to one of the following, depending on your preferred method: + - [Aiven Console](https://console.aiven.io/) + - [Aiven CLI](/docs/tools/cli) + - [Aiven Terraform Provider](https://registry.terraform.io/providers/aiven/aiven/latest/docs) + - [Aiven API](https://api.aiven.io/) ## Enable or disable exactly-once delivery @@ -43,14 +46,14 @@ adjust ACLs as needed to enable transactions for exactly-once delivery. 1. Click in the sidebar. - To create a new flow, click **Create replication flow** . - To modify an existing flow, select . -1. Toggle **Exactly-once message delivery enabled** to enable or disable - exactly-once delivery. +1. Set **Exactly-once message delivery enabled** to **Enabled** to turn it on or + **Disabled** to turn it off. 1. Click **Create** or **Save**. -- To enable exactly-once delivery on a new replication flow: +- Create a new replication flow with exactly-once delivery enabled: ```bash avn mirrormaker replication-flow create \ @@ -59,7 +62,7 @@ adjust ACLs as needed to enable transactions for exactly-once delivery. --replication_flow_config '{ "exactly_once_delivery_enabled": true }' ``` -- To enable exactly-once delivery on an existing replication flow: +- Enable exactly-once delivery on an existing replication flow: ```bash avn mirrormaker replication-flow update \ @@ -68,7 +71,7 @@ adjust ACLs as needed to enable transactions for exactly-once delivery. --replication_flow_config '{ "exactly_once_delivery_enabled": true }' ``` -- To disable exactly-once delivery on an existing replication flow: +- Disable exactly-once delivery on an existing replication flow: ```bash avn mirrormaker replication-flow update \ @@ -82,54 +85,162 @@ Parameters: - ``: Name of your Aiven for Apache Kafka MirrorMaker 2 service. - ``: Alias of the source Aiven for Apache Kafka cluster. - ``: Alias of the target Aiven for Apache Kafka cluster. -- `exactly_once_delivery_enabled`: Set to `true` to enable exactly-once delivery. +- `exactly_once_delivery_enabled`: Set to `true` to enable or `false` to disable + exactly-once delivery. -Use the -[ServiceKafkaMirrorMakerCreateReplicationFlow](https://api.aiven.io/doc/#tag/Service:_Kafka_MirrorMaker/operation/ServiceKafkaMirrorMakerCreateReplicationFlow) -API to create or update the replication flow by setting `exactly_once_delivery_enabled` -in the configuration. - -- Example API request to create a new flow with exactly-once delivery enabled: - - ```json - POST /v1/project//service//mirrormaker/replication-flows - { - "source_cluster": "", - "target_cluster": "", - "enabled": true, - "exactly_once_delivery_enabled": true - } +Use the [ServiceKafkaMirrorMakerCreateReplicationFlow](https://api.aiven.io/doc/#tag/Service:_Kafka_MirrorMaker/operation/ServiceKafkaMirrorMakerCreateReplicationFlow) API to create or update a replication flow +with `exactly_once_delivery_enabled` in the configuration. + +- Create a new replication flow with exactly-once delivery enabled: + + ```bash + curl -X POST "https://console.aiven.io/v1/project//service//mirrormaker/replication-flows" \ + -H "Authorization: Bearer " \ + -H "Content-Type: application/json" \ + -d '{ + "source_cluster": "", + "target_cluster": "", + "enabled": true, + "exactly_once_delivery_enabled": true + }' ``` -- Example API request to update an existing flow to enable exactly-once delivery: +- Update an existing replication flow to enable exactly-once delivery: - ```json - PUT /v1/project//service//mirrormaker/replication-flows// - { - "exactly_once_delivery_enabled": true - } + ```bash + curl -X PUT "https://console.aiven.io/v1/project//service//mirrormaker/replication-flows//" \ + -H "Authorization: Bearer " \ + -H "Content-Type: application/json" \ + -d '{ + "exactly_once_delivery_enabled": true + }' ``` -- Example API request to update an existing flow to disable exactly-once delivery: +- Update an existing replication flow to disable exactly-once delivery: - ```json - PUT /v1/project//service//mirrormaker/replication-flows// - { - "exactly_once_delivery_enabled": false - } + ```bash + curl -X PUT "https://console.aiven.io/v1/project//service//mirrormaker/replication-flows//" \ + -H "Authorization: Bearer " \ + -H "Content-Type: application/json" \ + -d '{ + "exactly_once_delivery_enabled": false + }' ``` Parameters: - ``: Name of your project. - ``: Name of your Aiven for Apache Kafka MirrorMaker 2 service. +- `API_TOKEN`: Your personal Aiven API [token](/docs/platform/howto/create_authentication_token). - ``: Alias of the source Aiven for Apache Kafka cluster. - ``: Alias of the target Aiven for Apache Kafka cluster. -- `exactly_once_delivery_enabled`: Set to `true` to enable exactly-once delivery. +- `exactly_once_delivery_enabled`: Set to `true` to enable or `false` to disable + exactly-once delivery. + + + + +1. Create or modify the `main.tf` file for your Aiven for Apache Kafka MirrorMaker 2 + replication flow. + + ```hcl + terraform { + required_providers { + aiven = { + source = "aiven/aiven" + version = ">=4.0.0, < 5.0.0" + } + } + } + + provider "aiven" { + api_token = var.aiven_api_token + } + + resource "aiven_mirrormaker_replication_flow" "replication_flow" { + project = var.project_name + service_name = var.service_name + source_cluster = var.source_cluster + target_cluster = var.target_cluster + + replication_flow_config = jsonencode({ + "exactly_once_delivery_enabled" = var.exactly_once_delivery_enabled + }) + + topics = [ + ".*" + ] + } + ``` + +1. Declare variables in a `variables.tf` file: + + ```hcl + variable "aiven_api_token" { + description = "Aiven API token" + type = string + } + + variable "project_name" { + description = "Name of your Aiven project" + type = string + } + + variable "service_name" { + description = "Name of your Aiven for Apache Kafka MirrorMaker 2 service" + type = string + } + + variable "source_cluster" { + description = "Alias of the source Kafka cluster" + type = string + } + + variable "target_cluster" { + description = "Alias of the target Kafka cluster" + type = string + } + + variable "exactly_once_delivery_enabled" { + description = "Enable or disable exactly-once delivery" + type = bool + default = false + } + ``` + +1. Provide variable values in a `terraform.tfvars` file: + + ```hcl + aiven_api_token = "YOUR_AIVEN_API_TOKEN" + project_name = "YOUR_PROJECT_NAME" + service_name = "YOUR_SERVICE_NAME" + source_cluster = "YOUR_SOURCE_CLUSTER" + target_cluster = "YOUR_TARGET_CLUSTER" + exactly_once_delivery_enabled = true + ``` + +1. Run Terraform commands to apply the configuration: + + ```bash + terraform init + terraform plan + terraform apply + ``` + +Parameters + +- `aiven_api_token`: API token for authentication with Aiven. +- `project_name`: Name of your Aiven project. +- `service_name`: Name of your Aiven for Apache Kafka MirrorMaker 2 service. +- `source_cluster`: Alias of the source Kafka cluster. +- `target_cluster`: Alias of the target Kafka cluster. +- `exactly_once_delivery_enabled`:Set to `true` to enable or `false` to disable + exactly-once delivery. +- `topics`: Pattern defining which topics to replicate (default: `.*` for all topics). From c71e339d22f26868044e40f2b884fd7d86d4f62c Mon Sep 17 00:00:00 2001 From: Harshini Rangaswamy Date: Thu, 21 Nov 2024 18:13:33 +0100 Subject: [PATCH 3/5] fix: simplify example --- .../howto/exactly-once-delivery.md | 76 +++++-------------- 1 file changed, 21 insertions(+), 55 deletions(-) diff --git a/docs/products/kafka/kafka-mirrormaker/howto/exactly-once-delivery.md b/docs/products/kafka/kafka-mirrormaker/howto/exactly-once-delivery.md index 4ab48de64..35578d1b0 100644 --- a/docs/products/kafka/kafka-mirrormaker/howto/exactly-once-delivery.md +++ b/docs/products/kafka/kafka-mirrormaker/howto/exactly-once-delivery.md @@ -144,15 +144,21 @@ Parameters: -1. Create or modify the `main.tf` file for your Aiven for Apache Kafka MirrorMaker 2 - replication flow. +Find information about the `aiven_mirrormaker_replication_flow` resource in the +[Aiven Provider for TerraformĀ® documentation](https://registry.terraform.io/providers/aiven/aiven/latest/docs/resources/mirrormaker_replication_flow). + +1. Update or create the `aiven_mirrormaker_replication_flow` resource in your + Terraform configuration file (for example, `main.tf`): + + - Add `replication_flow_config = { "exactly_once_delivery_enabled" = true }`. + - Specify the `topics` to replicate using patterns, such as `.*` for all topics. ```hcl terraform { required_providers { aiven = { source = "aiven/aiven" - version = ">=4.0.0, < 5.0.0" + version = ">=4.0.0, <5.0.0" } } } @@ -161,69 +167,28 @@ Parameters: api_token = var.aiven_api_token } - resource "aiven_mirrormaker_replication_flow" "replication_flow" { + resource "aiven_mirrormaker_replication_flow" "example_flow" { project = var.project_name service_name = var.service_name source_cluster = var.source_cluster target_cluster = var.target_cluster + enable = true - replication_flow_config = jsonencode({ - "exactly_once_delivery_enabled" = var.exactly_once_delivery_enabled - }) + replication_flow_config = { + "exactly_once_delivery_enabled" = true + } topics = [ ".*" ] } - ``` - -1. Declare variables in a `variables.tf` file: - - ```hcl - variable "aiven_api_token" { - description = "Aiven API token" - type = string - } - - variable "project_name" { - description = "Name of your Aiven project" - type = string - } - - variable "service_name" { - description = "Name of your Aiven for Apache Kafka MirrorMaker 2 service" - type = string - } - - variable "source_cluster" { - description = "Alias of the source Kafka cluster" - type = string - } - variable "target_cluster" { - description = "Alias of the target Kafka cluster" - type = string - } - - variable "exactly_once_delivery_enabled" { - description = "Enable or disable exactly-once delivery" - type = bool - default = false + output "replication_flow_status" { + value = aiven_mirrormaker_replication_flow.example_flow.state } ``` -1. Provide variable values in a `terraform.tfvars` file: - - ```hcl - aiven_api_token = "YOUR_AIVEN_API_TOKEN" - project_name = "YOUR_PROJECT_NAME" - service_name = "YOUR_SERVICE_NAME" - source_cluster = "YOUR_SOURCE_CLUSTER" - target_cluster = "YOUR_TARGET_CLUSTER" - exactly_once_delivery_enabled = true - ``` - -1. Run Terraform commands to apply the configuration: +1. Run the Terraform commands to apply the configuration: ```bash terraform init @@ -236,11 +201,12 @@ Parameters - `aiven_api_token`: API token for authentication with Aiven. - `project_name`: Name of your Aiven project. - `service_name`: Name of your Aiven for Apache Kafka MirrorMaker 2 service. -- `source_cluster`: Alias of the source Kafka cluster. -- `target_cluster`: Alias of the target Kafka cluster. -- `exactly_once_delivery_enabled`:Set to `true` to enable or `false` to disable +- `source_cluster`: Alias of the source Aiven for Apache Kafka service. +- `target_cluster`: Alias of the target Aiven for Apache Kafka service. +- `exactly_once_delivery_enabled`: Set to `true` to enable or `false` to disable exactly-once delivery. - `topics`: Pattern defining which topics to replicate (default: `.*` for all topics). + From 16f89fe89f9e9928dd08ccb047fc656ae97223fc Mon Sep 17 00:00:00 2001 From: Harshini Rangaswamy Date: Mon, 2 Dec 2024 14:57:15 +0100 Subject: [PATCH 4/5] fix: resource block --- .../howto/exactly-once-delivery.md | 47 +++++-------------- 1 file changed, 13 insertions(+), 34 deletions(-) diff --git a/docs/products/kafka/kafka-mirrormaker/howto/exactly-once-delivery.md b/docs/products/kafka/kafka-mirrormaker/howto/exactly-once-delivery.md index 35578d1b0..542b3a590 100644 --- a/docs/products/kafka/kafka-mirrormaker/howto/exactly-once-delivery.md +++ b/docs/products/kafka/kafka-mirrormaker/howto/exactly-once-delivery.md @@ -147,44 +147,23 @@ Parameters: Find information about the `aiven_mirrormaker_replication_flow` resource in the [Aiven Provider for TerraformĀ® documentation](https://registry.terraform.io/providers/aiven/aiven/latest/docs/resources/mirrormaker_replication_flow). +To enable exactly-once delivery: + 1. Update or create the `aiven_mirrormaker_replication_flow` resource in your - Terraform configuration file (for example, `main.tf`): + Terraform configuration file: - - Add `replication_flow_config = { "exactly_once_delivery_enabled" = true }`. + - Add `exactly_once_delivery_enabled = true` to the resource block. - Specify the `topics` to replicate using patterns, such as `.*` for all topics. ```hcl - terraform { - required_providers { - aiven = { - source = "aiven/aiven" - version = ">=4.0.0, <5.0.0" - } - } - } - - provider "aiven" { - api_token = var.aiven_api_token - } - resource "aiven_mirrormaker_replication_flow" "example_flow" { - project = var.project_name - service_name = var.service_name - source_cluster = var.source_cluster - target_cluster = var.target_cluster - enable = true - - replication_flow_config = { - "exactly_once_delivery_enabled" = true - } - - topics = [ - ".*" - ] - } - - output "replication_flow_status" { - value = aiven_mirrormaker_replication_flow.example_flow.state + project = var.project_name + service_name = var.service_name + source_cluster = var.source_cluster + target_cluster = var.target_cluster + enable = true + exactly_once_delivery_enabled = true + topics = [".*"] } ``` @@ -205,8 +184,8 @@ Parameters - `target_cluster`: Alias of the target Aiven for Apache Kafka service. - `exactly_once_delivery_enabled`: Set to `true` to enable or `false` to disable exactly-once delivery. -- `topics`: Pattern defining which topics to replicate (default: `.*` for all topics). - +- `topics`: Pattern to define which topics to replicate. The default value, `.*`, + replicates all topics. From 6c0cc7045a81cb52e7588e93640cff5d407abcb1 Mon Sep 17 00:00:00 2001 From: Harshini Rangaswamy Date: Tue, 10 Dec 2024 09:05:59 +0100 Subject: [PATCH 5/5] update: address feedback --- .../howto/exactly-once-delivery.md | 47 ++++++++++--------- 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/docs/products/kafka/kafka-mirrormaker/howto/exactly-once-delivery.md b/docs/products/kafka/kafka-mirrormaker/howto/exactly-once-delivery.md index 542b3a590..9858d73bc 100644 --- a/docs/products/kafka/kafka-mirrormaker/howto/exactly-once-delivery.md +++ b/docs/products/kafka/kafka-mirrormaker/howto/exactly-once-delivery.md @@ -39,7 +39,7 @@ review and adjust these ACLs as needed to enable exactly-once delivery. -1. In the [Aiven console](https://console.aiven.io/), open your Aiven for Apache Kafka +1. In the [Aiven Console](https://console.aiven.io/), open your Aiven for Apache Kafka service with the Aiven for Apache Kafka MirrorMaker 2 integration. 1. Click . 1. Click the Aiven for Apache Kafka MirrorMaker 2 integration. @@ -82,10 +82,10 @@ review and adjust these ACLs as needed to enable exactly-once delivery. Parameters: -- ``: Name of your Aiven for Apache Kafka MirrorMaker 2 service. -- ``: Alias of the source Aiven for Apache Kafka cluster. -- ``: Alias of the target Aiven for Apache Kafka cluster. -- `exactly_once_delivery_enabled`: Set to `true` to enable or `false` to disable +- `SERVICE_NAME`: Name of your Aiven for Apache Kafka MirrorMaker 2 service. +- `SOURCE_CLUSTER`: Alias of the source Aiven for Apache Kafka cluster. +- `TARGET_CLUSTER`: Alias of the target Aiven for Apache Kafka cluster. +- `EXACTLY_ONCE_DELIVERY_ENABLED`: Set to `true` to enable or `false` to disable exactly-once delivery. @@ -133,19 +133,20 @@ with `exactly_once_delivery_enabled` in the configuration. Parameters: -- ``: Name of your project. -- ``: Name of your Aiven for Apache Kafka MirrorMaker 2 service. -- `API_TOKEN`: Your personal Aiven API [token](/docs/platform/howto/create_authentication_token). -- ``: Alias of the source Aiven for Apache Kafka cluster. -- ``: Alias of the target Aiven for Apache Kafka cluster. -- `exactly_once_delivery_enabled`: Set to `true` to enable or `false` to disable +- `PROJECT_NAME`: Name of your project. +- `SERVICE_NAME`: Name of your Aiven for Apache Kafka MirrorMaker 2 service. +- `API_TOKEN`: Your personal Aiven API + [token](/docs/platform/howto/create_authentication_token). +- `SOURCE_CLUSTER`: Alias of the source Aiven for Apache Kafka cluster. +- `TARGET_CLUSTER`: Alias of the target Aiven for Apache Kafka cluster. +- `EXACTLY_ONCE_DELIVERY_ENABLED`: Set to `true` to enable or `false` to disable exactly-once delivery. Find information about the `aiven_mirrormaker_replication_flow` resource in the -[Aiven Provider for TerraformĀ® documentation](https://registry.terraform.io/providers/aiven/aiven/latest/docs/resources/mirrormaker_replication_flow). +[Aiven Provider for Terraform documentation](https://registry.terraform.io/providers/aiven/aiven/latest/docs/resources/mirrormaker_replication_flow). To enable exactly-once delivery: @@ -157,14 +158,15 @@ To enable exactly-once delivery: ```hcl resource "aiven_mirrormaker_replication_flow" "example_flow" { - project = var.project_name - service_name = var.service_name - source_cluster = var.source_cluster - target_cluster = var.target_cluster + project = "PROJECT_NAME" + service_name = "SERVICE_NAME" + source_cluster = "SOURCE_CLUSTER" + target_cluster = "TARGET_CLUSTER" enable = true exactly_once_delivery_enabled = true topics = [".*"] } + ``` 1. Run the Terraform commands to apply the configuration: @@ -177,14 +179,13 @@ To enable exactly-once delivery: Parameters -- `aiven_api_token`: API token for authentication with Aiven. -- `project_name`: Name of your Aiven project. -- `service_name`: Name of your Aiven for Apache Kafka MirrorMaker 2 service. -- `source_cluster`: Alias of the source Aiven for Apache Kafka service. -- `target_cluster`: Alias of the target Aiven for Apache Kafka service. -- `exactly_once_delivery_enabled`: Set to `true` to enable or `false` to disable +- `PROJECT_NAME`: Name of your Aiven project. +- `SERVICE_NAME`: Name of your Aiven for Apache Kafka MirrorMaker 2 service. +- `SOURCE_CLUSTER`: Alias of the source Aiven for Apache Kafka service. +- `TARGET_CLUSTER`: Alias of the target Aiven for Apache Kafka service. +- `EXACTLY_ONCE_DELIVERY_ENABLED`: Set to `true` to enable or `false` to disable exactly-once delivery. -- `topics`: Pattern to define which topics to replicate. The default value, `.*`, +- `TOPICS`: Pattern to define which topics to replicate. The default value, `.*`, replicates all topics.