The ALIYUN::ROCKETMQ::Topic resource type creates a topic.
Syntax
{
"Type": "ALIYUN::ROCKETMQ::Topic",
"Properties": {
"InstanceId": String,
"Topic": String,
"Remark": String,
"MessageType": Integer
}
}Properties
| Property name | Type | Required | Update allowed | Description | Constraints |
| InstanceId | String | Yes | No | The ID of the instance that contains the topic. | None |
| Topic | String | Yes | No | The name of the topic. | The name must be 3 to 64 characters in length. It cannot start with CID or GID. It can contain letters, digits, hyphens (-), and underscores (_).If the instance that contains the topic has a namespace, the topic name must be unique within the instance. The name cannot be the same as an existing topic name or Group ID in the instance. Topic names can be the same across different instances. If the instance that contains the topic does not have a namespace, the topic name must be globally unique across all instances and regions. The name cannot be the same as any existing topic name or Group ID. |
| Remark | String | No | No | The description of the topic. | None |
| MessageType | Integer | Yes | No | The message type of the topic. | Valid values:
|
Return values
Fn::GetAtt
- InstanceId: The ID of the instance that contains the topic.
- Topic: The name of the topic.
- MessageType: The message type of the topic.
Examples
JSONformat{ "ROSTemplateFormatVersion": "2015-09-01", "Parameters": { "InstanceId": { "Type": "String", "Description": "The ID of the instance." } }, "Resources": { "Topic": { "Type": "ALIYUN::ROCKETMQ::Topic", "Properties": { "InstanceId": { "Ref": "InstanceId" }, "Topic": "test-topic", "MessageType": 0 } } }, "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 message type.", "Value": { "Fn::GetAtt": [ "Topic", "MessageType" ] } } } }
For examples of how to create a standard instance, a Group ID, and a topic, see the JSON example and YAML example.
该文章对您有帮助吗?