github.com/vtorhonen/terraform@v0.9.0-beta2.0.20170307220345-5d894e4ffda7/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 25 permissions { 26 configure = ".*" 27 write = ".*" 28 read = ".*" 29 } 30 } 31 32 resource "rabbitmq_exchange" "test" { 33 name = "test" 34 vhost = "${rabbitmq_permissions.guest.vhost}" 35 36 settings { 37 type = "fanout" 38 durable = false 39 auto_delete = true 40 } 41 } 42 43 resource "rabbitmq_queue" "test" { 44 name = "test" 45 vhost = "${rabbitmq_permissions.guest.vhost}" 46 47 settings { 48 durable = true 49 auto_delete = false 50 } 51 } 52 53 resource "rabbitmq_binding" "test" { 54 source = "${rabbitmq_exchange.test.name}" 55 vhost = "${rabbitmq_vhost.test.name}" 56 destination = "${rabbitmq_queue.test.name}" 57 destination_type = "queue" 58 routing_key = "#" 59 properties_key = "%23" 60 } 61 ``` 62 63 ## Argument Reference 64 65 The following arguments are supported: 66 67 * `source` - (Required) The source exchange. 68 69 * `vhost` - (Required) The vhost to create the resource in. 70 71 * `destination` - (Required) The destination queue or exchange. 72 73 * `destination_type` - (Required) The type of destination (queue or exchange). 74 75 * `properties_key` - (Required) A unique key to refer to the binding. 76 77 * `routing_key` - (Optional) A routing key for the binding. 78 79 * `arguments` - (Optional) Additional key/value arguments for the binding. 80 81 ## Attributes Reference 82 83 No further attributes are exported. 84 85 ## Import 86 87 Bindings can be imported using the `id` which is composed of 88 `vhost/source/destination/destination_type/properties_key`. E.g. 89 90 ``` 91 terraform import rabbitmq_binding.test test/test/test/queue/%23 92 ```