DigitalOcean

Pulumi Official
Package maintained by Pulumi
v4.12.0 published on Wednesday, Apr 6, 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 DigitalOcean account. This is useful if the load balancer in question is not managed by the provider or you need to utilize any of the load balancers data.

An error is triggered if the provided load balancer name does not exist.

Example Usage

using Pulumi;
using DigitalOcean = Pulumi.DigitalOcean;

class MyStack : Stack
{
    public MyStack()
    {
        var example = Output.Create(DigitalOcean.GetLoadBalancer.InvokeAsync(new DigitalOcean.GetLoadBalancerArgs
        {
            Name = "app",
        }));
        this.LbOutput = example.Apply(example => example.Ip);
    }

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

import (
	"github.com/pulumi/pulumi-digitalocean/sdk/v4/go/digitalocean"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		example, err := digitalocean.LookupLoadBalancer(ctx, &GetLoadBalancerArgs{
			Name: pulumi.StringRef("app"),
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("lbOutput", example.Ip)
		return nil
	})
}

Coming soon!

import pulumi
import pulumi_digitalocean as digitalocean

example = digitalocean.get_load_balancer(name="app")
pulumi.export("lbOutput", example.ip)
import * as pulumi from "@pulumi/pulumi";
import * as digitalocean from "@pulumi/digitalocean";

const example = digitalocean.getLoadBalancer({
    name: "app",
});
export const lbOutput = example.then(example => example.ip);

Coming soon!

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,
                      opts: Optional[InvokeOptions] = None) -> GetLoadBalancerResult
def get_load_balancer_output(id: Optional[pulumi.Input[str]] = None,
                      name: Optional[pulumi.Input[str]] = None,
                      opts: Optional[InvokeOptions] = None) -> Output[GetLoadBalancerResult]
func LookupLoadBalancer(ctx *Context, args *LookupLoadBalancerArgs, opts ...InvokeOption) (*LookupLoadBalancerResult, error)
func LookupLoadBalancerOutput(ctx *Context, args *LookupLoadBalancerOutputArgs, opts ...InvokeOption) LookupLoadBalancerResultOutput

> Note: This function is named LookupLoadBalancer 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: digitalocean:index/getLoadBalancer:getLoadBalancer
  Arguments:
    # Arguments dictionary

The following arguments are supported:

Id string

The ID of load balancer.

Name string

The name of load balancer.

Id string

The ID of load balancer.

Name string

The name of load balancer.

id String

The ID of load balancer.

name String

The name of load balancer.

id string

The ID of load balancer.

name string

The name of load balancer.

id str

The ID of load balancer.

name str

The name of load balancer.

id String

The ID of load balancer.

name String

The name of load balancer.

getLoadBalancer Result

The following output properties are available:

Supporting Types

GetLoadBalancerForwardingRule

GetLoadBalancerHealthcheck

GetLoadBalancerStickySession

cookieName String
cookieTtlSeconds Integer
type String
cookieName string
cookieTtlSeconds number
type string
cookieName String
cookieTtlSeconds Number
type String

Package Details

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

This Pulumi package is based on the digitalocean Terraform Provider.