github.com/nathanielks/terraform@v0.6.1-0.20170509030759-13e1a62319dc/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  ```hcl
    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      path  = "service/app/elb_address"
    31      value = "${aws_elb.app.dns_name}"
    32    }
    33  }
    34  ```
    35  
    36  ## Argument Reference
    37  
    38  The following arguments are supported:
    39  
    40  * `datacenter` - (Optional) The datacenter to use. This overrides the
    41    datacenter in the provider setup and the agent's default datacenter.
    42  
    43  * `token` - (Optional) The ACL token to use. This overrides the
    44    token that the agent provides by default.
    45  
    46  * `key` - (Required) Specifies a key in Consul to be written.
    47    Supported values documented below.
    48  
    49  The `key` block supports the following:
    50  
    51  * `path` - (Required) This is the path in Consul that should be written to.
    52  
    53  * `value` - (Required) The value to write to the given path.
    54  
    55  * `delete` - (Optional) If true, then the key will be deleted when
    56    either its configuration block is removed from the configuration or
    57    the entire resource is destroyed. Otherwise, it will be left in Consul.
    58    Defaults to false.
    59  
    60  ### Deprecated `key` arguments
    61  
    62  Prior to Terraform 0.7, this resource was used both to read *and* write the
    63  Consul key/value store. The read functionality has moved to the `consul_keys`
    64  *data source*, whose documentation can be found via the navigation.
    65  
    66  The pre-0.7 interface for reading keys is still supported for backward compatibility,
    67  but will be removed in a future version of Terraform.
    68  
    69  ## Attributes Reference
    70  
    71  The following attributes are exported:
    72  
    73  * `datacenter` - The datacenter the keys are being written to.