ALIYUN::MNS::Topic is used to create a topic.
Syntax
{
"Type": "ALIYUN::MNS::Topic",
"Properties": {
"LoggingEnabled": Boolean,
"TopicName": String,
"MaximumMessageSize": Integer
}
}
Properties
Property | Type | Required | Editable | Description | Constraint |
---|---|---|---|---|---|
TopicName | String | Yes | No | The name of the topic. | The name must be unique to an Alibaba Cloud account in a region. The name can be up to 256 characters in length and can contain letters, digits, and hyphens (-). It must start with a letter. |
MaximumMessageSize | Integer | No | Yes | The maximum size of a message that can be sent to the topic. | Valid values: 1024 (1 KB) to 65536 (64 KB). Unit: bytes. Default value: 65536 (64 KB). |
LoggingEnabled | Boolean | No | Yes | Specifies whether to enable the log management feature. | Default value: false. Valid values:
|
Response parameters
Fn::GetAtt
- TopicUrl: the URL of the created topic.
- TopicName: the name of the created topic.
- ARN.WithSlash: The ARN of the created topic.
Examples
JSON
format{ "ROSTemplateFormatVersion": "2015-09-01", "Parameters": { "TopicName": { "Type": "String", "Description": "Topic name", "MinLength": 1, "MaxLength": 256 } }, "Resources": { "Topic": { "Type": "ALIYUN::MNS::Topic", "Properties": { "MaximumMessageSize": 1024, "LoggingEnabled": false, "TopicName": { "Ref": "TopicName" } } } }, "Outputs": { "TopicUrl": { "Description": "URL of created topic", "Value": { "Fn::GetAtt": [ "Topic", "TopicUrl" ] } }, "ARN": { "Description": "The ARN for ALIYUN::ROS::CustomResource", "Value": { "Fn::GetAtt": [ "Topic", "ARN.WithSlash" ] } }, "TopicName": { "Description": "Topic name", "Value": { "Fn::GetAtt": [ "Topic", "TopicName" ] } } } }