github.com/vtorhonen/terraform@v0.9.0-beta2.0.20170307220345-5d894e4ffda7/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 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 35 settings { 36 type = "fanout" 37 durable = false 38 auto_delete = true 39 } 40 } 41 ``` 42 43 ## Argument Reference 44 45 The following arguments are supported: 46 47 * `name` - (Required) The name of the exchange. 48 49 * `vhost` - (Required) The vhost to create the resource in. 50 51 * `settings` - (Required) The settings of the exchange. The structure is 52 described below. 53 54 The `settings` block supports: 55 56 * `type` - (Required) The type of exchange. 57 58 * `durable` - (Optional) Whether the exchange survives server restarts. 59 Defaults to `false`. 60 61 * `auto_delete` - (Optional) Whether the exchange will self-delete when all 62 queues have finished using it. 63 64 * `arguments` - (Optional) Additional key/value settings for the exchange. 65 66 ## Attributes Reference 67 68 No further attributes are exported. 69 70 ## Import 71 72 Exchanges can be imported using the `id` which is composed of `name@vhost`. 73 E.g. 74 75 ``` 76 terraform import rabbitmq_exchange.test test@vhost 77 ```