Update consul provider

This commit is contained in:
Seth Vargo 2017-04-10 12:19:36 -04:00
parent 11ce92e9ca
commit 33483de62f
No known key found for this signature in database
GPG Key ID: C921994F9C27E0FF
13 changed files with 74 additions and 63 deletions

View File

@ -6,7 +6,7 @@ description: |-
Provides the configuration information of the local Consul agent.
---
# consul\_agent_\_self
# consul_agent__self
The `consul_agent_self` data source returns
[configuration and status data](https://www.consul.io/docs/agent/http/agent.html#agent_self)
@ -14,9 +14,12 @@ from the agent specified in the `provider`.
## Example Usage
```
```hcl
data "consul_agent_self" "read-dc1-agent" {
# query_options { # # Optional parameter: implicitly uses the current datacenter of the agent # datacenter = "dc1" # }
query_options {
# Optional parameter: implicitly uses the current datacenter of the agent
datacenter = "dc1"
}
}
# Set the description to a whitespace delimited list of the services

View File

@ -6,14 +6,14 @@ description: |-
Reads values from the Consul key/value store.
---
# consul\_keys
# consul_keys
The `consul_keys` resource reads values from the Consul key/value store.
This is a powerful way dynamically set values in templates.
## Example Usage
```
```hcl
data "consul_keys" "app" {
datacenter = "nyc1"
token = "abcd"

View File

@ -6,7 +6,7 @@ description: |-
Provides a list of nodes in a given Consul datacenter.
---
# consul\_catalog\_nodes
# consul_catalog_nodes
The `consul_catalog_nodes` data source returns a list of Consul nodes that have
been registered with the Consul cluster in a given datacenter. By specifying a
@ -15,9 +15,12 @@ nodes from a different WAN-attached Consul datacenter.
## Example Usage
```
```hcl
data "consul_catalog_nodes" "read-dc1-nodes" {
# query_options { # # Optional parameter: implicitly uses the current datacenter of the agent # datacenter = "dc1" # }
query_options {
# Optional parameter: implicitly uses the current datacenter of the agent
datacenter = "dc1"
}
}
# Set the description to a whitespace delimited list of the node names

View File

@ -6,7 +6,7 @@ description: |-
Provides details about a specific Consul service
---
# consul\_catalog\_service
# consul_catalog_service
`consul_catalog_service` provides details about a specific Consul service in a
given datacenter. The results include a list of nodes advertising the specified
@ -19,9 +19,12 @@ source, which provides a summary of the current Consul services.
## Example Usage
```
```hcl
data "consul_catalog_service" "read-consul-dc1" {
# query_options { # # Optional parameter: implicitly uses the current datacenter of the agent # datacenter = "dc1" # }
query_options {
# Optional parameter: implicitly uses the current datacenter of the agent
datacenter = "dc1"
}
name = "consul"
}

View File

@ -6,7 +6,7 @@ description: |-
Provides a list of services in a given Consul datacenter.
---
# consul\_catalog\_services
# consul_catalog_services
The `consul_catalog_services` data source returns a list of Consul services that
have been registered with the Consul cluster in a given datacenter. By
@ -18,9 +18,12 @@ source, which provides a detailed response about a specific Consul service.
## Example Usage
```
```hcl
data "consul_catalog_services" "read-dc1" {
# query_options { # # Optional parameter: implicitly uses the current datacenter of the agent # datacenter = "dc1" # }
query_options {
# Optional parameter: implicitly uses the current datacenter of the agent
datacenter = "dc1"
}
}
# Set the description to a whitespace delimited list of the services

View File

@ -17,7 +17,7 @@ Use the navigation to the left to read about the available resources.
## Example Usage
```
```hcl
# Configure the Consul provider
provider "consul" {
address = "demo.consul.io:80"
@ -51,4 +51,3 @@ The following arguments are supported:
* `ca_file` - (Optional) A path to a PEM-encoded certificate authority used to verify the remote agent's certificate.
* `cert_file` - (Optional) A path to a PEM-encoded certificate provided to the remote agent; requires use of `key_file`.
* `key_file`- (Optional) A path to a PEM-encoded private key, required if `cert_file` is specified.

View File

@ -6,7 +6,7 @@ description: |-
Provides access to Agent Service data in Consul. This can be used to define a service associated with a particular agent. Currently, defining health checks for an agent service is not supported.
---
# consul\_agent\_service
# consul_agent_service
Provides access to the agent service data in Consul. This can be used to
define a service associated with a particular agent. Currently, defining
@ -14,7 +14,7 @@ health checks for an agent service is not supported.
## Example Usage
```
```hcl
resource "consul_agent_service" "app" {
address = "www.google.com"
name = "google"

View File

@ -6,14 +6,14 @@ description: |-
Registers a node or service with the Consul Catalog. Currently, defining health checks is not supported.
---
# consul\_catalog\_entry
# consul_catalog_entry
Registers a node or service with the [Consul Catalog](https://www.consul.io/docs/agent/http/catalog.html#catalog_register).
Currently, defining health checks is not supported.
## Example Usage
```
```hcl
resource "consul_catalog_entry" "app" {
address = "192.168.10.10"
node = "foobar"

View File

@ -7,7 +7,7 @@ description: |-
common name prefix.
---
# consul\_key\_prefix
# consul_key_prefix
Allows Terraform to manage a "namespace" of Consul keys that share a common
name prefix.
@ -33,7 +33,7 @@ those keys were created outside of Terraform.
## Example Usage
```
```hcl
resource "consul_key_prefix" "myapp_config" {
datacenter = "nyc1"
token = "abcd"

View File

@ -6,7 +6,7 @@ description: |-
Writes values into the Consul key/value store.
---
# consul\_keys
# consul_keys
The `consul_keys` resource writes sets of individual values into Consul.
This is a powerful way to expose infrastructure details to clients.
@ -20,7 +20,7 @@ remove errant keys not present in the configuration, consider using the
## Example Usage
```
```hcl
resource "consul_keys" "app" {
datacenter = "nyc1"
token = "abcd"

View File

@ -6,14 +6,14 @@ description: |-
Provides access to Node data in Consul. This can be used to define a node.
---
# consul\_node
# consul_node
Provides access to Node data in Consul. This can be used to define a
node. Currently, defining health checks is not supported.
## Example Usage
```
```hcl
resource "consul_node" "foobar" {
address = "192.168.10.10"
name = "foobar"

View File

@ -6,7 +6,7 @@ description: |-
Allows Terraform to manage a Consul prepared query
---
# consul\_prepared\_query
# consul_prepared_query
Allows Terraform to manage a Consul prepared query.
@ -16,57 +16,57 @@ queries in your Consul cluster using Terraform.
## Example Usage
```
```hcl
# Creates a prepared query myquery.query.consul that finds the nearest
# healthy myapp.service.consul instance that has the active tag and not
# the standby tag.
resource "consul_prepared_query" "myapp-query" {
name = "myquery"
datacenter = "us-central1"
token = "abcd"
stored_token = "wxyz"
only_passing = true
near = "_agent"
name = "myquery"
datacenter = "us-central1"
token = "abcd"
stored_token = "wxyz"
only_passing = true
near = "_agent"
service = "myapp"
tags = ["active","!standby"]
service = "myapp"
tags = ["active", "!standby"]
failover {
nearest_n = 3
datacenters = ["us-west1", "us-east-2", "asia-east1"]
}
failover {
nearest_n = 3
datacenters = ["us-west1", "us-east-2", "asia-east1"]
}
dns {
ttl = "30s"
}
dns {
ttl = "30s"
}
}
# Creates a Prepared Query Template that matches *-near-self.query.consul
# and finds the nearest service that matches the glob character (e.g.
# foo-near-self.query.consul will find the nearest healthy foo.service.consul).
resource "consul_prepared_query" "service-near-self" {
datacenter = "nyc1"
token = "abcd"
stored_token = "wxyz"
name = ""
only_passing = true
near = "_agent"
datacenter = "nyc1"
token = "abcd"
stored_token = "wxyz"
name = ""
only_passing = true
near = "_agent"
template {
type = "name_prefix_match"
regexp = "^(.*)-near-self$"
}
template {
type = "name_prefix_match"
regexp = "^(.*)-near-self$"
}
service = "$${match(1)}"
service = "$${match(1)}"
failover {
nearest_n = 3
datacenters = ["dc2", "dc3", "dc4"]
}
failover {
nearest_n = 3
datacenters = ["dc2", "dc3", "dc4"]
}
dns {
ttl = "5m"
}
dns {
ttl = "5m"
}
}
```

View File

@ -6,14 +6,14 @@ description: |-
A high-level resource for creating a Service in Consul. Since Consul requires clients to register services with either the catalog or an agent, `consul_service` may register with either the catalog or an agent, depending on the configuration of `consul_service`. For now, `consul_service` always registers services with the agent running at the address defined in the `consul` resource. Health checks are not currently supported.
---
# consul\_service
# consul_service
A high-level resource for creating a Service in Consul. Currently,
defining health checks for a service is not supported.
## Example Usage
```
```hcl
resource "consul_service" "google" {
address = "www.google.com"
name = "google"