GetLoadBalancer

Provides information about a “classic” Elastic Load Balancer (ELB). See LB Data Source if you are looking for “v2” Application Load Balancer (ALB) or Network Load Balancer (NLB).

This data source can prove useful when a module accepts an LB as an input variable and needs to, for example, determine the security groups associated with it, etc.

Example Usage

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var config = new Config();
        var lbName = config.Get("lbName") ?? "";
        var test = Output.Create(Aws.Elb.GetLoadBalancer.InvokeAsync(new Aws.Elb.GetLoadBalancerArgs
        {
            Name = lbName,
        }));
    }

}
package main

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

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        _, err := elb.LookupLoadBalancer(ctx, &elb.LookupLoadBalancerArgs{
            Name: lbName,
        }, nil)
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_aws as aws

config = pulumi.Config()
lb_name = config.get("lbName")
if lb_name is None:
    lb_name = ""
test = aws.elb.get_load_balancer(name=lb_name)
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const config = new pulumi.Config();
const lbName = config.get("lbName") || "";

const test = pulumi.output(aws.elb.getLoadBalancer({
    name: lbName,
}, { async: true }));

Deprecated: aws.elasticloadbalancing.getLoadBalancer has been deprecated in favor of aws.elb.getLoadBalancer

Using GetLoadBalancer

function getLoadBalancer(args: GetLoadBalancerArgs, opts?: InvokeOptions): Promise<GetLoadBalancerResult>
function  get_load_balancer(name=None, tags=None, opts=None)
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:

Name string

The unique name of the load balancer.

Tags Dictionary<string, string>
Name string

The unique name of the load balancer.

Tags map[string]string
name string

The unique name of the load balancer.

tags {[key: string]: string}
name str

The unique name of the load balancer.

tags Dict[str, str]

GetLoadBalancer Result

The following output properties are available:

AccessLogs GetLoadBalancerAccessLogs
Arn string
AvailabilityZones List<string>
ConnectionDraining bool
ConnectionDrainingTimeout int
CrossZoneLoadBalancing bool
DnsName string
HealthCheck GetLoadBalancerHealthCheck
Id string

The provider-assigned unique ID for this managed resource.

IdleTimeout int
Instances List<string>
Internal bool
Listeners List<GetLoadBalancerListener>
Name string
SecurityGroups List<string>
SourceSecurityGroup string
SourceSecurityGroupId string
Subnets List<string>
Tags Dictionary<string, string>
ZoneId string
AccessLogs GetLoadBalancerAccessLogs
Arn string
AvailabilityZones []string
ConnectionDraining bool
ConnectionDrainingTimeout int
CrossZoneLoadBalancing bool
DnsName string
HealthCheck GetLoadBalancerHealthCheck
Id string

The provider-assigned unique ID for this managed resource.

IdleTimeout int
Instances []string
Internal bool
Listeners []GetLoadBalancerListener
Name string
SecurityGroups []string
SourceSecurityGroup string
SourceSecurityGroupId string
Subnets []string
Tags map[string]string
ZoneId string
accessLogs GetLoadBalancerAccessLogs
arn string
availabilityZones string[]
connectionDraining boolean
connectionDrainingTimeout number
crossZoneLoadBalancing boolean
dnsName string
healthCheck GetLoadBalancerHealthCheck
id string

The provider-assigned unique ID for this managed resource.

idleTimeout number
instances string[]
internal boolean
listeners GetLoadBalancerListener[]
name string
securityGroups string[]
sourceSecurityGroup string
sourceSecurityGroupId string
subnets string[]
tags {[key: string]: string}
zoneId string
access_logs Dict[GetLoadBalancerAccessLogs]
arn str
availability_zones List[str]
connection_draining bool
connection_draining_timeout float
cross_zone_load_balancing bool
dns_name str
health_check Dict[GetLoadBalancerHealthCheck]
id str

The provider-assigned unique ID for this managed resource.

idle_timeout float
instances List[str]
internal bool
listeners List[GetLoadBalancerListener]
name str
security_groups List[str]
source_security_group str
source_security_group_id str
subnets List[str]
tags Dict[str, str]
zone_id str

Supporting Types

GetLoadBalancerAccessLogs

See the output API doc for this type.

See the output API doc for this type.

See the output API doc for this type.

Bucket string
BucketPrefix string
Enabled bool
Interval int
Bucket string
BucketPrefix string
Enabled bool
Interval int
bucket string
bucketPrefix string
enabled boolean
interval number
bucket str
bucket_prefix str
enabled bool
interval float

GetLoadBalancerHealthCheck

See the output API doc for this type.

See the output API doc for this type.

See the output API doc for this type.

HealthyThreshold int
Interval int
Target string
Timeout int
UnhealthyThreshold int
HealthyThreshold int
Interval int
Target string
Timeout int
UnhealthyThreshold int
healthyThreshold number
interval number
target string
timeout number
unhealthyThreshold number
healthyThreshold float
interval float
target str
timeout float
unhealthyThreshold float

GetLoadBalancerListener

See the output API doc for this type.

See the output API doc for this type.

See the output API doc for this type.

InstancePort int
InstanceProtocol string
LbPort int
LbProtocol string
SslCertificateId string
InstancePort int
InstanceProtocol string
LbPort int
LbProtocol string
SslCertificateId string
instancePort number
instanceProtocol string
lbPort number
lbProtocol string
sslCertificateId string
instanceProtocol str
instance_port float
lbProtocol str
lb_port float
sslCertificateId str

Package Details

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