Ready to level-up your engineering skills? Join a Pulumi Workshop. Register Now

GetLoadBalancer

Provides details about a specific Hetzner Cloud Server.

Example Usage

using Pulumi;
using HCloud = Pulumi.HCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var lb1 = Output.Create(HCloud.GetLoadBalancer.InvokeAsync(new HCloud.GetLoadBalancerArgs
        {
            Name = "my-load-balancer",
        }));
        var lb2 = Output.Create(HCloud.GetLoadBalancer.InvokeAsync(new HCloud.GetLoadBalancerArgs
        {
            Id = 123,
        }));
        var lb3 = Output.Create(HCloud.GetLoadBalancer.InvokeAsync(new HCloud.GetLoadBalancerArgs
        {
            WithSelector = "key=value",
        }));
    }

}
package main

import (
    "github.com/pulumi/pulumi-hcloud/sdk/go/hcloud"
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        opt0 := "my-load-balancer"
        _, err := hcloud.LookupLoadBalancer(ctx, &hcloud.LookupLoadBalancerArgs{
            Name: &opt0,
        }, nil)
        if err != nil {
            return err
        }
        opt1 := 123
        _, err = hcloud.LookupLoadBalancer(ctx, &hcloud.LookupLoadBalancerArgs{
            Id: &opt1,
        }, nil)
        if err != nil {
            return err
        }
        opt2 := "key=value"
        _, err = hcloud.LookupLoadBalancer(ctx, &hcloud.LookupLoadBalancerArgs{
            WithSelector: &opt2,
        }, nil)
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_hcloud as hcloud

lb1 = hcloud.get_load_balancer(name="my-load-balancer")
lb2 = hcloud.get_load_balancer(id=123)
lb3 = hcloud.get_load_balancer(with_selector="key=value")
import * as pulumi from "@pulumi/pulumi";
import * as hcloud from "@pulumi/hcloud";

const lb1 = pulumi.output(hcloud.getLoadBalancer({
    name: "my-load-balancer",
}, { async: true }));
const lb2 = pulumi.output(hcloud.getLoadBalancer({
    id: 123,
}, { async: true }));
const lb3 = pulumi.output(hcloud.getLoadBalancer({
    withSelector: "key=value",
}, { async: true }));

Using GetLoadBalancer

function getLoadBalancer(args: GetLoadBalancerArgs, opts?: InvokeOptions): Promise<GetLoadBalancerResult>
def get_load_balancer(id: Optional[int] = None, name: Optional[str] = None, with_selector: Optional[str] = None, opts: Optional[InvokeOptions] = None) -> GetLoadBalancerResult
func LookupLoadBalancer(ctx *Context, args *LookupLoadBalancerArgs, opts ...InvokeOption) (*LookupLoadBalancerResult, error)

Note: This function is named LookupLoadBalancer in the Go SDK.

public static class GetLoadBalancer {
    public static Task<GetLoadBalancerResult> InvokeAsync(GetLoadBalancerArgs args, InvokeOptions? opts = null)
}

The following arguments are supported:

Id int

ID of the Load Balancer.

Name string

Name of the Load Balancer.

WithSelector string

Label Selector. For more information about possible values, visit the Hetzner Cloud Documentation.

Id int

ID of the Load Balancer.

Name string

Name of the Load Balancer.

WithSelector string

Label Selector. For more information about possible values, visit the Hetzner Cloud Documentation.

id number

ID of the Load Balancer.

name string

Name of the Load Balancer.

withSelector string

Label Selector. For more information about possible values, visit the Hetzner Cloud Documentation.

id int

ID of the Load Balancer.

name str

Name of the Load Balancer.

with_selector str

Label Selector. For more information about possible values, visit the Hetzner Cloud Documentation.

GetLoadBalancer Result

The following output properties are available:

Algorithms List<Pulumi.HCloud.Outputs.GetLoadBalancerAlgorithm>

(Optional) Configuration of the algorithm the Load Balancer use.

Id int

(int) Unique ID of the Load Balancer.

Ipv4 string

(string) IPv4 Address of the Load Balancer.

Ipv6 string

(string) IPv4 Address of the Load Balancer.

Labels Dictionary<string, object>

(map) User-defined labels (key-value pairs) .

LoadBalancerType string

(string) Name of the Type of the Load Balancer.

Location string

(string) Name of the location the Load Balancer is in.

NetworkZone string
Services List<Pulumi.HCloud.Outputs.GetLoadBalancerService>

(list) List of services a Load Balancer provides.

Targets List<Pulumi.HCloud.Outputs.GetLoadBalancerTarget>

(list) List of targets of the Load Balancer.

Name string

(string) Name of the Load Balancer.

WithSelector string
Algorithms []GetLoadBalancerAlgorithm

(Optional) Configuration of the algorithm the Load Balancer use.

Id int

(int) Unique ID of the Load Balancer.

Ipv4 string

(string) IPv4 Address of the Load Balancer.

Ipv6 string

(string) IPv4 Address of the Load Balancer.

Labels map[string]interface{}

(map) User-defined labels (key-value pairs) .

LoadBalancerType string

(string) Name of the Type of the Load Balancer.

Location string

(string) Name of the location the Load Balancer is in.

NetworkZone string
Services []GetLoadBalancerServiceType

(list) List of services a Load Balancer provides.

Targets []GetLoadBalancerTargetType

(list) List of targets of the Load Balancer.

Name string

(string) Name of the Load Balancer.

WithSelector string
algorithms GetLoadBalancerAlgorithm[]

(Optional) Configuration of the algorithm the Load Balancer use.

id number

(int) Unique ID of the Load Balancer.

ipv4 string

(string) IPv4 Address of the Load Balancer.

ipv6 string

(string) IPv4 Address of the Load Balancer.

labels {[key: string]: any}

(map) User-defined labels (key-value pairs) .

loadBalancerType string

(string) Name of the Type of the Load Balancer.

location string

(string) Name of the location the Load Balancer is in.

networkZone string
services GetLoadBalancerService[]

(list) List of services a Load Balancer provides.

targets GetLoadBalancerTarget[]

(list) List of targets of the Load Balancer.

name string

(string) Name of the Load Balancer.

withSelector string
algorithms Sequence[GetLoadBalancerAlgorithm]

(Optional) Configuration of the algorithm the Load Balancer use.

id int

(int) Unique ID of the Load Balancer.

ipv4 str

(string) IPv4 Address of the Load Balancer.

ipv6 str

(string) IPv4 Address of the Load Balancer.

labels Mapping[str, Any]

(map) User-defined labels (key-value pairs) .

load_balancer_type str

(string) Name of the Type of the Load Balancer.

location str

(string) Name of the location the Load Balancer is in.

network_zone str
services Sequence[GetLoadBalancerService]

(list) List of services a Load Balancer provides.

targets Sequence[GetLoadBalancerTarget]

(list) List of targets of the Load Balancer.

name str

(string) Name of the Load Balancer.

with_selector str

Supporting Types

GetLoadBalancerAlgorithm

Type string

(string) Type of the target. server or label_selector

Type string

(string) Type of the target. server or label_selector

type string

(string) Type of the target. server or label_selector

type str

(string) Type of the target. server or label_selector

GetLoadBalancerService

DestinationPort int

(int) Port the service connects to the targets on. Can be everything between 1 and 65535.

HealthChecks List<Pulumi.HCloud.Inputs.GetLoadBalancerServiceHealthCheckArgs>

(list) List of http configurations when protocol is http or https.

Https List<Pulumi.HCloud.Inputs.GetLoadBalancerServiceHttpArgs>

(list) List of http configurations when protocol is http or https.

ListenPort int

(int) Port the service listen on. Can be everything between1and65535`. Must be unique per Load Balancer.

Protocol string

(string) Protocol the health check uses. http, https or tcp

Proxyprotocol bool

(bool) Enable proxyprotocol.

DestinationPort int

(int) Port the service connects to the targets on. Can be everything between 1 and 65535.

HealthChecks []GetLoadBalancerServiceHealthCheck

(list) List of http configurations when protocol is http or https.

Https []GetLoadBalancerServiceHttp

(list) List of http configurations when protocol is http or https.

ListenPort int

(int) Port the service listen on. Can be everything between1and65535`. Must be unique per Load Balancer.

Protocol string

(string) Protocol the health check uses. http, https or tcp

Proxyprotocol bool

(bool) Enable proxyprotocol.

destinationPort number

(int) Port the service connects to the targets on. Can be everything between 1 and 65535.

healthChecks GetLoadBalancerServiceHealthCheck[]

(list) List of http configurations when protocol is http or https.

https GetLoadBalancerServiceHttp[]

(list) List of http configurations when protocol is http or https.

listenPort number

(int) Port the service listen on. Can be everything between1and65535`. Must be unique per Load Balancer.

protocol string

(string) Protocol the health check uses. http, https or tcp

proxyprotocol boolean

(bool) Enable proxyprotocol.

destination_port int

(int) Port the service connects to the targets on. Can be everything between 1 and 65535.

health_checks Sequence[GetLoadBalancerServiceHealthCheckArgs]

(list) List of http configurations when protocol is http or https.

https Sequence[GetLoadBalancerServiceHttpArgs]

(list) List of http configurations when protocol is http or https.

listen_port int

(int) Port the service listen on. Can be everything between1and65535`. Must be unique per Load Balancer.

protocol str

(string) Protocol the health check uses. http, https or tcp

proxyprotocol bool

(bool) Enable proxyprotocol.

GetLoadBalancerServiceHealthCheck

Https List<Pulumi.HCloud.Inputs.GetLoadBalancerServiceHealthCheckHttpArgs>

(list) List of http configurations when protocol is http or https.

Interval int

(int) Interval how often the health check will be performed, in seconds.

Port int

(int) Port the health check tries to connect to. Can be everything between 1 and 65535.

Protocol string

(string) Protocol the health check uses. http, https or tcp

Retries int

(int) Number of tries a health check will be performed until a target will be listed as unhealthy.

Timeout int

(int) Timeout when a health check try will be canceled if there is no response, in seconds.

Https []GetLoadBalancerServiceHealthCheckHttp

(list) List of http configurations when protocol is http or https.

Interval int

(int) Interval how often the health check will be performed, in seconds.

Port int

(int) Port the health check tries to connect to. Can be everything between 1 and 65535.

Protocol string

(string) Protocol the health check uses. http, https or tcp

Retries int

(int) Number of tries a health check will be performed until a target will be listed as unhealthy.

Timeout int

(int) Timeout when a health check try will be canceled if there is no response, in seconds.

https GetLoadBalancerServiceHealthCheckHttp[]

(list) List of http configurations when protocol is http or https.

interval number

(int) Interval how often the health check will be performed, in seconds.

port number

(int) Port the health check tries to connect to. Can be everything between 1 and 65535.

protocol string

(string) Protocol the health check uses. http, https or tcp

retries number

(int) Number of tries a health check will be performed until a target will be listed as unhealthy.

timeout number

(int) Timeout when a health check try will be canceled if there is no response, in seconds.

https Sequence[GetLoadBalancerServiceHealthCheckHttpArgs]

(list) List of http configurations when protocol is http or https.

interval int

(int) Interval how often the health check will be performed, in seconds.

port int

(int) Port the health check tries to connect to. Can be everything between 1 and 65535.

protocol str

(string) Protocol the health check uses. http, https or tcp

retries int

(int) Number of tries a health check will be performed until a target will be listed as unhealthy.

timeout int

(int) Timeout when a health check try will be canceled if there is no response, in seconds.

GetLoadBalancerServiceHealthCheckHttp

Domain string

string) Domain we try to access when performing the Health Check.

