digitalocean.getLoadBalancer
Explore with Pulumi AI
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
Get the load balancer by name:
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);
import pulumi
import pulumi_digitalocean as digitalocean
example = digitalocean.get_load_balancer(name="app")
pulumi.export("lbOutput", example.ip)
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, &digitalocean.LookupLoadBalancerArgs{
Name: pulumi.StringRef("app"),
}, nil)
if err != nil {
return err
}
ctx.Export("lbOutput", example.Ip)
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using DigitalOcean = Pulumi.DigitalOcean;
return await Deployment.RunAsync(() =>
{
var example = DigitalOcean.GetLoadBalancer.Invoke(new()
{
Name = "app",
});
return new Dictionary<string, object?>
{
["lbOutput"] = example.Apply(getLoadBalancerResult => getLoadBalancerResult.Ip),
};
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.digitalocean.DigitaloceanFunctions;
import com.pulumi.digitalocean.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 example = DigitaloceanFunctions.getLoadBalancer(GetLoadBalancerArgs.builder()
.name("app")
.build());
ctx.export("lbOutput", example.applyValue(getLoadBalancerResult -> getLoadBalancerResult.ip()));
}
}
variables:
example:
fn::invoke:
Function: digitalocean:getLoadBalancer
Arguments:
name: app
outputs:
lbOutput: ${example.ip}
Get the load balancer by ID:
import * as pulumi from "@pulumi/pulumi";
import * as digitalocean from "@pulumi/digitalocean";
const example = digitalocean.getLoadBalancer({
id: "loadbalancer_id",
});
import pulumi
import pulumi_digitalocean as digitalocean
example = digitalocean.get_load_balancer(id="loadbalancer_id")
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 {
_, err := digitalocean.LookupLoadBalancer(ctx, &digitalocean.LookupLoadBalancerArgs{
Id: pulumi.StringRef("loadbalancer_id"),
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using DigitalOcean = Pulumi.DigitalOcean;
return await Deployment.RunAsync(() =>
{
var example = DigitalOcean.GetLoadBalancer.Invoke(new()
{
Id = "loadbalancer_id",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.digitalocean.DigitaloceanFunctions;
import com.pulumi.digitalocean.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 example = DigitaloceanFunctions.getLoadBalancer(GetLoadBalancerArgs.builder()
.id("loadbalancer_id")
.build());
}
}
variables:
example:
fn::invoke:
Function: digitalocean:getLoadBalancer
Arguments:
id: loadbalancer_id
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:
getLoadBalancer Result
The following output properties are available:
- Algorithm string
- Disable
Lets boolEncrypt Dns Records - Domains
List<Pulumi.
Digital Ocean. Outputs. Get Load Balancer Domain> - Droplet
Ids List<int> - Droplet
Tag string - Enable
Backend boolKeepalive - Enable
Proxy boolProtocol - Firewalls
List<Pulumi.
Digital Ocean. Outputs. Get Load Balancer Firewall> - Forwarding
Rules List<Pulumi.Digital Ocean. Outputs. Get Load Balancer Forwarding Rule> - Glb
Settings List<Pulumi.Digital Ocean. Outputs. Get Load Balancer Glb Setting> - Healthchecks
List<Pulumi.
Digital Ocean. Outputs. Get Load Balancer Healthcheck> - Http
Idle intTimeout Seconds - Ip string
- Load
Balancer stringUrn - Network string
- Project
Id string - Redirect
Http boolTo Https - Region string
- Size string
- Size
Unit int - Status string
- Sticky
Sessions List<Pulumi.Digital Ocean. Outputs. Get Load Balancer Sticky Session> - Target
Load List<string>Balancer Ids - Type string
- Vpc
Uuid string - Id string
- Name string
- Algorithm string
- Disable
Lets boolEncrypt Dns Records - Domains
[]Get
Load Balancer Domain - Droplet
Ids []int - Droplet
Tag string - Enable
Backend boolKeepalive - Enable
Proxy boolProtocol - Firewalls
[]Get
Load Balancer Firewall - Forwarding
Rules []GetLoad Balancer Forwarding Rule - Glb
Settings []GetLoad Balancer Glb Setting - Healthchecks
[]Get
Load Balancer Healthcheck - Http
Idle intTimeout Seconds - Ip string
- Load
Balancer stringUrn - Network string
- Project
Id string - Redirect
Http boolTo Https - Region string
- Size string
- Size
Unit int - Status string
- Sticky
Sessions []GetLoad Balancer Sticky Session - Target
Load []stringBalancer Ids - Type string
- Vpc
Uuid string - Id string
- Name string
- algorithm String
- disable
Lets BooleanEncrypt Dns Records - domains
List<Get
Load Balancer Domain> - droplet
Ids List<Integer> - droplet
Tag String - enable
Backend BooleanKeepalive - enable
Proxy BooleanProtocol - firewalls
List<Get
Load Balancer Firewall> - forwarding
Rules List<GetLoad Balancer Forwarding Rule> - glb
Settings List<GetLoad Balancer Glb Setting> - healthchecks
List<Get
Load Balancer Healthcheck> - http
Idle IntegerTimeout Seconds - ip String
- load
Balancer StringUrn - network String
- project
Id String - redirect
Http BooleanTo Https - region String
- size String
- size
Unit Integer - status String
- sticky
Sessions List<GetLoad Balancer Sticky Session> - target
Load List<String>Balancer Ids - type String
- vpc
Uuid String - id String
- name String
- algorithm string
- disable
Lets booleanEncrypt Dns Records - domains
Get
Load Balancer Domain[] - droplet
Ids number[] - droplet
Tag string - enable
Backend booleanKeepalive - enable
Proxy booleanProtocol - firewalls
Get
Load Balancer Firewall[] - forwarding
Rules GetLoad Balancer Forwarding Rule[] - glb
Settings GetLoad Balancer Glb Setting[] - healthchecks
Get
Load Balancer Healthcheck[] - http
Idle numberTimeout Seconds - ip string
- load
Balancer stringUrn - network string
- project
Id string - redirect
Http booleanTo Https - region string
- size string
- size
Unit number - status string
- sticky
Sessions GetLoad Balancer Sticky Session[] - target
Load string[]Balancer Ids - type string
- vpc
Uuid string - id string
- name string
- algorithm str
- disable_
lets_ boolencrypt_ dns_ records - domains
Sequence[Get
Load Balancer Domain] - droplet_
ids Sequence[int] - droplet_
tag str - enable_
backend_ boolkeepalive - enable_
proxy_ boolprotocol - firewalls
Sequence[Get
Load Balancer Firewall] - forwarding_
rules Sequence[GetLoad Balancer Forwarding Rule] - glb_
settings Sequence[GetLoad Balancer Glb Setting] - healthchecks
Sequence[Get
Load Balancer Healthcheck] - http_
idle_ inttimeout_ seconds - ip str
- load_
balancer_ strurn - network str
- project_
id str - redirect_
http_ boolto_ https - region str
- size str
- size_
unit int - status str
- sticky_
sessions Sequence[GetLoad Balancer Sticky Session] - target_
load_ Sequence[str]balancer_ ids - type str
- vpc_
uuid str - id str
- name str
- algorithm String
- disable
Lets BooleanEncrypt Dns Records - domains List<Property Map>
- droplet
Ids List<Number> - droplet
Tag String - enable
Backend BooleanKeepalive - enable
Proxy BooleanProtocol - firewalls List<Property Map>
- forwarding
Rules List<Property Map> - glb
Settings List<Property Map> - healthchecks List<Property Map>
- http
Idle NumberTimeout Seconds - ip String
- load
Balancer StringUrn - network String
- project
Id String - redirect
Http BooleanTo Https - region String
- size String
- size
Unit Number - status String
- sticky
Sessions List<Property Map> - target
Load List<String>Balancer Ids - type String
- vpc
Uuid String - id String
- name String
Supporting Types
GetLoadBalancerDomain
- Certificate
Id string - certificate ID for TLS handshaking
- Certificate
Name string - name of certificate required for TLS handshaking
- Is
Managed bool - flag indicating if domain is managed by DigitalOcean
- Name string
- The name of load balancer.
- Ssl
Validation List<string>Error Reasons - list of domain SSL validation errors
- Verification
Error List<string>Reasons - list of domain verification errors
- Certificate
Id string - certificate ID for TLS handshaking
- Certificate
Name string - name of certificate required for TLS handshaking
- Is
Managed bool - flag indicating if domain is managed by DigitalOcean
- Name string
- The name of load balancer.
- Ssl
Validation []stringError Reasons - list of domain SSL validation errors
- Verification
Error []stringReasons - list of domain verification errors
- certificate
Id String - certificate ID for TLS handshaking
- certificate
Name String - name of certificate required for TLS handshaking
- is
Managed Boolean - flag indicating if domain is managed by DigitalOcean
- name String
- The name of load balancer.
- ssl
Validation List<String>Error Reasons - list of domain SSL validation errors
- verification
Error List<String>Reasons - list of domain verification errors
- certificate
Id string - certificate ID for TLS handshaking
- certificate
Name string - name of certificate required for TLS handshaking
- is
Managed boolean - flag indicating if domain is managed by DigitalOcean
- name string
- The name of load balancer.
- ssl
Validation string[]Error Reasons - list of domain SSL validation errors
- verification
Error string[]Reasons - list of domain verification errors
- certificate_
id str - certificate ID for TLS handshaking
- certificate_
name str - name of certificate required for TLS handshaking
- is_
managed bool - flag indicating if domain is managed by DigitalOcean
- name str
- The name of load balancer.
- ssl_
validation_ Sequence[str]error_ reasons - list of domain SSL validation errors
- verification_
error_ Sequence[str]reasons - list of domain verification errors
- certificate
Id String - certificate ID for TLS handshaking
- certificate
Name String - name of certificate required for TLS handshaking
- is
Managed Boolean - flag indicating if domain is managed by DigitalOcean
- name String
- The name of load balancer.
- ssl
Validation List<String>Error Reasons - list of domain SSL validation errors
- verification
Error List<String>Reasons - list of domain verification errors
GetLoadBalancerFirewall
GetLoadBalancerForwardingRule
- Certificate
Id string - the id of the tls certificate used for ssl termination if enabled
- Certificate
Name string - the name of the tls certificate used for ssl termination if enabled
- Entry
Port int - the port on which the load balancer instance will listen
- Entry
Protocol string - the protocol used for traffic to the load balancer
- Target
Port int - the port on the backend Droplets to which the load balancer will send traffic
- Target
Protocol string - the protocol used for traffic to the backend droplets
- Tls
Passthrough bool - whether ssl encrypted traffic will be passed through to the backend droplets
- Certificate
Id string - the id of the tls certificate used for ssl termination if enabled
- Certificate
Name string - the name of the tls certificate used for ssl termination if enabled
- Entry
Port int - the port on which the load balancer instance will listen
- Entry
Protocol string - the protocol used for traffic to the load balancer
- Target
Port int - the port on the backend Droplets to which the load balancer will send traffic
- Target
Protocol string - the protocol used for traffic to the backend droplets
- Tls
Passthrough bool - whether ssl encrypted traffic will be passed through to the backend droplets
- certificate
Id String - the id of the tls certificate used for ssl termination if enabled
- certificate
Name String - the name of the tls certificate used for ssl termination if enabled
- entry
Port Integer - the port on which the load balancer instance will listen
- entry
Protocol String - the protocol used for traffic to the load balancer
- target
Port Integer - the port on the backend Droplets to which the load balancer will send traffic
- target
Protocol String - the protocol used for traffic to the backend droplets
- tls
Passthrough Boolean - whether ssl encrypted traffic will be passed through to the backend droplets
- certificate
Id string - the id of the tls certificate used for ssl termination if enabled
- certificate
Name string - the name of the tls certificate used for ssl termination if enabled
- entry
Port number - the port on which the load balancer instance will listen
- entry
Protocol string - the protocol used for traffic to the load balancer
- target
Port number - the port on the backend Droplets to which the load balancer will send traffic
- target
Protocol string - the protocol used for traffic to the backend droplets
- tls
Passthrough boolean - whether ssl encrypted traffic will be passed through to the backend droplets
- certificate_
id str - the id of the tls certificate used for ssl termination if enabled
- certificate_
name str - the name of the tls certificate used for ssl termination if enabled
- entry_
port int - the port on which the load balancer instance will listen
- entry_
protocol str - the protocol used for traffic to the load balancer
- target_
port int - the port on the backend Droplets to which the load balancer will send traffic
- target_
protocol str - the protocol used for traffic to the backend droplets
- tls_
passthrough bool - whether ssl encrypted traffic will be passed through to the backend droplets
- certificate
Id String - the id of the tls certificate used for ssl termination if enabled
- certificate
Name String - the name of the tls certificate used for ssl termination if enabled
- entry
Port Number - the port on which the load balancer instance will listen
- entry
Protocol String - the protocol used for traffic to the load balancer
- target
Port Number - the port on the backend Droplets to which the load balancer will send traffic
- target
Protocol String - the protocol used for traffic to the backend droplets
- tls
Passthrough Boolean - whether ssl encrypted traffic will be passed through to the backend droplets
GetLoadBalancerGlbSetting
- Cdns
List<Pulumi.
Digital Ocean. Inputs. Get Load Balancer Glb Setting Cdn> - CDN specific configurations
- Failover
Threshold int - fail-over threshold
- Region
Priorities Dictionary<string, int> - region priority map
- Target
Port int - target port rules
- Target
Protocol string - target protocol rules
- Cdns
[]Get
Load Balancer Glb Setting Cdn - CDN specific configurations
- Failover
Threshold int - fail-over threshold
- Region
Priorities map[string]int - region priority map
- Target
Port int - target port rules
- Target
Protocol string - target protocol rules
- cdns
List<Get
Load Balancer Glb Setting Cdn> - CDN specific configurations
- failover
Threshold Integer - fail-over threshold
- region
Priorities Map<String,Integer> - region priority map
- target
Port Integer - target port rules
- target
Protocol String - target protocol rules
- cdns
Get
Load Balancer Glb Setting Cdn[] - CDN specific configurations
- failover
Threshold number - fail-over threshold
- region
Priorities {[key: string]: number} - region priority map
- target
Port number - target port rules
- target
Protocol string - target protocol rules
- cdns
Sequence[Get
Load Balancer Glb Setting Cdn] - CDN specific configurations
- failover_
threshold int - fail-over threshold
- region_
priorities Mapping[str, int] - region priority map
- target_
port int - target port rules
- target_
protocol str - target protocol rules
- cdns List<Property Map>
- CDN specific configurations
- failover
Threshold Number - fail-over threshold
- region
Priorities Map<Number> - region priority map
- target
Port Number - target port rules
- target
Protocol String - target protocol rules
GetLoadBalancerGlbSettingCdn
- Is
Enabled bool - cache enable flag
- Is
Enabled bool - cache enable flag
- is
Enabled Boolean - cache enable flag
- is
Enabled boolean - cache enable flag
- is_
enabled bool - cache enable flag
- is
Enabled Boolean - cache enable flag
GetLoadBalancerHealthcheck
- Check
Interval intSeconds - the number of seconds between between two consecutive health checks
- Healthy
Threshold int - the number of times a health check must pass for a backend droplet to be marked 'healthy' and be re-added to the pool
- Path string
- the path on the backend Droplets to which the Load Balancer will send a request
- Port int
- the port on the backend droplets on which the health check will attempt a connection
- Protocol string
- the protocol used for health checks sent to the backend droplets
- Response
Timeout intSeconds - the number of seconds to wait for a response until marking a health check as failed
- Unhealthy
Threshold int - The number of times a health check must fail for a backend droplet to be marked 'unhealthy' and be removed from the pool
- Check
Interval intSeconds - the number of seconds between between two consecutive health checks
- Healthy
Threshold int - the number of times a health check must pass for a backend droplet to be marked 'healthy' and be re-added to the pool
- Path string
- the path on the backend Droplets to which the Load Balancer will send a request
- Port int
- the port on the backend droplets on which the health check will attempt a connection
- Protocol string
- the protocol used for health checks sent to the backend droplets
- Response
Timeout intSeconds - the number of seconds to wait for a response until marking a health check as failed
- Unhealthy
Threshold int - The number of times a health check must fail for a backend droplet to be marked 'unhealthy' and be removed from the pool
- check
Interval IntegerSeconds - the number of seconds between between two consecutive health checks
- healthy
Threshold Integer - the number of times a health check must pass for a backend droplet to be marked 'healthy' and be re-added to the pool
- path String
- the path on the backend Droplets to which the Load Balancer will send a request
- port Integer
- the port on the backend droplets on which the health check will attempt a connection
- protocol String
- the protocol used for health checks sent to the backend droplets
- response
Timeout IntegerSeconds - the number of seconds to wait for a response until marking a health check as failed
- unhealthy
Threshold Integer - The number of times a health check must fail for a backend droplet to be marked 'unhealthy' and be removed from the pool
- check
Interval numberSeconds - the number of seconds between between two consecutive health checks
- healthy
Threshold number - the number of times a health check must pass for a backend droplet to be marked 'healthy' and be re-added to the pool
- path string
- the path on the backend Droplets to which the Load Balancer will send a request
- port number
- the port on the backend droplets on which the health check will attempt a connection
- protocol string
- the protocol used for health checks sent to the backend droplets
- response
Timeout numberSeconds - the number of seconds to wait for a response until marking a health check as failed
- unhealthy
Threshold number - The number of times a health check must fail for a backend droplet to be marked 'unhealthy' and be removed from the pool
- check_
interval_ intseconds - the number of seconds between between two consecutive health checks
- healthy_
threshold int - the number of times a health check must pass for a backend droplet to be marked 'healthy' and be re-added to the pool
- path str
- the path on the backend Droplets to which the Load Balancer will send a request
- port int
- the port on the backend droplets on which the health check will attempt a connection
- protocol str
- the protocol used for health checks sent to the backend droplets
- response_
timeout_ intseconds - the number of seconds to wait for a response until marking a health check as failed
- unhealthy_
threshold int - The number of times a health check must fail for a backend droplet to be marked 'unhealthy' and be removed from the pool
- check
Interval NumberSeconds - the number of seconds between between two consecutive health checks
- healthy
Threshold Number - the number of times a health check must pass for a backend droplet to be marked 'healthy' and be re-added to the pool
- path String
- the path on the backend Droplets to which the Load Balancer will send a request
- port Number
- the port on the backend droplets on which the health check will attempt a connection
- protocol String
- the protocol used for health checks sent to the backend droplets
- response
Timeout NumberSeconds - the number of seconds to wait for a response until marking a health check as failed
- unhealthy
Threshold Number - The number of times a health check must fail for a backend droplet to be marked 'unhealthy' and be removed from the pool
GetLoadBalancerStickySession
- string
- the name of the cookie sent to the client
- int
- the number of seconds until the cookie set by the Load Balancer expires
- Type string
- how and if requests from a client will be persistently served by the same backend droplet
- string
- the name of the cookie sent to the client
- int
- the number of seconds until the cookie set by the Load Balancer expires
- Type string
- how and if requests from a client will be persistently served by the same backend droplet
- String
- the name of the cookie sent to the client
- Integer
- the number of seconds until the cookie set by the Load Balancer expires
- type String
- how and if requests from a client will be persistently served by the same backend droplet
- string
- the name of the cookie sent to the client
- number
- the number of seconds until the cookie set by the Load Balancer expires
- type string
- how and if requests from a client will be persistently served by the same backend droplet
- str
- the name of the cookie sent to the client
- int
- the number of seconds until the cookie set by the Load Balancer expires
- type str
- how and if requests from a client will be persistently served by the same backend droplet
- String
- the name of the cookie sent to the client
- Number
- the number of seconds until the cookie set by the Load Balancer expires
- type String
- how and if requests from a client will be persistently served by the same backend droplet
Package Details
- Repository
- DigitalOcean pulumi/pulumi-digitalocean
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
digitalocean
Terraform Provider.