Skip to content

Commit

Permalink
feat(client-kafka): Amazon MSK Replicator can now replicate data to i…
Browse files Browse the repository at this point in the history
…dentically named topics between MSK clusters within the same AWS Region or across different AWS Regions.
  • Loading branch information
awstools committed Sep 9, 2024
1 parent 5f38d6b commit f8773ce
Show file tree
Hide file tree
Showing 6 changed files with 111 additions and 2 deletions.
3 changes: 3 additions & 0 deletions clients/client-kafka/src/commands/CreateReplicatorCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ export interface CreateReplicatorCommandOutput extends CreateReplicatorResponse,
* StartingPosition: { // ReplicationStartingPosition
* Type: "LATEST" || "EARLIEST",
* },
* TopicNameConfiguration: { // ReplicationTopicNameConfiguration
* Type: "PREFIXED_WITH_SOURCE_CLUSTER_ALIAS" || "IDENTICAL",
* },
* TopicsToExclude: [ // __listOf__stringMax249
* "STRING_VALUE",
* ],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ export interface DescribeReplicatorCommandOutput extends DescribeReplicatorRespo
* // StartingPosition: { // ReplicationStartingPosition
* // Type: "LATEST" || "EARLIEST",
* // },
* // TopicNameConfiguration: { // ReplicationTopicNameConfiguration
* // Type: "PREFIXED_WITH_SOURCE_CLUSTER_ALIAS" || "IDENTICAL",
* // },
* // TopicsToExclude: [ // __listOf__stringMax249
* // "STRING_VALUE",
* // ],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export interface GetBootstrapBrokersCommandInput extends GetBootstrapBrokersRequ
export interface GetBootstrapBrokersCommandOutput extends GetBootstrapBrokersResponse, __MetadataBearer {}

/**
* <p>A list of brokers that a client application can use to bootstrap.</p>
* <p>A list of brokers that a client application can use to bootstrap. This list doesn't necessarily include all of the brokers in the cluster. The following Python 3.6 example shows how you can use the Amazon Resource Name (ARN) of a cluster to get its bootstrap brokers. If you don't know the ARN of your cluster, you can use the <code>ListClusters</code> operation to get the ARNs of all the clusters in this account and Region.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
Expand Down
33 changes: 33 additions & 0 deletions clients/client-kafka/src/models/models_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1858,6 +1858,33 @@ export interface ReplicationStartingPosition {
Type?: ReplicationStartingPositionType;
}

/**
* @public
* @enum
*/
export const ReplicationTopicNameConfigurationType = {
IDENTICAL: "IDENTICAL",
PREFIXED_WITH_SOURCE_CLUSTER_ALIAS: "PREFIXED_WITH_SOURCE_CLUSTER_ALIAS",
} as const;

/**
* @public
*/
export type ReplicationTopicNameConfigurationType =
(typeof ReplicationTopicNameConfigurationType)[keyof typeof ReplicationTopicNameConfigurationType];

/**
* <p>Configuration for specifying replicated topic names should be the same as their corresponding upstream topics or prefixed with source cluster alias.</p>
* @public
*/
export interface ReplicationTopicNameConfiguration {
/**
* <p>The type of replicated topic name.</p>
* @public
*/
Type?: ReplicationTopicNameConfigurationType;
}

/**
* <p>Details about topic replication.</p>
* @public
Expand Down Expand Up @@ -1887,6 +1914,12 @@ export interface TopicReplication {
*/
StartingPosition?: ReplicationStartingPosition;

/**
* <p>Configuration for specifying replicated topic names should be the same as their corresponding upstream topics or prefixed with source cluster alias.</p>
* @public
*/
TopicNameConfiguration?: ReplicationTopicNameConfiguration;

/**
* <p>List of regular expression patterns indicating the topics that should not be replicated.</p>
* @public
Expand Down
27 changes: 27 additions & 0 deletions clients/client-kafka/src/protocols/Aws_restJson1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ import {
ReplicationInfoSummary,
ReplicationStartingPosition,
ReplicationStateInfo,
ReplicationTopicNameConfiguration,
ReplicatorSummary,
S3,
Sasl,
Expand Down Expand Up @@ -3052,6 +3053,18 @@ const se_ReplicationStartingPosition = (input: ReplicationStartingPosition, cont
});
};

/**
* serializeAws_restJson1ReplicationTopicNameConfiguration
*/
const se_ReplicationTopicNameConfiguration = (
input: ReplicationTopicNameConfiguration,
context: __SerdeContext
): any => {
return take(input, {
type: [, , `Type`],
});
};

