:doc:`Kafka <../../kafka>` / Client / create_replicator

*****************
create_replicator
*****************



.. py:method:: Kafka.Client.create_replicator(**kwargs)

  

  Creates the replicator.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/kafka-2018-11-14/CreateReplicator>`_  


  **Request Syntax**
  ::

    response = client.create_replicator(
        Description='string',
        KafkaClusters=[
            {
                'AmazonMskCluster': {
                    'MskClusterArn': 'string'
                },
                'VpcConfig': {
                    'SecurityGroupIds': [
                        'string',
                    ],
                    'SubnetIds': [
                        'string',
                    ]
                }
            },
        ],
        ReplicationInfoList=[
            {
                'ConsumerGroupReplication': {
                    'ConsumerGroupsToExclude': [
                        'string',
                    ],
                    'ConsumerGroupsToReplicate': [
                        'string',
                    ],
                    'DetectAndCopyNewConsumerGroups': True|False,
                    'SynchroniseConsumerGroupOffsets': True|False
                },
                'SourceKafkaClusterArn': 'string',
                'TargetCompressionType': 'NONE'|'GZIP'|'SNAPPY'|'LZ4'|'ZSTD',
                'TargetKafkaClusterArn': 'string',
                'TopicReplication': {
                    'CopyAccessControlListsForTopics': True|False,
                    'CopyTopicConfigurations': True|False,
                    'DetectAndCopyNewTopics': True|False,
                    'StartingPosition': {
                        'Type': 'LATEST'|'EARLIEST'
                    },
                    'TopicNameConfiguration': {
                        'Type': 'PREFIXED_WITH_SOURCE_CLUSTER_ALIAS'|'IDENTICAL'
                    },
                    'TopicsToExclude': [
                        'string',
                    ],
                    'TopicsToReplicate': [
                        'string',
                    ]
                }
            },
        ],
        ReplicatorName='string',
        ServiceExecutionRoleArn='string',
        Tags={
            'string': 'string'
        }
    )
    
  :type Description: string
  :param Description: 

    A summary description of the replicator.

    

  
  :type KafkaClusters: list
  :param KafkaClusters: **[REQUIRED]** 

    Kafka Clusters to use in setting up sources / targets for replication.

    

  
    - *(dict) --* 

      Information about Kafka Cluster to be used as source / target for replication.

      

    
      - **AmazonMskCluster** *(dict) --* **[REQUIRED]** 

        Details of an Amazon MSK Cluster.

        

      
        - **MskClusterArn** *(string) --* **[REQUIRED]** 

          The Amazon Resource Name (ARN) of an Amazon MSK cluster.

          

        
      
      - **VpcConfig** *(dict) --* **[REQUIRED]** 

        Details of an Amazon VPC which has network connectivity to the Apache Kafka cluster.

        

      
        - **SecurityGroupIds** *(list) --* 

          The security groups to attach to the ENIs for the broker nodes.

          

        
          - *(string) --* 

          
      
        - **SubnetIds** *(list) --* **[REQUIRED]** 

          The list of subnets in the client VPC to connect to.

          

        
          - *(string) --* 

          
      
      
    

  :type ReplicationInfoList: list
  :param ReplicationInfoList: **[REQUIRED]** 

    A list of replication configurations, where each configuration targets a given source cluster to target cluster replication flow.

    

  
    - *(dict) --* 

      Specifies configuration for replication between a source and target Kafka cluster.

      

    
      - **ConsumerGroupReplication** *(dict) --* **[REQUIRED]** 

        Configuration relating to consumer group replication.

        

      
        - **ConsumerGroupsToExclude** *(list) --* 

          List of regular expression patterns indicating the consumer groups that should not be replicated.

          

        
          - *(string) --* 

          
      
        - **ConsumerGroupsToReplicate** *(list) --* **[REQUIRED]** 

          List of regular expression patterns indicating the consumer groups to copy.

          

        
          - *(string) --* 

          
      
        - **DetectAndCopyNewConsumerGroups** *(boolean) --* 

          Enables synchronization of consumer groups to target cluster.

          

        
        - **SynchroniseConsumerGroupOffsets** *(boolean) --* 

          Enables synchronization of consumer group offsets to target cluster. The translated offsets will be written to topic __consumer_offsets.

          

        
      
      - **SourceKafkaClusterArn** *(string) --* **[REQUIRED]** 

        The ARN of the source Kafka cluster.

        

      
      - **TargetCompressionType** *(string) --* **[REQUIRED]** 

        The compression type to use when producing records to target cluster.

        

      
      - **TargetKafkaClusterArn** *(string) --* **[REQUIRED]** 

        The ARN of the target Kafka cluster.

        

      
      - **TopicReplication** *(dict) --* **[REQUIRED]** 

        Configuration relating to topic replication.

        

      
        - **CopyAccessControlListsForTopics** *(boolean) --* 

          Whether to periodically configure remote topic ACLs to match their corresponding upstream topics.

          

        
        - **CopyTopicConfigurations** *(boolean) --* 

          Whether to periodically configure remote topics to match their corresponding upstream topics.

          

        
        - **DetectAndCopyNewTopics** *(boolean) --* 

          Whether to periodically check for new topics and partitions.

          

        
        - **StartingPosition** *(dict) --* 

          Configuration for specifying the position in the topics to start replicating from.

          

        
          - **Type** *(string) --* 

            The type of replication starting position.

            

          
        
        - **TopicNameConfiguration** *(dict) --* 

          Configuration for specifying replicated topic names should be the same as their corresponding upstream topics or prefixed with source cluster alias.

          

        
          - **Type** *(string) --* 

            The type of replicated topic name.

            

          
        
        - **TopicsToExclude** *(list) --* 

          List of regular expression patterns indicating the topics that should not be replicated.

          

        
          - *(string) --* 

          
      
        - **TopicsToReplicate** *(list) --* **[REQUIRED]** 

          List of regular expression patterns indicating the topics to copy.

          

        
          - *(string) --* 

          
      
      
    

  :type ReplicatorName: string
  :param ReplicatorName: **[REQUIRED]** 

    The name of the replicator. Alpha-numeric characters with '-' are allowed.

    

  
  :type ServiceExecutionRoleArn: string
  :param ServiceExecutionRoleArn: **[REQUIRED]** 

    The ARN of the IAM role used by the replicator to access resources in the customer's account (e.g source and target clusters)

    

  
  :type Tags: dict
  :param Tags: 

    List of tags to attach to created Replicator.

    

  
    - *(string) --* 

    
      - *(string) --* 

      


  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {
          'ReplicatorArn': 'string',
          'ReplicatorName': 'string',
          'ReplicatorState': 'RUNNING'|'CREATING'|'UPDATING'|'DELETING'|'FAILED'
      }
      
    **Response Structure**

    

    - *(dict) --* 

      HTTP Status Code 200: OK.

      
      

      - **ReplicatorArn** *(string) --* 

        The Amazon Resource Name (ARN) of the replicator.

        
      

      - **ReplicatorName** *(string) --* 

        Name of the replicator provided by the customer.

        
      

      - **ReplicatorState** *(string) --* 

        State of the replicator.

        
  
  **Exceptions**
  
  *   :py:class:`Kafka.Client.exceptions.BadRequestException`

  
  *   :py:class:`Kafka.Client.exceptions.UnauthorizedException`

  
  *   :py:class:`Kafka.Client.exceptions.InternalServerErrorException`

  
  *   :py:class:`Kafka.Client.exceptions.ForbiddenException`

  
  *   :py:class:`Kafka.Client.exceptions.NotFoundException`

  
  *   :py:class:`Kafka.Client.exceptions.ServiceUnavailableException`

  
  *   :py:class:`Kafka.Client.exceptions.TooManyRequestsException`

  
  *   :py:class:`Kafka.Client.exceptions.ConflictException`

  