1. Packages
  2. HashiCorp Consul
  3. API Docs
  4. getAutopilotHealth
Consul v3.11.3 published on Friday, May 24, 2024 by Pulumi

consul.getAutopilotHealth

Explore with Pulumi AI

consul logo
Consul v3.11.3 published on Friday, May 24, 2024 by Pulumi

    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:

    FailureTolerance 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<GetAutopilotHealthServer>
    A list of server health information. See below for details on the available information.
    Datacenter string
    FailureTolerance 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 []GetAutopilotHealthServer
    A list of server health information. See below for details on the available information.
    Datacenter string
    failureTolerance 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<GetAutopilotHealthServer>
    A list of server health information. See below for details on the available information.
    datacenter String
    failureTolerance 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 GetAutopilotHealthServer[]
    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[GetAutopilotHealthServer]
    A list of server health information. See below for details on the available information.
    datacenter str
    failureTolerance 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
    LastContact string
    The time elapsed since the server's last contact with the leader
    LastIndex int
    The index of the server's last committed Raft log entry
    LastTerm 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
    SerfStatus string
    The status of the SerfHealth check of the server
    StableSince 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
    LastContact string
    The time elapsed since the server's last contact with the leader
    LastIndex int
    The index of the server's last committed Raft log entry
    LastTerm 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
    SerfStatus string
    The status of the SerfHealth check of the server
    StableSince 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
    lastContact String
    The time elapsed since the server's last contact with the leader
    lastIndex Integer
    The index of the server's last committed Raft log entry
    lastTerm 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
    serfStatus String
    The status of the SerfHealth check of the server
    stableSince 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
    lastContact string
    The time elapsed since the server's last contact with the leader
    lastIndex number
    The index of the server's last committed Raft log entry
    lastTerm 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
    serfStatus string
    The status of the SerfHealth check of the server
    stableSince 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
    lastContact String
    The time elapsed since the server's last contact with the leader
    lastIndex Number
    The index of the server's last committed Raft log entry
    lastTerm 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
    serfStatus String
    The status of the SerfHealth check of the server
    stableSince 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.
    consul logo
    Consul v3.11.3 published on Friday, May 24, 2024 by Pulumi