Replicator class
Resource for managing an AWS Managed Streaming for Kafka Replicator.
Example Usage
Basic Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const test = new aws.msk.Replicator("test", {
replicationInfoList: {
consumerGroupReplications: [{
consumerGroupsToReplicates: [".*"],
}],
topicReplications: [{
topicNameConfiguration: {
type: "PREFIXED_WITH_SOURCE_CLUSTER_ALIAS",
},
startingPosition: {
type: "LATEST",
},
topicsToReplicates: [".*"],
}],
sourceKafkaClusterArn: source.arn,
targetKafkaClusterArn: target.arn,
targetCompressionType: "NONE",
},
kafkaClusters: [
{
amazonMskCluster: {
mskClusterArn: source.arn,
},
vpcConfig: {
subnetIds: sourceAwsSubnet.map(__item => __item.id),
securityGroupsIds: [sourceAwsSecurityGroup.id],
},
},
{
amazonMskCluster: {
mskClusterArn: target.arn,
},
vpcConfig: {
subnetIds: targetAwsSubnet.map(__item => __item.id),
securityGroupsIds: [targetAwsSecurityGroup.id],
},
},
],
replicatorName: "test-name",
description: "test-description",
serviceExecutionRoleArn: sourceAwsIamRole.arn,
});
import pulumi
import pulumi_aws as aws
test = aws.msk.Replicator("test",
replication_info_list={
"consumer_group_replications": [{
"consumer_groups_to_replicates": [".*"],
}],
"topic_replications": [{
"topic_name_configuration": {
"type": "PREFIXED_WITH_SOURCE_CLUSTER_ALIAS",
},
"starting_position": {
"type": "LATEST",
},
"topics_to_replicates": [".*"],
}],
"source_kafka_cluster_arn": source["arn"],
"target_kafka_cluster_arn": target["arn"],
"target_compression_type": "NONE",
},
kafka_clusters=[
{
"amazon_msk_cluster": {
"msk_cluster_arn": source["arn"],
},
"vpc_config": {
"subnet_ids": [__item["id"] for __item in source_aws_subnet],
"security_groups_ids": [source_aws_security_group["id"]],
},
},
{
"amazon_msk_cluster": {
"msk_cluster_arn": target["arn"],
},
"vpc_config": {
"subnet_ids": [__item["id"] for __item in target_aws_subnet],
"security_groups_ids": [target_aws_security_group["id"]],
},
},
],
replicator_name="test-name",
description="test-description",
service_execution_role_arn=source_aws_iam_role["arn"])
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var test = new Aws.Msk.Replicator("test", new()
{
ReplicationInfoList = new Aws.Msk.Inputs.ReplicatorReplicationInfoListArgs
{
ConsumerGroupReplications = new[]
{
new Aws.Msk.Inputs.ReplicatorReplicationInfoListConsumerGroupReplicationArgs
{
ConsumerGroupsToReplicates = new[]
{
".*",
},
},
},
TopicReplications = new[]
{
new Aws.Msk.Inputs.ReplicatorReplicationInfoListTopicReplicationArgs
{
TopicNameConfiguration = new Aws.Msk.Inputs.ReplicatorReplicationInfoListTopicReplicationTopicNameConfigurationArgs
{
Type = "PREFIXED_WITH_SOURCE_CLUSTER_ALIAS",
},
StartingPosition = new Aws.Msk.Inputs.ReplicatorReplicationInfoListTopicReplicationStartingPositionArgs
{
Type = "LATEST",
},
TopicsToReplicates = new[]
{
".*",
},
},
},
SourceKafkaClusterArn = source.Arn,
TargetKafkaClusterArn = target.Arn,
TargetCompressionType = "NONE",
},
KafkaClusters = new[]
{
new Aws.Msk.Inputs.ReplicatorKafkaClusterArgs
{
AmazonMskCluster = new Aws.Msk.Inputs.ReplicatorKafkaClusterAmazonMskClusterArgs
{
MskClusterArn = source.Arn,
},
VpcConfig = new Aws.Msk.Inputs.ReplicatorKafkaClusterVpcConfigArgs
{
SubnetIds = sourceAwsSubnet.Select(__item => __item.Id).ToList(),
SecurityGroupsIds = new[]
{
sourceAwsSecurityGroup.Id,
},
},
},
new Aws.Msk.Inputs.ReplicatorKafkaClusterArgs
{
AmazonMskCluster = new Aws.Msk.Inputs.ReplicatorKafkaClusterAmazonMskClusterArgs
{
MskClusterArn = target.Arn,
},
VpcConfig = new Aws.Msk.Inputs.ReplicatorKafkaClusterVpcConfigArgs
{
SubnetIds = targetAwsSubnet.Select(__item => __item.Id).ToList(),
SecurityGroupsIds = new[]
{
targetAwsSecurityGroup.Id,
},
},
},
},
ReplicatorName = "test-name",
Description = "test-description",
ServiceExecutionRoleArn = sourceAwsIamRole.Arn,
});
});
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/msk"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := msk.NewReplicator(ctx, "test", &msk.ReplicatorArgs{
ReplicationInfoList: &msk.ReplicatorReplicationInfoListArgs{
ConsumerGroupReplications: msk.ReplicatorReplicationInfoListConsumerGroupReplicationArray{
&msk.ReplicatorReplicationInfoListConsumerGroupReplicationArgs{
ConsumerGroupsToReplicates: pulumi.StringArray{
pulumi.String(".*"),
},
},
},
TopicReplications: msk.ReplicatorReplicationInfoListTopicReplicationArray{
&msk.ReplicatorReplicationInfoListTopicReplicationArgs{
TopicNameConfiguration: &msk.ReplicatorReplicationInfoListTopicReplicationTopicNameConfigurationArgs{
Type: pulumi.String("PREFIXED_WITH_SOURCE_CLUSTER_ALIAS"),
},
StartingPosition: &msk.ReplicatorReplicationInfoListTopicReplicationStartingPositionArgs{
Type: pulumi.String("LATEST"),
},
TopicsToReplicates: pulumi.StringArray{
pulumi.String(".*"),
},
},
},
SourceKafkaClusterArn: pulumi.Any(source.Arn),
TargetKafkaClusterArn: pulumi.Any(target.Arn),
TargetCompressionType: pulumi.String("NONE"),
},
KafkaClusters: msk.ReplicatorKafkaClusterArray{
&msk.ReplicatorKafkaClusterArgs{
AmazonMskCluster: &msk.ReplicatorKafkaClusterAmazonMskClusterArgs{
MskClusterArn: pulumi.Any(source.Arn),
},
VpcConfig: &msk.ReplicatorKafkaClusterVpcConfigArgs{
SubnetIds: pulumi.StringArray(%!v(PANIC=Format method: fatal: A failure has occurred: unlowered splat expression @ example.pp:23,27-48)),
SecurityGroupsIds: pulumi.StringArray{
sourceAwsSecurityGroup.Id,
},
},
},
&msk.ReplicatorKafkaClusterArgs{
AmazonMskCluster: &msk.ReplicatorKafkaClusterAmazonMskClusterArgs{
MskClusterArn: pulumi.Any(target.Arn),
},
VpcConfig: &msk.ReplicatorKafkaClusterVpcConfigArgs{
SubnetIds: pulumi.StringArray(%!v(PANIC=Format method: fatal: A failure has occurred: unlowered splat expression @ example.pp:31,27-48)),
SecurityGroupsIds: pulumi.StringArray{
targetAwsSecurityGroup.Id,
},
},
},
},
ReplicatorName: pulumi.String("test-name"),
Description: pulumi.String("test-description"),
ServiceExecutionRoleArn: pulumi.Any(sourceAwsIamRole.Arn),
})
if err != nil {
return err
}
return nil
})
}
pulumi {
required_providers {
aws = {
source = "pulumi/aws"
}
}
}
resource "aws_msk_replicator" "test" {
replication_info_list = {
consumer_group_replications = [{
"consumerGroupsToReplicates" = [".*"]
}]
topic_replications = [{
"topicNameConfiguration" = {
"type" = "PREFIXED_WITH_SOURCE_CLUSTER_ALIAS"
}
"startingPosition" = {
"type" = "LATEST"
}
"topicsToReplicates" = [".*"]
}]
source_kafka_cluster_arn = source.arn
target_kafka_cluster_arn = target.arn
target_compression_type = "NONE"
}
kafka_clusters {
amazon_msk_cluster = {
msk_cluster_arn = source.arn
}
vpc_config = {
subnet_ids = sourceAwsSubnet[*].id
security_groups_ids = [sourceAwsSecurityGroup.id]
}
}
kafka_clusters {
amazon_msk_cluster = {
msk_cluster_arn = target.arn
}
vpc_config = {
subnet_ids = targetAwsSubnet[*].id
security_groups_ids = [targetAwsSecurityGroup.id]
}
}
replicator_name = "test-name"
description = "test-description"
service_execution_role_arn = sourceAwsIamRole.arn
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.msk.Replicator;
import com.pulumi.aws.msk.ReplicatorArgs;
import com.pulumi.aws.msk.inputs.ReplicatorReplicationInfoListArgs;
import com.pulumi.aws.msk.inputs.ReplicatorReplicationInfoListConsumerGroupReplicationArgs;
import com.pulumi.aws.msk.inputs.ReplicatorReplicationInfoListTopicReplicationArgs;
import com.pulumi.aws.msk.inputs.ReplicatorReplicationInfoListTopicReplicationTopicNameConfigurationArgs;
import com.pulumi.aws.msk.inputs.ReplicatorReplicationInfoListTopicReplicationStartingPositionArgs;
import com.pulumi.aws.msk.inputs.ReplicatorKafkaClusterArgs;
import com.pulumi.aws.msk.inputs.ReplicatorKafkaClusterAmazonMskClusterArgs;
import com.pulumi.aws.msk.inputs.ReplicatorKafkaClusterVpcConfigArgs;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var test = new Replicator("test", ReplicatorArgs.builder()
.replicationInfoList(ReplicatorReplicationInfoListArgs.builder()
.consumerGroupReplications(ReplicatorReplicationInfoListConsumerGroupReplicationArgs.builder()
.consumerGroupsToReplicates(".*")
.build())
.topicReplications(ReplicatorReplicationInfoListTopicReplicationArgs.builder()
.topicNameConfiguration(ReplicatorReplicationInfoListTopicReplicationTopicNameConfigurationArgs.builder()
.type("PREFIXED_WITH_SOURCE_CLUSTER_ALIAS")
.build())
.startingPosition(ReplicatorReplicationInfoListTopicReplicationStartingPositionArgs.builder()
.type("LATEST")
.build())
.topicsToReplicates(".*")
.build())
.sourceKafkaClusterArn(source.arn())
.targetKafkaClusterArn(target.arn())
.targetCompressionType("NONE")
.build())
.kafkaClusters(
ReplicatorKafkaClusterArgs.builder()
.amazonMskCluster(ReplicatorKafkaClusterAmazonMskClusterArgs.builder()
.mskClusterArn(source.arn())
.build())
.vpcConfig(ReplicatorKafkaClusterVpcConfigArgs.builder()
.subnetIds(sourceAwsSubnet.stream().map(element -> element.id()).collect(toList()))
.securityGroupsIds(sourceAwsSecurityGroup.id())
.build())
.build(),
ReplicatorKafkaClusterArgs.builder()
.amazonMskCluster(ReplicatorKafkaClusterAmazonMskClusterArgs.builder()
.mskClusterArn(target.arn())
.build())
.vpcConfig(ReplicatorKafkaClusterVpcConfigArgs.builder()
.subnetIds(targetAwsSubnet.stream().map(element -> element.id()).collect(toList()))
.securityGroupsIds(targetAwsSecurityGroup.id())
.build())
.build())
.replicatorName("test-name")
.description("test-description")
.serviceExecutionRoleArn(sourceAwsIamRole.arn())
.build());
}
}
Import
Identity Schema
Required
arn(String) ARN of the MSK replicator.
Using pulumi import, import MSK replicators using arn. For example:
$ pulumi import aws:msk/replicator:Replicator example arn:aws:kafka:us-west-2:123456789012:replicator/example-replicator/b3a16098-f408-4995-8e36-482db4f1b46b
Constructors
- Replicator(String name, {ReplicatorArgs? args, CustomResourceOptions? options})
-
Creates a new Replicator.
nameThe Pulumi resource name.argsArguments used to configure this Replicator. The set of arguments for Replicator.optionsResource options controlling this resource's behavior. - Replicator.reference(String urn)
- Creates a typed reference to an existing Replicator resource.
Properties
-
arn
↔ Output<
String> -
ARN of the Replicator.
latefinal
-
childResources
→ Set<
Resource> -
finalinherited
-
completionSources
↔ Map<
String, IOutputCompletionSource> -
latefinalinherited
-
currentVersion
↔ Output<
String> -
latefinal
-
description
↔ Output<
String?> -
A summary description of the replicator.
latefinal
- hashCode → int
-
The hash code for this object.
no setterinherited
-
id
↔ Output<
String> -
getter/setter pairinherited
- isCustom → bool
-
Returns whether this resource is provider-managed.
no setterinherited
- isProtected → bool
-
Returns whether this resource is protected from deletion.
no setterinherited
- isRemote → bool
-
Whether this resource is registered as remote.
no setterinherited
- isResourceReference → bool
-
Whether this instance represents a resource value returned over RPC.
finalinherited
-
kafkaClusters
↔ Output<
List< ReplicatorKafkaCluster> > -
A list of Kafka clusters which are targets of the replicator.
latefinal
-
logDelivery
↔ Output<
ReplicatorLogDelivery?> -
Configuration block for delivering replicator logs to customer destinations. Detailed below.
latefinal
-
region
↔ Output<
String> -
Region where this resource will be managed. Defaults to the Region set in the provider configuration.
latefinal
-
replicationInfoList
↔ Output<
ReplicatorReplicationInfoList> -
A list of replication configurations, where each configuration targets a given source cluster to target cluster replication flow.
latefinal
-
replicatorName
↔ Output<
String> -
The name of the replicator.
latefinal
-
resourceTransforms
→ List<
ResourceTransform> -
Inherited/explicit async transforms.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
serviceExecutionRoleArn
↔ Output<
String> -
The ARN of the IAM role used by the replicator to access resources in the customer's account (e.g source and target clusters).
latefinal
-
A map of tags to assign to the resource. If configured with a provider
defaultTagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level.latefinal -
A map of tags assigned to the resource, including those inherited from the provider
defaultTagsconfiguration block.latefinal -
transformations
→ List<
ResourceTransformation> -
Inherited/explicit legacy transformations.
no setterinherited
-
urn
↔ Output<
String> -
latefinalinherited
Methods
-
failId(
Object error) → void -
Completes this resource ID with an error when registration fails.
inherited
-
failOutputs(
Object error) → void -
Completes all output properties with
error.inherited -
failUrn(
Object error) → void -
Completes this resource URN with an error when registration fails.
inherited
-
getProvider(
String moduleMember) → ProviderResource? -
Returns provider for
moduleMember's package, if configured.inherited -
getResourceName(
) → String -
Returns this resource's logical name.
inherited
-
getResourceType(
) → String -
Returns this resource's Pulumi type token.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
registerOutput<
T> (String propertyName, {Object? decoder(Object?)?, bool isSecret = false}) → Output< T> -
Registers a dynamic output property for this resource.
inherited
-
resolveId(
String? value, {required bool isKnown}) → void -
Resolves the provider-assigned ID for this resource.
inherited
-
resolveOutputs(
Struct outputs) → void -
Resolves all output properties from a monitor response payload.
inherited
-
resolveUrn(
String value) → void -
Resolves this resource's URN once assigned by the engine.
inherited
-
serializeProperties(
Map< String, dynamic> properties) → Future<Struct> -
Serializes resource properties for RPC transmission.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
get(
String name, Input< String> id, {ReplicatorState? state, CustomResourceOptions? options}) → Replicator -
Gets an existing Replicator resource's state with the given
nameandid.