github.com/minamijoyo/terraform@v0.7.8-0.20161029001309-18b3736ba44b/website/source/docs/providers/rabbitmq/r/policy.html.markdown (about) 1 --- 2 layout: "rabbitmq" 3 page_title: "RabbitMQ: rabbitmq_policy" 4 sidebar_current: "docs-rabbitmq-resource-policy" 5 description: |- 6 Creates and manages a policy on a RabbitMQ server. 7 --- 8 9 # rabbitmq\_policy 10 11 The ``rabbitmq_policy`` resource creates and manages policies for exchanges 12 and queues. 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_policy" "test" { 32 name = "test" 33 vhost = "${rabbitmq_permissions.guest.vhost}" 34 policy { 35 pattern = ".*" 36 priority = 0 37 apply_to = "all" 38 definition { 39 ha-mode = "all" 40 } 41 } 42 } 43 ``` 44 45 ## Argument Reference 46 47 The following arguments are supported: 48 49 * `name` - (Required) The name of the policy. 50 51 * `vhost` - (Required) The vhost to create the resource in. 52 53 * `policy` - (Required) The settings of the policy. The structure is 54 described below. 55 56 The `policy` block supports: 57 58 * `pattern` - (Required) A pattern to match an exchange or queue name. 59 * `priority` - (Required) The policy with the greater priority is applied first. 60 * `apply_to` - (Required) Can either be "exchange", "queues", or "all". 61 * `definition` - (Required) Key/value pairs of the policy definition. See the 62 RabbitMQ documentation for definition references and examples. 63 64 ## Attributes Reference 65 66 No further attributes are exported. 67 68 ## Import 69 70 Policies can be imported using the `id` which is composed of `name@vhost`. 71 E.g. 72 73 ``` 74 terraform import rabbitmq_policy.test name@vhost 75 ```