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
LookupLoadBalancerin the Go SDK.
public static class GetLoadBalancer {
public static Task<GetLoadBalancerResult> InvokeAsync(GetLoadBalancerArgs args, InvokeOptions? opts = null)
}The following arguments are supported:
GetLoadBalancer Result
The following output properties are available:
- Access
Logs GetLoad Balancer Access Logs - Arn string
- Availability
Zones List<string> - Connection
Draining bool - Connection
Draining intTimeout - Cross
Zone boolLoad Balancing - Dns
Name string - Health
Check GetLoad Balancer Health Check - Id string
The provider-assigned unique ID for this managed resource.
- Idle
Timeout int - Instances List<string>
- Internal bool
- Listeners
List<Get
Load Balancer Listener> - Name string
- Security
Groups List<string> - Source
Security stringGroup - Source
Security stringGroup Id - Subnets List<string>
- Dictionary<string, string>
- Zone
Id string
- Access
Logs GetLoad Balancer Access Logs - Arn string
- Availability
Zones []string - Connection
Draining bool - Connection
Draining intTimeout - Cross
Zone boolLoad Balancing - Dns
Name string - Health
Check GetLoad Balancer Health Check - Id string
The provider-assigned unique ID for this managed resource.
- Idle
Timeout int - Instances []string
- Internal bool
- Listeners
[]Get
Load Balancer Listener - Name string
- Security
Groups []string - Source
Security stringGroup - Source
Security stringGroup Id - Subnets []string
- map[string]string
- Zone
Id string
- access
Logs GetLoad Balancer Access Logs - arn string
- availability
Zones string[] - connection
Draining boolean - connection
Draining numberTimeout - cross
Zone booleanLoad Balancing - dns
Name string - health
Check GetLoad Balancer Health Check - id string
The provider-assigned unique ID for this managed resource.
- idle
Timeout number - instances string[]
- internal boolean
- listeners
Get
Load Balancer Listener[] - name string
- security
Groups string[] - source
Security stringGroup - source
Security stringGroup Id - subnets string[]
- {[key: string]: string}
- zone
Id string
- access_
logs Dict[GetLoad Balancer Access Logs] - arn str
- availability_
zones List[str] - connection_
draining bool - connection_
draining_ floattimeout - cross_
zone_ boolload_ balancing - dns_
name str - health_
check Dict[GetLoad Balancer Health Check] - id str
The provider-assigned unique ID for this managed resource.
- idle_
timeout float - instances List[str]
- internal bool
- listeners
List[Get
Load Balancer Listener] - name str
- security_
groups List[str] - source_
security_ strgroup - source_
security_ strgroup_ id - subnets List[str]
- 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.
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.
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.
Package Details
- Repository
- https://github.com/pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
awsTerraform Provider.