Kafka / Client / create_topic

create_topic

Kafka.Client.create_topic(**kwargs)

Creates a topic in the specified MSK cluster.

See also: AWS API Documentation

Request Syntax

response = client.create_topic(
    ClusterArn='string',
    TopicName='string',
    PartitionCount=123,
    ReplicationFactor=123,
    Configs='string'
)
Parameters:
  • ClusterArn (string) –

    [REQUIRED]

    The Amazon Resource Name (ARN) that uniquely identifies the cluster.

  • TopicName (string) –

    [REQUIRED]

    The name of the topic to create.

  • PartitionCount (integer) –

    [REQUIRED]

    The number of partitions for the topic.

  • ReplicationFactor (integer) –

    [REQUIRED]

    The replication factor for the topic.

  • Configs (string) – Topic configurations encoded as a Base64 string.

Return type:

dict

Returns:

Response Syntax

{
    'TopicArn': 'string',
    'TopicName': 'string',
    'Status': 'CREATING'|'UPDATING'|'DELETING'|'ACTIVE'
}

Response Structure

  • (dict) –

    200 response

    • TopicArn (string) –

      The Amazon Resource Name (ARN) of the topic.

    • TopicName (string) –

      The name of the topic that was created.

    • Status (string) –

      The status of the topic creation.

Exceptions

  • Kafka.Client.exceptions.BadRequestException

  • Kafka.Client.exceptions.InternalServerErrorException

  • Kafka.Client.exceptions.UnauthorizedException

  • Kafka.Client.exceptions.ForbiddenException

  • Kafka.Client.exceptions.ServiceUnavailableException

  • Kafka.Client.exceptions.TooManyRequestsException

  • Kafka.Client.exceptions.ConflictException

  • Kafka.Client.exceptions.TopicExistsException

  • Kafka.Client.exceptions.ClusterConnectivityException

  • Kafka.Client.exceptions.KafkaTimeoutException

  • Kafka.Client.exceptions.UnknownTopicOrPartitionException

  • Kafka.Client.exceptions.ControllerMovedException

  • Kafka.Client.exceptions.NotControllerException

  • Kafka.Client.exceptions.ReassignmentInProgressException

  • Kafka.Client.exceptions.GroupSubscribedToTopicException

  • Kafka.Client.exceptions.KafkaRequestException