github.com/vtorhonen/terraform@v0.9.0-beta2.0.20170307220345-5d894e4ffda7/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 25 permissions { 26 configure = ".*" 27 write = ".*" 28 read = ".*" 29 } 30 } 31 32 resource "rabbitmq_policy" "test" { 33 name = "test" 34 vhost = "${rabbitmq_permissions.guest.vhost}" 35 36 policy { 37 pattern = ".*" 38 priority = 0 39 apply_to = "all" 40 41 definition { 42 ha-mode = "all" 43 } 44 } 45 } 46 ``` 47 48 ## Argument Reference 49 50 The following arguments are supported: 51 52 * `name` - (Required) The name of the policy. 53 54 * `vhost` - (Required) The vhost to create the resource in. 55 56 * `policy` - (Required) The settings of the policy. The structure is 57 described below. 58 59 The `policy` block supports: 60 61 * `pattern` - (Required) A pattern to match an exchange or queue name. 62 * `priority` - (Required) The policy with the greater priority is applied first. 63 * `apply_to` - (Required) Can either be "exchange", "queues", or "all". 64 * `definition` - (Required) Key/value pairs of the policy definition. See the 65 RabbitMQ documentation for definition references and examples. 66 67 ## Attributes Reference 68 69 No further attributes are exported. 70 71 ## Import 72 73 Policies can be imported using the `id` which is composed of `name@vhost`. 74 E.g. 75 76 ``` 77 terraform import rabbitmq_policy.test name@vhost 78 ```