The consul_autopilot_health
data source returns
autopilot health information
about the current Consul cluster.
data "consul_autopilot_health" "read" {}
output "health" {
value = "${data.consul_autopilot_health.read.healthy}"
}
The following arguments are supported:
datacenter
- (Optional) The datacenter to use. This overrides the agent's
default datacenter and the datacenter in the provider setup.The following attributes are exported:
healthy
- Whether all the servers in the cluster are currently healthyfailure_tolerance
- The number of redundant healthy servers that could fail
without causing an outageservers
- A list of server health information. See below for details on the
available information.id
- The Raft ID of the servername
- The node name of the serveraddress
- The address of the serverserf_status
- The status of the SerfHealth check of the serverversion
- The Consul version of the serverleader
- Whether the server is currently leaderlast_contact
- The time elapsed since the server's last contact with
the leaderlast_term
- The server's last known Raft leader termlast_index
- The index of the server's last committed Raft log entryhealthy
- Whether the server is healthy according to the current Autopilot
configurationvoter
- Whether the server is a voting member of the Raft clusterstable_since
- The time this server has been in its current Healthy
state