github.com/ns1/terraform@v0.7.10-0.20161109153551-8949419bef40/website/source/docs/providers/consul/r/keys.html.markdown (about) 1 --- 2 layout: "consul" 3 page_title: "Consul: consul_keys" 4 sidebar_current: "docs-consul-resource-keys" 5 description: |- 6 Writes values into the Consul key/value store. 7 --- 8 9 # consul\_keys 10 11 The `consul_keys` resource writes sets of individual values into Consul. 12 This is a powerful way to expose infrastructure details to clients. 13 14 This resource manages individual keys, and thus it can create, update 15 and delete the keys explicitly given. However, it is not able to detect 16 and remove additional keys that have been added by non-Terraform means. 17 To manage *all* keys sharing a common prefix, and thus have Terraform 18 remove errant keys not present in the configuration, consider using the 19 `consul_key_prefix` resource instead. 20 21 ## Example Usage 22 23 ``` 24 resource "consul_keys" "app" { 25 datacenter = "nyc1" 26 token = "abcd" 27 28 # Set the CNAME of our load balancer as a key 29 key { 30 name = "elb_cname" 31 path = "service/app/elb_address" 32 value = "${aws_elb.app.dns_name}" 33 } 34 } 35 ``` 36 37 ## Argument Reference 38 39 The following arguments are supported: 40 41 * `datacenter` - (Optional) The datacenter to use. This overrides the 42 datacenter in the provider setup and the agent's default datacenter. 43 44 * `token` - (Optional) The ACL token to use. This overrides the 45 token that the agent provides by default. 46 47 * `key` - (Required) Specifies a key in Consul to be written. 48 Supported values documented below. 49 50 The `key` block supports the following: 51 52 * `path` - (Required) This is the path in Consul that should be written to. 53 54 * `value` - (Required) The value to write to the given path. 55 56 * `delete` - (Optional) If true, then the key will be deleted when 57 either its configuration block is removed from the configuration or 58 the entire resource is destroyed. Otherwise, it will be left in Consul. 59 Defaults to false. 60 61 ### Deprecated `key` arguments 62 63 Prior to Terraform 0.7, this resource was used both to read *and* write the 64 Consul key/value store. The read functionality has moved to the `consul_keys` 65 *data source*, whose documentation can be found via the navigation. 66 67 The pre-0.7 interface for reading keys is still supported for backward compatibility, 68 but will be removed in a future version of Terraform. 69 70 ## Attributes Reference 71 72 The following attributes are exported: 73 74 * `datacenter` - The datacenter the keys are being written to.