-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Push out the last of the docs and fixes for the `consul_catalog_nodes…
…` data source.
- Loading branch information
Showing
5 changed files
with
157 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
83 changes: 83 additions & 0 deletions
83
website/source/docs/providers/consul/d/nodes.html.markdown
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
--- | ||
layout: "consul" | ||
page_title: "Consul: consul_catalog_nodes" | ||
sidebar_current: "docs-consul-data-source-catalog-nodes" | ||
description: |- | ||
Provides a list of nodes in a given Consul datacenter. | ||
--- | ||
|
||
# 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 | ||
different datacenter in the `query_options` it is possible to retrieve a list of | ||
nodes from a different WAN-attached Consul datacenter. | ||
|
||
## Example Usage | ||
|
||
``` | ||
data "consul_catalog_nodes" "read-dc1-nodes" { | ||
# 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 | ||
resource "example_resource" "app" { | ||
description = "${join(" ", formatlist("%s", data.consul_catalog_nodes.node_names))}" | ||
... | ||
} | ||
``` | ||
|
||
## Argument Reference | ||
|
||
The following arguments are supported: | ||
|
||
* `datacenter` - (Optional) The Consul datacenter to query. Defaults to the | ||
same value found in `query_options` parameter specified below, or if that is | ||
empty, the `datacenter` value found in the Consul agent that this provider is | ||
configured to talk to. | ||
|
||
* `query_options` - (Optional) See below. | ||
|
||
The `query_options` block supports the following: | ||
|
||
* `allow_stale` - (Optional) When `true`, the default, allow responses from | ||
Consul servers that are followers. | ||
|
||
* `require_consistent` - (Optional) When `true` force the client to perform a | ||
read on at least quorum servers and verify the result is the same. Defaults | ||
to `false`. | ||
|
||
* `token` - (Optional) Specify the Consul ACL token to use when performing the | ||
request. This defaults to the same API token configured by the `consul` | ||
provider but may be overriden if necessary. | ||
|
||
* `wait_index` - (Optional) Index number used to enable blocking quereis. | ||
|
||
* `wait_time` - (Optional) Max time the client should wait for a blocking query | ||
to return. | ||
|
||
## Attributes Reference | ||
|
||
The following attributes are exported: | ||
|
||
* `datacenter` - The datacenter the keys are being read from to. | ||
* `node_ids` - A list of the Consul node IDs. | ||
* `node_names` - A list of the Consul node names. | ||
* `nodes` - A list of nodes and details about each Consul agent. The list of | ||
per-node attributes is detailed below. | ||
|
||
The following is a list of the per-node attributes contained within the `nodes` | ||
map: | ||
|
||
* `id` - The Node ID of the Consul agent. | ||
* [`meta`](https://www.consul.io/docs/agent/http/catalog.html#Meta) - Node meta | ||
data tag information, if any. | ||
* [`name`](https://www.consul.io/docs/agent/http/catalog.html#Node) - The name | ||
of the Consul node. | ||
* [`address`](https://www.consul.io/docs/agent/http/catalog.html#Address) - The | ||
IP address the node is advertising to the Consul cluster. | ||
* [`tagged_addresses`](https://www.consul.io/docs/agent/http/catalog.html#TaggedAddresses) - | ||
List of explicit LAN and WAN IP addresses for the agent. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters