hashicorp / terraform-provider-aws

The AWS Provider enables Terraform to manage AWS resources.
https://registry.terraform.io/providers/hashicorp/aws
Mozilla Public License 2.0
9.82k stars 9.17k forks source link

[Enhancement]: Add TopicNameConfiguration argument under topic_replication block for msk replicator resource #39309

Open saravanan3916 opened 1 month ago

saravanan3916 commented 1 month ago

Description

AWS MSK replicator service has support to preserve the same topic name while the topic is replicated from source to target cluster with TopicNameConfiguration argument under topic_replication map. Without this argument, the replicator adds source cluster alias with the topic name. So, could you add this argument to keep the same topic name on both source and target cluster.

image

Affected Resource(s) and/or Data Source(s)

aws_msk_replicator https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/msk_replicator#argument-reference

Potential Terraform Configuration

resource "aws_msk_replicator" "test" {
  replicator_name            = "test-name"
  description                = "test-description"
  service_execution_role_arn = aws_iam_role.source.arn

  kafka_cluster {
    amazon_msk_cluster {
      msk_cluster_arn = aws_msk_cluster.source.arn
    }

    vpc_config {
      subnet_ids          = aws_subnet.source[*].id
      security_groups_ids = [aws_security_group.source.id]
    }
  }

  kafka_cluster {
    amazon_msk_cluster {
      msk_cluster_arn = aws_msk_cluster.target.arn
    }

    vpc_config {
      subnet_ids          = aws_subnet.target[*].id
      security_groups_ids = [aws_security_group.target.id]
    }
  }

  replication_info_list {
    source_kafka_cluster_arn = aws_msk_cluster.source.arn
    target_kafka_cluster_arn = aws_msk_cluster.target.arn
    target_compression_type  = "NONE"

    topic_replication {
      topics_to_replicate = [".*"]
      starting_position {
        type = "LATEST"
      }
      topic_name_configuation {
        type = "PREFIXED_WITH_SOURCE_CLUSTER_ALIAS"|"IDENTICAL"

    }

    consumer_group_replication {
      consumer_groups_to_replicate = [".*"]
    }
  }
}

References

AWS CLI reference for the arguments: https://docs.aws.amazon.com/cli/latest/reference/kafka/create-replicator.html#:~:text=replication%20starting%20position.-,TopicNameConfiguration,-%2D%3E%20(structure)

Would you like to implement a fix?

None

github-actions[bot] commented 1 month ago

Community Note

Voting for Prioritization

Volunteering to Work on This Issue