1. Packages
  2. Hetzner Cloud
  3. API Docs
  4. getLoadBalancers
Hetzner Cloud v1.18.0 published on Wednesday, Mar 27, 2024 by Pulumi

hcloud.getLoadBalancers

Explore with Pulumi AI

hcloud logo
Hetzner Cloud v1.18.0 published on Wednesday, Mar 27, 2024 by Pulumi

    Provides details about multiple Hetzner Cloud Load Balancers.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as hcloud from "@pulumi/hcloud";
    
    const lb2 = hcloud.getLoadBalancers({});
    const lb3 = hcloud.getLoadBalancers({
        withSelector: "key=value",
    });
    
    import pulumi
    import pulumi_hcloud as hcloud
    
    lb2 = hcloud.get_load_balancers()
    lb3 = hcloud.get_load_balancers(with_selector="key=value")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-hcloud/sdk/go/hcloud"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := hcloud.GetLoadBalancers(ctx, nil, nil)
    		if err != nil {
    			return err
    		}
    		_, err = hcloud.GetLoadBalancers(ctx, &hcloud.GetLoadBalancersArgs{
    			WithSelector: pulumi.StringRef("key=value"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using HCloud = Pulumi.HCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var lb2 = HCloud.GetLoadBalancers.Invoke();
    
        var lb3 = HCloud.GetLoadBalancers.Invoke(new()
        {
            WithSelector = "key=value",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.hcloud.HcloudFunctions;
    import com.pulumi.hcloud.inputs.GetLoadBalancersArgs;
    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 lb2 = HcloudFunctions.getLoadBalancers();
    
            final var lb3 = HcloudFunctions.getLoadBalancers(GetLoadBalancersArgs.builder()
                .withSelector("key=value")
                .build());
    
        }
    }
    
    variables:
      lb2:
        fn::invoke:
          Function: hcloud:getLoadBalancers
          Arguments: {}
      lb3:
        fn::invoke:
          Function: hcloud:getLoadBalancers
          Arguments:
            withSelector: key=value
    

    Using getLoadBalancers

    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 getLoadBalancers(args: GetLoadBalancersArgs, opts?: InvokeOptions): Promise<GetLoadBalancersResult>
    function getLoadBalancersOutput(args: GetLoadBalancersOutputArgs, opts?: InvokeOptions): Output<GetLoadBalancersResult>
    def get_load_balancers(with_selector: Optional[str] = None,
                           opts: Optional[InvokeOptions] = None) -> GetLoadBalancersResult
    def get_load_balancers_output(with_selector: Optional[pulumi.Input[str]] = None,
                           opts: Optional[InvokeOptions] = None) -> Output[GetLoadBalancersResult]
    func GetLoadBalancers(ctx *Context, args *GetLoadBalancersArgs, opts ...InvokeOption) (*GetLoadBalancersResult, error)
    func GetLoadBalancersOutput(ctx *Context, args *GetLoadBalancersOutputArgs, opts ...InvokeOption) GetLoadBalancersResultOutput

    > Note: This function is named GetLoadBalancers in the Go SDK.

    public static class GetLoadBalancers 
    {
        public static Task<GetLoadBalancersResult> InvokeAsync(GetLoadBalancersArgs args, InvokeOptions? opts = null)
        public static Output<GetLoadBalancersResult> Invoke(GetLoadBalancersInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetLoadBalancersResult> getLoadBalancers(GetLoadBalancersArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: hcloud:index/getLoadBalancers:getLoadBalancers
      arguments:
        # arguments dictionary

    The following arguments are supported:

    getLoadBalancers Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    LoadBalancers List<Pulumi.HCloud.Outputs.GetLoadBalancersLoadBalancer>
    (list) List of all matching load balancers. See data.hcloud_load_balancer for schema.
    WithSelector string
    Id string
    The provider-assigned unique ID for this managed resource.
    LoadBalancers []GetLoadBalancersLoadBalancer
    (list) List of all matching load balancers. See data.hcloud_load_balancer for schema.
    WithSelector string
    id String
    The provider-assigned unique ID for this managed resource.
    loadBalancers List<GetLoadBalancersLoadBalancer>
    (list) List of all matching load balancers. See data.hcloud_load_balancer for schema.
    withSelector String
    id string
    The provider-assigned unique ID for this managed resource.
    loadBalancers GetLoadBalancersLoadBalancer[]
    (list) List of all matching load balancers. See data.hcloud_load_balancer for schema.
    withSelector string
    id str
    The provider-assigned unique ID for this managed resource.
    load_balancers Sequence[GetLoadBalancersLoadBalancer]
    (list) List of all matching load balancers. See data.hcloud_load_balancer for schema.
    with_selector str
    id String
    The provider-assigned unique ID for this managed resource.
    loadBalancers List<Property Map>
    (list) List of all matching load balancers. See data.hcloud_load_balancer for schema.
    withSelector String

    Supporting Types

    GetLoadBalancersLoadBalancer

    GetLoadBalancersLoadBalancerAlgorithm

    Type string
    Type string
    type String
    type string
    type str
    type String

    GetLoadBalancersLoadBalancerService

    GetLoadBalancersLoadBalancerServiceHealthCheck

    GetLoadBalancersLoadBalancerServiceHealthCheckHttp

    Domain string
    Path string
    Response string
    StatusCodes List<int>
    Tls bool
    Domain string
    Path string
    Response string
    StatusCodes []int
    Tls bool
    domain String
    path String
    response String
    statusCodes List<Integer>
    tls Boolean
    domain string
    path string
    response string
    statusCodes number[]
    tls boolean
    domain str
    path str
    response str
    status_codes Sequence[int]
    tls bool
    domain String
    path String
    response String
    statusCodes List<Number>
    tls Boolean

    GetLoadBalancersLoadBalancerServiceHttp

    certificates List<String>
    cookieLifetime Integer
    cookieName String
    redirectHttp Boolean
    stickySessions Boolean
    certificates List<String>
    cookieLifetime Number
    cookieName String
    redirectHttp Boolean
    stickySessions Boolean

    GetLoadBalancersLoadBalancerTarget

    LabelSelector string
    ServerId int
    Type string
    LabelSelector string
    ServerId int
    Type string
    labelSelector String
    serverId Integer
    type String
    labelSelector string
    serverId number
    type string
    labelSelector String
    serverId Number
    type String

    Package Details

    Repository
    Hetzner Cloud pulumi/pulumi-hcloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the hcloud Terraform Provider.
    hcloud logo
    Hetzner Cloud v1.18.0 published on Wednesday, Mar 27, 2024 by Pulumi