github.com/minamijoyo/terraform@v0.7.8-0.20161029001309-18b3736ba44b/website/source/docs/providers/rabbitmq/r/binding.html.markdown (about) 1 --- 2 layout: "rabbitmq" 3 page_title: "RabbitMQ: rabbitmq_binding" 4 sidebar_current: "docs-rabbitmq-resource-binding" 5 description: |- 6 Creates and manages a binding on a RabbitMQ server. 7 --- 8 9 # rabbitmq\_binding 10 11 The ``rabbitmq_binding`` resource creates and manages a binding relationship 12 between a queue an exchange. 13 14 ## Example Usage 15 16 ``` 17 resource "rabbitmq_vhost" "test" { 18 name = "test" 19 } 20 21 resource "rabbitmq_permissions" "guest" { 22 user = "guest" 23 vhost = "${rabbitmq_vhost.test.name}" 24 permissions { 25 configure = ".*" 26 write = ".*" 27 read = ".*" 28 } 29 } 30 31 resource "rabbitmq_exchange" "test" { 32 name = "test" 33 vhost = "${rabbitmq_permissions.guest.vhost}" 34 settings { 35 type = "fanout" 36 durable = false 37 auto_delete = true 38 } 39 } 40 41 resource "rabbitmq_queue" "test" { 42 name = "test" 43 vhost = "${rabbitmq_permissions.guest.vhost}" 44 settings { 45 durable = true 46 auto_delete = false 47 } 48 } 49 50 resource "rabbitmq_binding" "test" { 51 source = "${rabbitmq_exchange.test.name}" 52 vhost = "${rabbitmq_vhost.test.name}" 53 destination = "${rabbitmq_queue.test.name}" 54 destination_type = "queue" 55 routing_key = "#" 56 properties_key = "%23" 57 } 58 ``` 59 60 ## Argument Reference 61 62 The following arguments are supported: 63 64 * `source` - (Required) The source exchange. 65 66 * `vhost` - (Required) The vhost to create the resource in. 67 68 * `destination` - (Required) The destination queue or exchange. 69 70 * `destination_type` - (Required) The type of destination (queue or exchange). 71 72 * `properties_key` - (Required) A unique key to refer to the binding. 73 74 * `routing_key` - (Optional) A routing key for the binding. 75 76 * `arguments` - (Optional) Additional key/value arguments for the binding. 77 78 ## Attributes Reference 79 80 No further attributes are exported. 81 82 ## Import 83 84 Bindings can be imported using the `id` which is composed of 85 `vhost/source/destination/destination_type/properties_key`. E.g. 86 87 ``` 88 terraform import rabbitmq_binding.test test/test/test/queue/%23 89 ```