ALIYUN::KAFKA::Topic is used to create a Topic.
Syntax
{
"Type": "ALIYUN::KAFKA::Topic",
"Properties": {
"InstanceId": String,
"Topic": String,
"Remark": String,
"PartitionNum": Integer
}
}
Properties
Parameter | Type | Required | Editable | Description | Constraint |
---|---|---|---|---|---|
InstanceId | String | Yes | Not supported | The ID of the instance. | None |
Topic | String | Yes | Not supported | The name of the topic. | It must be 3 to 64 characters in length and can contain letters, digits, underscores
(_), and hyphen (-). More than 64 characters are automatically truncated.
Note The name cannot be modified after being created.
|
Remark | String | Yes | Not supported | Topic note information | The name must be 3 to 64 characters in length and can contain letters, digits, underscores (_), and hyphen (-). |
PartitionNum | Integer | Erased | Released | Partitions in a Topic | Value range: 1 to 48
We recommend that you set the number of partitions to a multiple of 6 to reduce the risk of data skew. |
Return value
Fn::GetAtt
- InstanceId: The ID of the instance.
- Topic: The name of the Topic.
Examples
JSON
format
{
"ROSTemplateFormatVersion": "2015-09-01",
"Resources": {
"Topic": {
"Type": "ALIYUN::KAFKA::Topic",
"Properties": {
"InstanceId": {
"Ref": "InstanceId"
},
"Topic": {
"Ref": "Topic"
},
"Remark": {
"Ref": "Remark"
},
"PartitionNum": {
"Ref": "PartitionNum"
}
}
}
},
"Parameters": {
"InstanceId": {
"Type": "String",
"Description": "The ID of the Message Queue for Apache Kafka instance where the topic is located.\nYou can call the GetInstanceList operation to query instances."
},
"Topic": {
"Type": "String",
"Description": "The name of the topic. The value of this parameter must meet the following requirements:\nThe name can only contain letters, digits, hyphens (-), and underscores (_).\nThe name must be 3 to 64 characters in length, and will be automatically truncated\nif it contains more characters.\nThe name cannot be modified after being created."
},
"Remark": {
"Type": "String",
"Description": "The description of the topic. The value of this parameter must meet the following\nrequirements:\nThe value can only contain letters, digits, hyphens (-), and underscores (_).\nThe value must be 3 to 64 characters in length."
},
"PartitionNum": {
"Type": "Number",
"Description": "The number of partitions in the topic. Valid values:\n1 to 48\nWe recommend that you set the number of partitions to a multiple of 6 to reduce the\nrisk of data skew.Note:For special requirements,submit a ticket."
}
},
"Outputs": {
"InstanceId": {
"Description": "The ID of the Message Queue for Apache Kafka instance where the topic is located.\nYou can call the GetInstanceList operation to query instances.",
"Value": {
"Fn::GetAtt": [
"Topic",
"InstanceId"
]
}
},
"Topic": {
"Description": "Topic name.",
"Value": {
"Fn::GetAtt": [
"Topic",
"Topic"
]
}
}
}
}
YAML
format
ROSTemplateFormatVersion: '2015-09-01'
Resources:
Topic:
Type: 'ALIYUN::KAFKA::Topic'
Properties:
InstanceId:
Ref: InstanceId
Topic:
Ref: Topic
Remark:
Ref: Remark
PartitionNum:
Ref: PartitionNum
Parameters:
InstanceId:
Type: String
Description: >-
The ID of the Message Queue for Apache Kafka instance where the topic is
located.
You can call the GetInstanceList operation to query instances.
Topic:
Type: String
Description: >-
The name of the topic. The value of this parameter must meet the following
requirements:
The name can only contain letters, digits, hyphens (-), and underscores
(_).
The name must be 3 to 64 characters in length and and will be automatically
truncated
if it contains more characters.
The name cannot be modified after being created.
Remark:
Type: String
Description: >-
The description of the topic. The value of this parameter must meet the
following
requirements:
The value can only contain letters, digits, hyphens (-), and underscores
(_).
The value must be 3 to 64 characters in length.
PartitionNum:
Type: Number
Description: >-
The number of partitions in the topic. Valid values:
1 to 48
We recommend that you set the number of partitions to a multiple of 6 to
Reduce the
risk of data skew.Note:For special requirements,submit a ticket.
Outputs:
InstanceId:
Description: >-
The ID of the Message Queue for Apache Kafka instance where the topic is
located.
You can call the GetInstanceList operation to query instances.
Value:
'Fn::GetAtt':
-Topic
- InstanceId
Topic:
Description: Topic name.
Value:
'Fn::GetAtt':
-Topic
-Topic