The consul_agent_self data source returns configuration and status data from the agent specified in the provider.

Example Usage

data "consul_agent_self" "read-dc1-agent" {
  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
resource "example_resource" "app" {
  description = "Consul datacenter ${data.consul_agent_self.read-dc1-agent.datacenter}"

  # ...

Attributes Reference

The following attributes are exported:

DNS Attributes

Retry Join EC2 Attributes

Retry Join GCE Attributes

Telemetry Attributes

© 2018 HashiCorpLicensed under the MPL 2.0 License.