Pulumi Official
Package maintained by Pulumi
v2.2.4 published on Friday, Jul 29, 2022 by Pulumi


Get information on a load balancer for use in other resources. This data source provides all of the load balancers properties as configured on your Civo account.

An error will be raised if the provided load balancer name does not exist in your Civo account.

Example Usage

using Pulumi;
using Civo = Pulumi.Civo;

class MyStack : Stack
    public MyStack()
        var my_lb = Output.Create(Civo.GetLoadBalancer.InvokeAsync(new Civo.GetLoadBalancerArgs
            Name = "lb-name",
            Region = "LON1",
        this.CivoLoadbalancerOutput = my_lb.Apply(my_lb => my_lb.PublicIp);

    public Output<string> CivoLoadbalancerOutput { get; set; }
package main

import (

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		my_lb, err := civo.GetLoadBalancer(ctx, &GetLoadBalancerArgs{
			Name:   pulumi.StringRef("lb-name"),
			Region: pulumi.StringRef("LON1"),
		}, nil)
		if err != nil {
			return err
		ctx.Export("civoLoadbalancerOutput", my_lb.PublicIp)
		return nil
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.civo.CivoFunctions;
import com.pulumi.civo.inputs.GetLoadBalancerArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {;

    public static void stack(Context ctx) {
        final var my-lb = CivoFunctions.getLoadBalancer(GetLoadBalancerArgs.builder()

        ctx.export("civoLoadbalancerOutput", my_lb.publicIp());
import pulumi
import pulumi_civo as civo

my_lb = civo.get_load_balancer(name="lb-name",
pulumi.export("civoLoadbalancerOutput", my_lb.public_ip)
import * as pulumi from "@pulumi/pulumi";
import * as civo from "@pulumi/civo";

const my-lb = civo.getLoadBalancer({
    name: "lb-name",
    region: "LON1",
export const civoLoadbalancerOutput = my_lb.then(my_lb => my_lb.publicIp);
      Function: civo:getLoadBalancer
        name: lb-name
        region: LON1
  civoLoadbalancerOutput: ${["my-lb"].publicIp}

Using getLoadBalancer

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 getLoadBalancer(args: GetLoadBalancerArgs, opts?: InvokeOptions): Promise<GetLoadBalancerResult>
function getLoadBalancerOutput(args: GetLoadBalancerOutputArgs, opts?: InvokeOptions): Output<GetLoadBalancerResult>
def get_load_balancer(id: Optional[str] = None,
                      name: Optional[str] = None,
                      region: Optional[str] = None,
                      opts: Optional[InvokeOptions] = None) -> GetLoadBalancerResult
def get_load_balancer_output(id: Optional[pulumi.Input[str]] = None,
                      name: Optional[pulumi.Input[str]] = None,
                      region: Optional[pulumi.Input[str]] = None,
                      opts: Optional[InvokeOptions] = None) -> Output[GetLoadBalancerResult]
func GetLoadBalancer(ctx *Context, args *GetLoadBalancerArgs, opts ...InvokeOption) (*GetLoadBalancerResult, error)
func GetLoadBalancerOutput(ctx *Context, args *GetLoadBalancerOutputArgs, opts ...InvokeOption) GetLoadBalancerResultOutput

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

public static class GetLoadBalancer 
    public static Task<GetLoadBalancerResult> InvokeAsync(GetLoadBalancerArgs args, InvokeOptions? opts = null)
    public static Output<GetLoadBalancerResult> Invoke(GetLoadBalancerInvokeArgs args, InvokeOptions? opts = null)
public static CompletableFuture<GetLoadBalancerResult> getLoadBalancer(GetLoadBalancerArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
  Function: civo:index/getLoadBalancer:getLoadBalancer
    # Arguments dictionary

The following arguments are supported:

Id string
Name string
Region string
Id string
Name string
Region string
id String
name String
region String
id string
name string
region string
id str
name str
region str
id String
name String
region String

getLoadBalancer Result

The following output properties are available:

Supporting Types


healthCheckPort Integer
ip String
protocol String
sourcePort Integer
targetPort Integer
healthCheckPort number
ip string
protocol string
sourcePort number
targetPort number
healthCheckPort Number
ip String
protocol String
sourcePort Number
targetPort Number

Package Details


This Pulumi package is based on the civo Terraform Provider.