Skip to content

kafka create-topic

create Kafka topic

Description

Create topic with the provided name & config

Synopsis

kafka create-topic
    [--site <site>]
    [--cluster <cluster>]
    <topic>
    [--validate_only]
    [--replication_factor <replication_factor>]
    [--num_partitions <num_partitions>]

Arguments

site - (string)

     Site where this command will be executed
     Example: --site "site-1"
     Default: input.site      Attributes: optional

cluster - (string)

     Name of kafka cluster
     Example: --cluster "cluster-1"
     Default: default      Attributes: optional

topic - (string)

     Name of the topic
     Example: "topic-1"
     Default: _None_      Attributes: required

validate_only - (bool)

     Only check if a topic can be created with provided config and not create topic in cluster
     Example: --validate_only
     Default: _None_      Attributes: optional

replication_factor - (int)

     Replication factor
     Example: --replication_factor 1
     Default: _None_      Attributes: optional

num_partitions - (int)

    
     Example: --num_partitions 1
     Default: _None_      Attributes: optional

Examples

Input:

! kafka create-topic --cluster "default" "test-topic-1" --replication_factor 2 --num_partitions 3
Output:
Topic "test-topic-1" is created

Access Control

To use this command, you need access to the following:

Field Value
Action "create"
Service Type "kafka"
Service Instance cluster
Namespace
Object Type "topic"
Object ID topic

Please see Access Control for details.