/**
* serializeAws_restJson1S3
*/
Expand Down Expand Up @@ -3138,6 +3151,7 @@ const se_TopicReplication = (input: TopicReplication, context: __SerdeContext):
copyTopicConfigurations: [, , `CopyTopicConfigurations`],
detectAndCopyNewTopics: [, , `DetectAndCopyNewTopics`],
startingPosition: [, (_) => se_ReplicationStartingPosition(_, context), `StartingPosition`],
topicNameConfiguration: [, (_) => se_ReplicationTopicNameConfiguration(_, context), `TopicNameConfiguration`],
topicsToExclude: [, _json, `TopicsToExclude`],
topicsToReplicate: [, _json, `TopicsToReplicate`],
});
Expand Down Expand Up @@ -4135,6 +4149,18 @@ const de_ReplicationStateInfo = (output: any, context: __SerdeContext): Replicat
}) as any;
};

/**
* deserializeAws_restJson1ReplicationTopicNameConfiguration
*/
const de_ReplicationTopicNameConfiguration = (
output: any,
context: __SerdeContext
): ReplicationTopicNameConfiguration => {
return take(output, {
Type: [, __expectString, `type`],
}) as any;
};

/**
* deserializeAws_restJson1ReplicatorSummary
*/
Expand Down Expand Up @@ -4252,6 +4278,7 @@ const de_TopicReplication = (output: any, context: __SerdeContext): TopicReplica
CopyTopicConfigurations: [, __expectBoolean, `copyTopicConfigurations`],
DetectAndCopyNewTopics: [, __expectBoolean, `detectAndCopyNewTopics`],
StartingPosition: [, (_: any) => de_ReplicationStartingPosition(_, context), `startingPosition`],
TopicNameConfiguration: [, (_: any) => de_ReplicationTopicNameConfiguration(_, context), `topicNameConfiguration`],
TopicsToExclude: [, _json, `topicsToExclude`],
TopicsToReplicate: [, _json, `topicsToReplicate`],
}) as any;
Expand Down
45 changes: 44 additions & 1 deletion codegen/sdk-codegen/aws-models/kafka.json
Original file line number Diff line number Diff line change
Expand Up @@ -3579,7 +3579,7 @@
}
],
"traits": {
"smithy.api#documentation": "<p>A list of brokers that a client application can use to bootstrap.</p>",
"smithy.api#documentation": "<p>A list of brokers that a client application can use to bootstrap. This list doesn't necessarily include all of the brokers in the cluster. The following Python 3.6 example shows how you can use the Amazon Resource Name (ARN) of a cluster to get its bootstrap brokers. If you don't know the ARN of your cluster, you can use the <code>ListClusters</code> operation to get the ARNs of all the clusters in this account and Region.</p>",
"smithy.api#http": {
"method": "GET",
"uri": "/v1/clusters/{ClusterArn}/bootstrap-brokers",
Expand Down Expand Up @@ -4066,6 +4066,7 @@
"name": "kafka"
},
"aws.protocols#restJson1": {},
"smithy.api#auth": ["aws.auth#sigv4"],
"smithy.api#documentation": "<p>The operations for managing an Amazon MSK cluster.</p>",
"smithy.api#title": "Managed Streaming for Kafka",
"smithy.rules#endpointRuleSet": {
Expand Down Expand Up @@ -7253,6 +7254,41 @@
"smithy.api#documentation": "Details about the state of a replicator"
}
},
"com.amazonaws.kafka#ReplicationTopicNameConfiguration": {
"type": "structure",
"members": {
"Type": {
"target": "com.amazonaws.kafka#ReplicationTopicNameConfigurationType",
"traits": {
"smithy.api#documentation": "<p>The type of replicated topic name.</p>",
"smithy.api#jsonName": "type"
}
}
},
"traits": {
"smithy.api#documentation": "<p>Configuration for specifying replicated topic names should be the same as their corresponding upstream topics or prefixed with source cluster alias.</p>"
}
},
"com.amazonaws.kafka#ReplicationTopicNameConfigurationType": {
"type": "enum",
"members": {
"PREFIXED_WITH_SOURCE_CLUSTER_ALIAS": {
"target": "smithy.api#Unit",
"traits": {
"smithy.api#enumValue": "PREFIXED_WITH_SOURCE_CLUSTER_ALIAS"
}
},
"IDENTICAL": {
"target": "smithy.api#Unit",
"traits": {
"smithy.api#enumValue": "IDENTICAL"
}
}
},
"traits": {
"smithy.api#documentation": "<p>The type of replicated topic name.</p>"
}
},
"com.amazonaws.kafka#ReplicatorState": {
"type": "enum",
"members": {
Expand Down Expand Up @@ -7746,6 +7782,13 @@
"smithy.api#jsonName": "startingPosition"
}
},
"TopicNameConfiguration": {
"target": "com.amazonaws.kafka#ReplicationTopicNameConfiguration",
"traits": {
"smithy.api#documentation": "<p>Configuration for specifying replicated topic names should be the same as their corresponding upstream topics or prefixed with source cluster alias.</p>",
"smithy.api#jsonName": "topicNameConfiguration"
}
},
"TopicsToExclude": {
"target": "com.amazonaws.kafka#__listOf__stringMax249",
"traits": {
Expand Down

0 comments on commit f8773ce

Please sign in to comment.