Path string

(string) Path we try to access when performing the Health Check.

Response string

(string) Response we expect to be included in the Target response when a Health Check was performed.

StatusCodes List<int>

(list[int]) We expect that the target answers with these status codes. If not the target is marked as unhealthy.

Tls bool

(bool) Enable TLS certificate checking.

Domain string

string) Domain we try to access when performing the Health Check.

Path string

(string) Path we try to access when performing the Health Check.

Response string

(string) Response we expect to be included in the Target response when a Health Check was performed.

StatusCodes []int

(list[int]) We expect that the target answers with these status codes. If not the target is marked as unhealthy.

Tls bool

(bool) Enable TLS certificate checking.

domain string

string) Domain we try to access when performing the Health Check.

path string

(string) Path we try to access when performing the Health Check.

response string

(string) Response we expect to be included in the Target response when a Health Check was performed.

statusCodes number[]

(list[int]) We expect that the target answers with these status codes. If not the target is marked as unhealthy.

tls boolean

(bool) Enable TLS certificate checking.

domain str

string) Domain we try to access when performing the Health Check.

path str

(string) Path we try to access when performing the Health Check.

response str

(string) Response we expect to be included in the Target response when a Health Check was performed.

status_codes Sequence[int]

(list[int]) We expect that the target answers with these status codes. If not the target is marked as unhealthy.

