terraform/website/source/docs/providers/consul/d/agent_self.html.markdown

9.8 KiB

layout page_title sidebar_current description
consul Consul: consul_agent_self docs-consul-data-source-agent-self Provides the configuration information of the local Consul agent.

consul_agent__self

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