ALIYUN::ROCKETMQ::Topic类型用于创建Topic。
语法
{
"Type": "ALIYUN::ROCKETMQ::Topic",
"Properties": {
"InstanceId": String,
"Topic": String,
"Remark": String,
"MessageType": Integer,
"Perm": Integer
}
}
属性
属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 |
---|---|---|---|---|---|
InstanceId | String | 是 | 否 | 需创建的Topic所对应的实例ID | 无 |
Topic | String | 是 | 否 | 需创建的Topic的名称 | CID 和GID 是Group ID的保留字段。Topic名称不能以CID 或GID 开头,能够以满足要求的任意字符开头。
Topic名称只能包含英文、数字、 短横线(-)和下划线(_),长度为3~64个字符。
|
Remark | String | 否 | 否 | 备注 | 无 |
MessageType | Integer | 是 | 否 | 消息类型 | 取值范围:
|
Perm | Integer | 否 | 是 | 订阅/发布权限 | 取值范围:
|
返回值
Fn::GetAtt
- InstanceId:Topic对应的实例ID。
- Topic:Topic名称。
- MessageType:消息类型。
示例
JSON
格式
{
"ROSTemplateFormatVersion": "2015-09-01",
"Resources": {
"Topic": {
"Type": "ALIYUN::ROCKETMQ::Topic",
"Properties": {
"InstanceId": {
"Ref": "InstanceId"
},
"Topic": {
"Ref": "Topic"
},
"Remark": {
"Ref": "Remark"
},
"Perm": {
"Ref": "Perm"
},
"MessageType": {
"Ref": "MessageType"
}
}
}
},
"Parameters": {
"InstanceId": {
"Type": "String",
"Description": "The ID of the instance."
},
"Topic": {
"Type": "String",
"Description": "The name of the topic you want to create.\nNote:\n\"CID\" and \"GID\" are the reserved fields of a group ID, and they cannot be the start of a topic name.\nIf namespaces are available in the instance for which the topic is created, the topic name must be unique in the instance and can be duplicated across instances.\nIf no namespaces are available in the instance, the topic name must be unique both in the instance and across instances."
},
"Remark": {
"Type": "String",
"Description": "The remarks on the request. This parameter can be left blank."
},
"Perm": {
"Type": "Number",
"Description": "Set the read-write mode for the topic Valid values.:\n6: Both read and write operations are supported.\n4: Write operation is prohibited.\n2: Read operation is prohibited.",
"AllowedValues": [
2,
4,
6
]
},
"MessageType": {
"Type": "Number",
"Description": "The type of the message. Valid values:\n0: normal message\n1: partitionally ordered message\n2: globally ordered message\n4: transactional message\n5: scheduled/delayed message",
"AllowedValues": [
0,
1,
2,
4,
5
]
}
},
"Outputs": {
"InstanceId": {
"Description": "The ID of the instance.",
"Value": {
"Fn::GetAtt": [
"Topic",
"InstanceId"
]
}
},
"Topic": {
"Description": "The name of the topic.",
"Value": {
"Fn::GetAtt": [
"Topic",
"Topic"
]
}
},
"MessageType": {
"Description": "The type of the message.",
"Value": {
"Fn::GetAtt": [
"Topic",
"MessageType"
]
}
}
}
}
YAML
格式
ROSTemplateFormatVersion: '2015-09-01'
Resources:
Topic:
Type: 'ALIYUN::ROCKETMQ::Topic'
Properties:
InstanceId:
Ref: InstanceId
Topic:
Ref: Topic
Remark:
Ref: Remark
Perm:
Ref: Perm
MessageType:
Ref: MessageType
Parameters:
InstanceId:
Type: String
Description: The ID of the instance.
Topic:
Type: String
Description: >-
The name of the topic you want to create.
Note:
"CID" and "GID" are the reserved fields of a group ID, and they cannot be
the start of a topic name.
If namespaces are available in the instance for which the topic is
created, the topic name must be unique in the instance and can be
duplicated across instances.
If no namespaces are available in the instance, the topic name must be
unique both in the instance and across instances.
Remark:
Type: String
Description: The remarks on the request. This parameter can be left blank.
Perm:
Type: Number
Description: |-
Set the read-write mode for the topic Valid values.:
6: Both read and write operations are supported.
4: Write operation is prohibited.
2: Read operation is prohibited.
AllowedValues:
- 2
- 4
- 6
MessageType:
Type: Number
Description: |-
The type of the message. Valid values:
0: normal message
1: partitionally ordered message
2: globally ordered message
4: transactional message
5: scheduled/delayed message
AllowedValues:
- 0
- 1
- 2
- 4
- 5
Outputs:
InstanceId:
Description: The ID of the instance.
Value:
'Fn::GetAtt':
- Topic
- InstanceId
Topic:
Description: The name of the topic.
Value:
'Fn::GetAtt':
- Topic
- Topic
MessageType:
Description: The type of the message.
Value:
'Fn::GetAtt':
- Topic
- MessageType