tls bool

(bool) Enable TLS certificate checking.

GetLoadBalancerServiceHttp

Certificates List<string>

(list[int]) List of IDs from certificates which the Load Balancer has.

CookieLifetime int

(int) Lifetime of the cookie for sticky session (in seconds).

CookieName string

(string) Name of the cookie for sticky session.

RedirectHttp bool

(string) Determine if all requests from port 80 should be redirected to port 443.

StickySessions bool

(string) Determine if sticky sessions are enabled or not.

Certificates []string

(list[int]) List of IDs from certificates which the Load Balancer has.

CookieLifetime int

(int) Lifetime of the cookie for sticky session (in seconds).

CookieName string

(string) Name of the cookie for sticky session.

RedirectHttp bool

(string) Determine if all requests from port 80 should be redirected to port 443.

StickySessions bool

(string) Determine if sticky sessions are enabled or not.

certificates string[]

(list[int]) List of IDs from certificates which the Load Balancer has.

cookieLifetime number

(int) Lifetime of the cookie for sticky session (in seconds).

cookieName string

(string) Name of the cookie for sticky session.

redirectHttp boolean

(string) Determine if all requests from port 80 should be redirected to port 443.

stickySessions boolean

(string) Determine if sticky sessions are enabled or not.

certificates Sequence[str]

