Hetzner Cloud v1.22.0 published on Wednesday, Feb 26, 2025 by Pulumi
hcloud.getLoadBalancers
Explore with Pulumi AI
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, &hcloud.GetLoadBalancersArgs{}, 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)
public static Output<GetLoadBalancersResult> getLoadBalancers(GetLoadBalancersArgs args, InvokeOptions options)
fn::invoke:
  function: hcloud:index/getLoadBalancers:getLoadBalancers
  arguments:
    # arguments dictionaryThe following arguments are supported:
- WithSelector string
- Label selector
- WithSelector string
- Label selector
- withSelector String
- Label selector
- withSelector string
- Label selector
- withSelector String
- Label selector
getLoadBalancers Result
The following output properties are available:
- Id string
- The provider-assigned unique ID for this managed resource.
- LoadBalancers List<Pulumi.HCloud. Outputs. Get Load Balancers Load Balancer> 
- (list) List of all matching load balancers. See data.hcloud_load_balancerfor schema.
- WithSelector string
- Id string
- The provider-assigned unique ID for this managed resource.
- LoadBalancers []GetLoad Balancers Load Balancer 
- (list) List of all matching load balancers. See data.hcloud_load_balancerfor schema.
- WithSelector string
- id String
- The provider-assigned unique ID for this managed resource.
- loadBalancers List<GetLoad Balancers Load Balancer> 
- (list) List of all matching load balancers. See data.hcloud_load_balancerfor schema.
- withSelector String
- id string
- The provider-assigned unique ID for this managed resource.
- loadBalancers GetLoad Balancers Load Balancer[] 
- (list) List of all matching load balancers. See data.hcloud_load_balancerfor schema.
- withSelector string
- id str
- The provider-assigned unique ID for this managed resource.
- load_balancers Sequence[GetLoad Balancers Load Balancer] 
- (list) List of all matching load balancers. See data.hcloud_load_balancerfor 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_balancerfor schema.
- withSelector String
Supporting Types
GetLoadBalancersLoadBalancer    
- Algorithms
List<Pulumi.HCloud. Inputs. Get Load Balancers Load Balancer Algorithm> 
- DeleteProtection bool
- Id int
- Ipv4 string
- Ipv6 string
- Labels Dictionary<string, string>
- LoadBalancer stringType 
- Location string
- NetworkId int
- NetworkIp string
- NetworkZone string
- Services
List<Pulumi.HCloud. Inputs. Get Load Balancers Load Balancer Service> 
- Targets
List<Pulumi.HCloud. Inputs. Get Load Balancers Load Balancer Target> 
- Name string
- Algorithms
[]GetLoad Balancers Load Balancer Algorithm 
- DeleteProtection bool
- Id int
- Ipv4 string
- Ipv6 string
- Labels map[string]string
- LoadBalancer stringType 
- Location string
- NetworkId int
- NetworkIp string
- NetworkZone string
- Services
[]GetLoad Balancers Load Balancer Service 
- Targets
[]GetLoad Balancers Load Balancer Target 
- Name string
- algorithms
List<GetLoad Balancers Load Balancer Algorithm> 
- deleteProtection Boolean
- id Integer
- ipv4 String
- ipv6 String
- labels Map<String,String>
- loadBalancer StringType 
- location String
- networkId Integer
- networkIp String
- networkZone String
- services
List<GetLoad Balancers Load Balancer Service> 
- targets
List<GetLoad Balancers Load Balancer Target> 
- name String
- algorithms
GetLoad Balancers Load Balancer Algorithm[] 
- deleteProtection boolean
- id number
- ipv4 string
- ipv6 string
- labels {[key: string]: string}
- loadBalancer stringType 
- location string
- networkId number
- networkIp string
- networkZone string
- services
GetLoad Balancers Load Balancer Service[] 
- targets
GetLoad Balancers Load Balancer Target[] 
- name string
- algorithms
Sequence[GetLoad Balancers Load Balancer Algorithm] 
- delete_protection bool
- id int
- ipv4 str
- ipv6 str
- labels Mapping[str, str]
- load_balancer_ strtype 
- location str
- network_id int
- network_ip str
- network_zone str
- services
Sequence[GetLoad Balancers Load Balancer Service] 
- targets
Sequence[GetLoad Balancers Load Balancer Target] 
- name str
- algorithms List<Property Map>
- deleteProtection Boolean
- id Number
- ipv4 String
- ipv6 String
- labels Map<String>
- loadBalancer StringType 
- location String
- networkId Number
- networkIp String
- networkZone String
- services List<Property Map>
- targets List<Property Map>
- name String
GetLoadBalancersLoadBalancerAlgorithm     
- Type string
- Type string
- type String
- type string
- type str
- type String
GetLoadBalancersLoadBalancerService     
- destinationPort Number
- healthChecks List<Property Map>
- https List<Property Map>
- listenPort Number
- protocol String
- proxyprotocol Boolean
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>
- int
- string
- RedirectHttp bool
- StickySessions bool
- Certificates []string
- int
- string
- RedirectHttp bool
- StickySessions bool
- certificates List<String>
- Integer
- String
- redirectHttp Boolean
- stickySessions Boolean
- certificates string[]
- number
- string
- redirectHttp boolean
- stickySessions boolean
- certificates Sequence[str]
- int
- str
- redirect_http bool
- sticky_sessions bool
- certificates List<String>
- Number
- 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
- label_selector str
- server_id int
- type str
- 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 hcloudTerraform Provider.