ALIYUN::AMQP::Exchange is used to create an exchange.
Syntax
{
"Type": "ALIYUN::AMQP::Exchange",
"Properties": {
"InstanceId": String,
"AlternateExchange": String,
"Internal": Boolean,
"VirtualHost": String,
"AutoDeleteState": Boolean,
"ExchangeName": String,
"ExchangeType": String
}
}
Properties
Property | Type | Required | Editable | Description | Constraint |
---|---|---|---|---|---|
InstanceId | String | Yes | No | The ID of the instance. | None. |
AlternateExchange | String | No | No | The alternate exchange. | An alternate exchange is used to receive messages that fail to be routed to queues from the current exchange. |
Internal | Boolean | Yes | No | Specifies whether the exchange is an internal exchange. | Valid values:
|
VirtualHost | String | Yes | No | The name of the vhost in which you want to create the exchange. | None. |
AutoDeleteState | Boolean | Yes | No | Specifies whether to automatically delete the exchange. | Valid values:
|
ExchangeName | String | Yes | No | The name of the exchange. | Description:
|
ExchangeType | String | Yes | No | The type of the exchange. | Valid values:
|
Return values
Fn::GetAtt
ExchangeName: the name of the exchange.
Examples
-
JSON
format{ "ROSTemplateFormatVersion": "2015-09-01", "Parameters": { "InstanceId": { "Type": "String", "Description": "InstanceId" }, "Internal": { "Type": "Boolean", "Description": "Specifies whether an exchange is an internal exchange. Valid values:\nfalse: The exchange is not an internal exchange.\ntrue: The exchange is an internal exchange.", "AllowedValues": [ "True", "true", "False", "false" ] }, "VirtualHost": { "Type": "String", "Description": "The name of the virtual host." }, "AutoDeleteState": { "Type": "Boolean", "Description": "Specifies whether the Auto Delete attribute is configured. Valid values:\ntrue: The Auto Delete attribute is configured. If the last queue that is bound to an exchange is unbound, the exchange is automatically deleted.\nfalse: The Auto Delete attribute is not configured. If the last queue that is bound to an exchange is unbound, the exchange is not automatically deleted.", "AllowedValues": [ "True", "true", "False", "false" ] }, "ExchangeName": { "Type": "String", "Description": "The name of the exchange.", "MaxLength": 255 }, "ExchangeType": { "Type": "String", "Description": "The type of the exchange. Valid values:\nFANOUT: An exchange of this type routes all the received messages to all the queues bound to this exchange. You can use a fanout exchange to broadcast messages.\nDIRECT: An exchange of this type routes a message to the queue whose binding key is exactly the same as the routing key of the message.\nTOPIC: This type is similar to the direct exchange type. An exchange of this type routes a message to one or more queues based on the fuzzy match or multi-condition match result between the routing key of the message and the binding keys of the current exchange.\nHEADERS: Headers Exchange uses the Headers property instead of Routing Key for routing matching. When binding Headers Exchange and Queue, set the key-value pair of the binding property; when sending a message to the Headers Exchange, set the message's Headers property key-value pair and use the message Headers The message is routed to the bound Queue by comparing the attribute key-value pair and the bound attribute key-value pair.", "AllowedValues": [ "FANOUT", "DIRECT", "TOPIC", "HEADERS" ] } }, "Resources": { "Exchange": { "Type": "ALIYUN::AMQP::Exchange", "Properties": { "InstanceId": { "Ref": "InstanceId" }, "Internal": { "Ref": "Internal" }, "VirtualHost": { "Ref": "VirtualHost" }, "AutoDeleteState": { "Ref": "AutoDeleteState" }, "ExchangeName": { "Ref": "ExchangeName" }, "ExchangeType": { "Ref": "ExchangeType" } } } }, "Outputs": { "ExchangeName": { "Description": "The name of the exchange.", "Value": { "Fn::GetAtt": [ "Exchange", "ExchangeName" ] } } } }