(list[int]) List of IDs from certificates which the Load Balancer has.

cookie_lifetime int

(int) Lifetime of the cookie for sticky session (in seconds).

cookie_name str

(string) Name of the cookie for sticky session.

redirect_http bool

(string) Determine if all requests from port 80 should be redirected to port 443.

sticky_sessions bool

(string) Determine if sticky sessions are enabled or not.

GetLoadBalancerTarget

LabelSelector string

(string) Label Selector to add a group of resources based on the label.

ServerId int

(int) ID of the server which should be a target for this Load Balancer.

Type string

(string) Type of the target. server or label_selector

LabelSelector string

(string) Label Selector to add a group of resources based on the label.

ServerId int

(int) ID of the server which should be a target for this Load Balancer.

Type string

(string) Type of the target. server or label_selector

labelSelector string

(string) Label Selector to add a group of resources based on the label.

serverId number

(int) ID of the server which should be a target for this Load Balancer.

type string

(string) Type of the target. server or label_selector

label_selector str

(string) Label Selector to add a group of resources based on the label.

server_id int

(int) ID of the server which should be a target for this Load Balancer.

type str

(string) Type of the target. server or label_selector

Package Details

Repository
https://github.com/pulumi/pulumi-hcloud
License
Apache-2.0
Notes
This Pulumi package is based on the hcloud Terraform Provider.