GetLoadBalancer

Note: aws.alb.LoadBalancer is known as aws.lb.LoadBalancer. The functionality is identical.

Provides information about a Load Balancer.

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 lbArn = config.Get("lbArn") ?? "";
        var lbName = config.Get("lbName") ?? "";
        var test = Output.Create(Aws.LB.GetLoadBalancer.InvokeAsync(new Aws.LB.GetLoadBalancerArgs
        {
            Arn = lbArn,
            Name = lbName,
        }));
    }

}
package main

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

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

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

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

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

Deprecated: aws.applicationloadbalancing.getLoadBalancer has been deprecated in favor of aws.alb.getLoadBalancer

Using GetLoadBalancer

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

Arn string

The full ARN of the load balancer.

Name string

The unique name of the load balancer.

Tags Dictionary<string, string>
Arn string

The full ARN of the load balancer.

Name string

The unique name of the load balancer.

Tags map[string]string
arn string

The full ARN of the load balancer.

name string

The unique name of the load balancer.

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

The full ARN of the load balancer.

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
ArnSuffix string
DnsName string
DropInvalidHeaderFields bool
EnableDeletionProtection bool
Id string

The provider-assigned unique ID for this managed resource.

IdleTimeout int
Internal bool
IpAddressType string
LoadBalancerType string
Name string
SecurityGroups List<string>
SubnetMappings List<GetLoadBalancerSubnetMapping>
Subnets List<string>
Tags Dictionary<string, string>
VpcId string
ZoneId string
AccessLogs GetLoadBalancerAccessLogs
Arn string
ArnSuffix string
DnsName string
DropInvalidHeaderFields bool
EnableDeletionProtection bool
Id string

The provider-assigned unique ID for this managed resource.

IdleTimeout int
Internal bool
IpAddressType string
LoadBalancerType string
Name string
SecurityGroups []string
SubnetMappings []GetLoadBalancerSubnetMapping
Subnets []string
Tags map[string]string
VpcId string
ZoneId string
accessLogs GetLoadBalancerAccessLogs
arn string
arnSuffix string
dnsName string
dropInvalidHeaderFields boolean
enableDeletionProtection boolean
id string

The provider-assigned unique ID for this managed resource.

idleTimeout number
internal boolean
ipAddressType string
loadBalancerType string
name string
securityGroups string[]
subnetMappings GetLoadBalancerSubnetMapping[]
subnets string[]
tags {[key: string]: string}
vpcId string
zoneId string
access_logs Dict[GetLoadBalancerAccessLogs]
arn str
arn_suffix str
dns_name str
drop_invalid_header_fields bool
enable_deletion_protection bool
id str

The provider-assigned unique ID for this managed resource.

idle_timeout float
internal bool
ip_address_type str
load_balancer_type str
name str
security_groups List[str]
subnet_mappings List[GetLoadBalancerSubnetMapping]
subnets List[str]
tags Dict[str, str]
vpc_id 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
Enabled bool
Prefix string
Bucket string
Enabled bool
Prefix string
bucket string
enabled boolean
prefix string
bucket str
enabled bool
prefix str

GetLoadBalancerSubnetMapping

See the output API doc for this type.

See the output API doc for this type.

See the output API doc for this type.

SubnetId string
AllocationId string
SubnetId string
AllocationId string
subnetId string
allocationId string
subnet_id str
allocation_id 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.