github.com/minamijoyo/terraform@v0.7.8-0.20161029001309-18b3736ba44b/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  `consul_keys` 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 and
    15  delete the keys explicitly given. However, It is not able to detect and remove
    16  additional keys that have been added by non-Terraform means. To manage
    17  *all* keys sharing a common prefix, and thus have Terraform remove errant keys
    18  not present in the configuration, consider using the `consul_key_prefix`
    19  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 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.