Consul v3.12.1 published on Friday, Aug 23, 2024 by Pulumi
consul.getAutopilotHealth
Explore with Pulumi AI
The consul.getAutopilotHealth
data source returns
autopilot health information
about the current Consul cluster.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as consul from "@pulumi/consul";
const read = consul.getAutopilotHealth({});
export const health = read.then(read => read.healthy);
import pulumi
import pulumi_consul as consul
read = consul.get_autopilot_health()
pulumi.export("health", read.healthy)
package main
import (
"github.com/pulumi/pulumi-consul/sdk/v3/go/consul"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
read, err := consul.GetAutopilotHealth(ctx, nil, nil)
if err != nil {
return err
}
ctx.Export("health", read.Healthy)
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Consul = Pulumi.Consul;
return await Deployment.RunAsync(() =>
{
var read = Consul.GetAutopilotHealth.Invoke();
return new Dictionary<string, object?>
{
["health"] = read.Apply(getAutopilotHealthResult => getAutopilotHealthResult.Healthy),
};
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.consul.ConsulFunctions;
import com.pulumi.consul.inputs.GetAutopilotHealthArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var read = ConsulFunctions.getAutopilotHealth();
ctx.export("health", read.applyValue(getAutopilotHealthResult -> getAutopilotHealthResult.healthy()));
}
}
variables:
read:
fn::invoke:
Function: consul:getAutopilotHealth
Arguments: {}
outputs:
health: ${read.healthy}
Using getAutopilotHealth
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getAutopilotHealth(args: GetAutopilotHealthArgs, opts?: InvokeOptions): Promise<GetAutopilotHealthResult>
function getAutopilotHealthOutput(args: GetAutopilotHealthOutputArgs, opts?: InvokeOptions): Output<GetAutopilotHealthResult>
def get_autopilot_health(datacenter: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetAutopilotHealthResult
def get_autopilot_health_output(datacenter: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetAutopilotHealthResult]
func GetAutopilotHealth(ctx *Context, args *GetAutopilotHealthArgs, opts ...InvokeOption) (*GetAutopilotHealthResult, error)
func GetAutopilotHealthOutput(ctx *Context, args *GetAutopilotHealthOutputArgs, opts ...InvokeOption) GetAutopilotHealthResultOutput
> Note: This function is named GetAutopilotHealth
in the Go SDK.
public static class GetAutopilotHealth
{
public static Task<GetAutopilotHealthResult> InvokeAsync(GetAutopilotHealthArgs args, InvokeOptions? opts = null)
public static Output<GetAutopilotHealthResult> Invoke(GetAutopilotHealthInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetAutopilotHealthResult> getAutopilotHealth(GetAutopilotHealthArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: consul:index/getAutopilotHealth:getAutopilotHealth
arguments:
# arguments dictionary
The following arguments are supported:
- Datacenter string
- The datacenter to use. This overrides the agent's default datacenter and the datacenter in the provider setup.
- Datacenter string
- The datacenter to use. This overrides the agent's default datacenter and the datacenter in the provider setup.
- datacenter String
- The datacenter to use. This overrides the agent's default datacenter and the datacenter in the provider setup.
- datacenter string
- The datacenter to use. This overrides the agent's default datacenter and the datacenter in the provider setup.
- datacenter str
- The datacenter to use. This overrides the agent's default datacenter and the datacenter in the provider setup.
- datacenter String
- The datacenter to use. This overrides the agent's default datacenter and the datacenter in the provider setup.
getAutopilotHealth Result
The following output properties are available:
- Failure
Tolerance int - The number of redundant healthy servers that could fail without causing an outage
- Healthy bool
- Whether the server is healthy according to the current Autopilot configuration
- Id string
- The provider-assigned unique ID for this managed resource.
- Servers
List<Get
Autopilot Health Server> - A list of server health information. See below for details on the available information.
- Datacenter string
- Failure
Tolerance int - The number of redundant healthy servers that could fail without causing an outage
- Healthy bool
- Whether the server is healthy according to the current Autopilot configuration
- Id string
- The provider-assigned unique ID for this managed resource.
- Servers
[]Get
Autopilot Health Server - A list of server health information. See below for details on the available information.
- Datacenter string
- failure
Tolerance Integer - The number of redundant healthy servers that could fail without causing an outage
- healthy Boolean
- Whether the server is healthy according to the current Autopilot configuration
- id String
- The provider-assigned unique ID for this managed resource.
- servers
List<Get
Autopilot Health Server> - A list of server health information. See below for details on the available information.
- datacenter String
- failure
Tolerance number - The number of redundant healthy servers that could fail without causing an outage
- healthy boolean
- Whether the server is healthy according to the current Autopilot configuration
- id string
- The provider-assigned unique ID for this managed resource.
- servers
Get
Autopilot Health Server[] - A list of server health information. See below for details on the available information.
- datacenter string
- failure_
tolerance int - The number of redundant healthy servers that could fail without causing an outage
- healthy bool
- Whether the server is healthy according to the current Autopilot configuration
- id str
- The provider-assigned unique ID for this managed resource.
- servers
Sequence[Get
Autopilot Health Server] - A list of server health information. See below for details on the available information.
- datacenter str
- failure
Tolerance Number - The number of redundant healthy servers that could fail without causing an outage
- healthy Boolean
- Whether the server is healthy according to the current Autopilot configuration
- id String
- The provider-assigned unique ID for this managed resource.
- servers List<Property Map>
- A list of server health information. See below for details on the available information.
- datacenter String
Supporting Types
GetAutopilotHealthServer
- Address string
- The address of the server
- Healthy bool
- Whether the server is healthy according to the current Autopilot configuration
- Id string
- The Raft ID of the server
- Last
Contact string - The time elapsed since the server's last contact with the leader
- Last
Index int - The index of the server's last committed Raft log entry
- Last
Term int - The server's last known Raft leader term
- Leader bool
- Whether the server is currently leader
- Name string
- The node name of the server
- Serf
Status string - The status of the SerfHealth check of the server
- Stable
Since string - The time this server has been in its current
Healthy
state - Version string
- The Consul version of the server
- Voter bool
- Whether the server is a voting member of the Raft cluster
- Address string
- The address of the server
- Healthy bool
- Whether the server is healthy according to the current Autopilot configuration
- Id string
- The Raft ID of the server
- Last
Contact string - The time elapsed since the server's last contact with the leader
- Last
Index int - The index of the server's last committed Raft log entry
- Last
Term int - The server's last known Raft leader term
- Leader bool
- Whether the server is currently leader
- Name string
- The node name of the server
- Serf
Status string - The status of the SerfHealth check of the server
- Stable
Since string - The time this server has been in its current
Healthy
state - Version string
- The Consul version of the server
- Voter bool
- Whether the server is a voting member of the Raft cluster
- address String
- The address of the server
- healthy Boolean
- Whether the server is healthy according to the current Autopilot configuration
- id String
- The Raft ID of the server
- last
Contact String - The time elapsed since the server's last contact with the leader
- last
Index Integer - The index of the server's last committed Raft log entry
- last
Term Integer - The server's last known Raft leader term
- leader Boolean
- Whether the server is currently leader
- name String
- The node name of the server
- serf
Status String - The status of the SerfHealth check of the server
- stable
Since String - The time this server has been in its current
Healthy
state - version String
- The Consul version of the server
- voter Boolean
- Whether the server is a voting member of the Raft cluster
- address string
- The address of the server
- healthy boolean
- Whether the server is healthy according to the current Autopilot configuration
- id string
- The Raft ID of the server
- last
Contact string - The time elapsed since the server's last contact with the leader
- last
Index number - The index of the server's last committed Raft log entry
- last
Term number - The server's last known Raft leader term
- leader boolean
- Whether the server is currently leader
- name string
- The node name of the server
- serf
Status string - The status of the SerfHealth check of the server
- stable
Since string - The time this server has been in its current
Healthy
state - version string
- The Consul version of the server
- voter boolean
- Whether the server is a voting member of the Raft cluster
- address str
- The address of the server
- healthy bool
- Whether the server is healthy according to the current Autopilot configuration
- id str
- The Raft ID of the server
- last_
contact str - The time elapsed since the server's last contact with the leader
- last_
index int - The index of the server's last committed Raft log entry
- last_
term int - The server's last known Raft leader term
- leader bool
- Whether the server is currently leader
- name str
- The node name of the server
- serf_
status str - The status of the SerfHealth check of the server
- stable_
since str - The time this server has been in its current
Healthy
state - version str
- The Consul version of the server
- voter bool
- Whether the server is a voting member of the Raft cluster
- address String
- The address of the server
- healthy Boolean
- Whether the server is healthy according to the current Autopilot configuration
- id String
- The Raft ID of the server
- last
Contact String - The time elapsed since the server's last contact with the leader
- last
Index Number - The index of the server's last committed Raft log entry
- last
Term Number - The server's last known Raft leader term
- leader Boolean
- Whether the server is currently leader
- name String
- The node name of the server
- serf
Status String - The status of the SerfHealth check of the server
- stable
Since String - The time this server has been in its current
Healthy
state - version String
- The Consul version of the server
- voter Boolean
- Whether the server is a voting member of the Raft cluster
Package Details
- Repository
- HashiCorp Consul pulumi/pulumi-consul
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
consul
Terraform Provider.