Provides a RabbitMQ (AMQP) Exchange resource.
For information about RabbitMQ (AMQP) Exchange and how to use it, see What is Exchange.
Basic Usage
resource "alicloud_amqp_instance" "default" {
instance_type = "professional"
max_tps = 1000
queue_capacity = 50
support_eip = true
max_eip_tps = 128
payment_type = "Subscription"
period = 1
}
resource "alicloud_amqp_virtual_host" "default" {
instance_id = alicloud_amqp_instance.default.id
virtual_host_name = "tf-example"
}
resource "alicloud_amqp_exchange" "default" {
auto_delete_state = false
exchange_name = "tf-example"
exchange_type = "DIRECT"
instance_id = alicloud_amqp_instance.default.id
internal = false
virtual_host_name = alicloud_amqp_virtual_host.default.virtual_host_name
}
The following arguments are supported:
alternate_exchange
- (Optional) The alternate exchange. An alternate exchange is configured for an existing exchange. It is used to receive messages that fail to be routed to queues from the existing exchange.auto_delete_state
- (Required, ForceNew) Specifies whether the Auto Delete attribute is configured. Valid values:
exchange_name
- (Required, ForceNew) The name of the exchange. It must be 1 to 255 characters in length, and can contain only letters, digits, hyphens (-), underscores (_), periods (.), and at signs (@).
exchange_type
- (Required, ForceNew) The type of the exchange. Valid values:
instance_id
- (Required, ForceNew) The ID of the instance.
internal
- (Required) Specifies whether an exchange is an internal exchange. Valid values:
virtual_host_name
- (Required, ForceNew) The name of virtual host where an exchange resides.
The following attributes are exported:
id
- The resource ID of Exchange. The value formats as <instance_id>:<virtual_host_name>:<exchange_name>
.RabbitMQ (AMQP) Exchange can be imported using the id, e.g.
$ terraform import alicloud_amqp_exchange.example <instance_id>:<virtual_host_name>:<exchange_name>