Civo

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

getLoadBalancer

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);
    }

    [Output("civoLoadbalancerOutput")]
    public Output<string> CivoLoadbalancerOutput { get; set; }
}
package main

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

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.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 my-lb = CivoFunctions.getLoadBalancer(GetLoadBalancerArgs.builder()
            .name("lb-name")
            .region("LON1")
            .build());

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

my_lb = civo.get_load_balancer(name="lb-name",
    region="LON1")
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);
variables:
  my-lb:
    Fn::Invoke:
      Function: civo:getLoadBalancer
      Arguments:
        name: lb-name
        region: LON1
outputs:
  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
Fn::Invoke:
  Function: civo:index/getLoadBalancer:getLoadBalancer
  Arguments:
    # 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

GetLoadBalancerBackend

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

Repository
https://github.com/pulumi/pulumi-civo
License
Apache-2.0
Notes

This Pulumi package is based on the civo Terraform Provider.