github.com/minamijoyo/terraform@v0.7.8-0.20161029001309-18b3736ba44b/website/source/docs/providers/rabbitmq/r/exchange.html.markdown (about) 1 --- 2 layout: "rabbitmq" 3 page_title: "RabbitMQ: rabbitmq_exchange" 4 sidebar_current: "docs-rabbitmq-resource-exchange" 5 description: |- 6 Creates and manages an exchange on a RabbitMQ server. 7 --- 8 9 # rabbitmq\_exchange 10 11 The ``rabbitmq_exchange`` resource creates and manages an exchange. 12 13 ## Example Usage 14 15 ``` 16 resource "rabbitmq_vhost" "test" { 17 name = "test" 18 } 19 20 resource "rabbitmq_permissions" "guest" { 21 user = "guest" 22 vhost = "${rabbitmq_vhost.test.name}" 23 permissions { 24 configure = ".*" 25 write = ".*" 26 read = ".*" 27 } 28 } 29 30 resource "rabbitmq_exchange" "test" { 31 name = "test" 32 vhost = "${rabbitmq_permissions.guest.vhost}" 33 settings { 34 type = "fanout" 35 durable = false 36 auto_delete = true 37 } 38 } 39 ``` 40 41 ## Argument Reference 42 43 The following arguments are supported: 44 45 * `name` - (Required) The name of the exchange. 46 47 * `vhost` - (Required) The vhost to create the resource in. 48 49 * `settings` - (Required) The settings of the exchange. The structure is 50 described below. 51 52 The `settings` block supports: 53 54 * `type` - (Required) The type of exchange. 55 56 * `durable` - (Optional) Whether the exchange survives server restarts. 57 Defaults to `false`. 58 59 * `auto_delete` - (Optional) Whether the exchange will self-delete when all 60 queues have finished using it. 61 62 * `arguments` - (Optional) Additional key/value settings for the exchange. 63 64 ## Attributes Reference 65 66 No further attributes are exported. 67 68 ## Import 69 70 Exchanges can be imported using the `id` which is composed of `name@vhost`. 71 E.g. 72 73 ``` 74 terraform import rabbitmq_exchange.test test@vhost 75 ```