Provides a RabbitMQ (AMQP) Binding resource to bind tha exchange with another exchange or queue.
For information about RabbitMQ (AMQP) Binding and how to use it, see What is Binding.
Basic Usage
resource "alicloud_amqp_instance" "default" {
instance_type = "enterprise"
max_tps = 3000
queue_capacity = 200
storage_size = 700
support_eip = false
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 = "HEADERS"
instance_id = alicloud_amqp_instance.default.id
internal = false
virtual_host_name = alicloud_amqp_virtual_host.default.virtual_host_name
}
resource "alicloud_amqp_queue" "default" {
instance_id = alicloud_amqp_instance.default.id
queue_name = "tf-example"
virtual_host_name = alicloud_amqp_virtual_host.default.virtual_host_name
}
resource "alicloud_amqp_binding" "default" {
argument = "x-match:all"
binding_key = alicloud_amqp_queue.default.queue_name
binding_type = "QUEUE"
destination_name = "tf-example"
instance_id = alicloud_amqp_instance.default.id
source_exchange = alicloud_amqp_exchange.default.exchange_name
virtual_host_name = alicloud_amqp_virtual_host.default.virtual_host_name
}
The following arguments are supported:
argument
- (Optional, ForceNew) X-match Attributes. Valid Values:
NOTE: This Parameter Applies Only to Headers Exchange Other Types of Exchange Is Invalid. Other Types of Exchange Here Can Either Be an Arbitrary Value.
binding_key
- (Required, ForceNew) The Binding Key.
binding_type
- (Required, ForceNew) The Target Binding Types. Valid values: EXCHANGE
, QUEUE
.
destination_name
- (Required, ForceNew) The Target Queue Or Exchange of the Name.instance_id
- (Required, ForceNew) Instance Id.source_exchange
- (Required, ForceNew) The Source Exchange Name.virtual_host_name
- (Required, ForceNew) Virtualhost Name.The following attributes are exported:
id
- The resource ID of Binding. The value formats as <instance_id>:<virtual_host_name>:<source_exchange>:<destination_name>
.RabbitMQ (AMQP) Binding can be imported using the id, e.g.
terraform import alicloud_amqp_binding.example <instance_id>:<virtual_host_name>:<source_exchange>:<destination_name>