LoadBalancer

Provides an Elastic Load Balancer resource, also known as a “Classic Load Balancer” after the release of Application/Network Load Balancers.

NOTE on ELB Instances and ELB Attachments: This provider currently provides both a standalone ELB Attachment resource (describing an instance attached to an ELB), and an ELB resource with instances defined in-line. At this time you cannot use an ELB with in-line instances in conjunction with a ELB Attachment resources. Doing so will cause a conflict and will overwrite attachments.

Note on ECDSA Key Algorithm

If the ARN of the ssl_certificate_id that is pointed to references a certificate that was signed by an ECDSA key, note that ELB only supports the P256 and P384 curves. Using a certificate signed by a key using a different curve could produce the error ERR_SSL_VERSION_OR_CIPHER_MISMATCH in your browser.

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

Create a LoadBalancer Resource

def LoadBalancer(resource_name, opts=None, access_logs=None, availability_zones=None, connection_draining=None, connection_draining_timeout=None, cross_zone_load_balancing=None, health_check=None, idle_timeout=None, instances=None, internal=None, listeners=None, name=None, name_prefix=None, security_groups=None, source_security_group=None, subnets=None, tags=None, __props__=None);
func NewLoadBalancer(ctx *Context, name string, args LoadBalancerArgs, opts ...ResourceOption) (*LoadBalancer, error)
name string
The unique name of the resource.
args LoadBalancerArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
opts ResourceOptions
A bag of options that control this resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args LoadBalancerArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args LoadBalancerArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

LoadBalancer Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.

Inputs

The LoadBalancer resource accepts the following input properties:

Listeners List<LoadBalancerListenerArgs>

A list of listener blocks. Listeners documented below.

AccessLogs LoadBalancerAccessLogsArgs

An Access Logs block. Access Logs documented below.

AvailabilityZones List<string>

The AZ’s to serve traffic in.

ConnectionDraining bool

Boolean to enable connection draining. Default: false

ConnectionDrainingTimeout int

The time in seconds to allow for connections to drain. Default: 300

CrossZoneLoadBalancing bool

Enable cross-zone load balancing. Default: true

HealthCheck LoadBalancerHealthCheckArgs

A health_check block. Health Check documented below.

IdleTimeout int

The time in seconds that the connection is allowed to be idle. Default: 60

Instances List<string>

A list of instance ids to place in the ELB pool.

Internal bool

If true, ELB will be an internal ELB.

Name string

The name of the ELB. By default generated by this provider.

NamePrefix string

Creates a unique name beginning with the specified prefix. Conflicts with name.

SecurityGroups List<string>

A list of security group IDs to assign to the ELB. Only valid if creating an ELB within a VPC

SourceSecurityGroup string

The name of the security group that you can use as part of your inbound rules for your load balancer’s back-end application instances. Use this for Classic or Default VPC only.

Subnets List<string>

A list of subnet IDs to attach to the ELB.

Tags Dictionary<string, string>

A map of tags to assign to the resource.

Listeners []LoadBalancerListener

A list of listener blocks. Listeners documented below.

AccessLogs LoadBalancerAccessLogs

An Access Logs block. Access Logs documented below.

AvailabilityZones []string

The AZ’s to serve traffic in.

ConnectionDraining bool

Boolean to enable connection draining. Default: false

ConnectionDrainingTimeout int

The time in seconds to allow for connections to drain. Default: 300

CrossZoneLoadBalancing bool

Enable cross-zone load balancing. Default: true

HealthCheck LoadBalancerHealthCheck

A health_check block. Health Check documented below.

IdleTimeout int

The time in seconds that the connection is allowed to be idle. Default: 60

Instances []string

A list of instance ids to place in the ELB pool.

Internal bool

If true, ELB will be an internal ELB.

Name string

The name of the ELB. By default generated by this provider.

NamePrefix string

Creates a unique name beginning with the specified prefix. Conflicts with name.

SecurityGroups []string

A list of security group IDs to assign to the ELB. Only valid if creating an ELB within a VPC

SourceSecurityGroup string

The name of the security group that you can use as part of your inbound rules for your load balancer’s back-end application instances. Use this for Classic or Default VPC only.

Subnets []string

A list of subnet IDs to attach to the ELB.

Tags map[string]string

A map of tags to assign to the resource.

listeners LoadBalancerListener[]

A list of listener blocks. Listeners documented below.

accessLogs LoadBalancerAccessLogs

An Access Logs block. Access Logs documented below.

availabilityZones string[]

The AZ’s to serve traffic in.

connectionDraining boolean

Boolean to enable connection draining. Default: false

connectionDrainingTimeout number

The time in seconds to allow for connections to drain. Default: 300

crossZoneLoadBalancing boolean

Enable cross-zone load balancing. Default: true

healthCheck LoadBalancerHealthCheck

A health_check block. Health Check documented below.

idleTimeout number

The time in seconds that the connection is allowed to be idle. Default: 60

instances string[]

A list of instance ids to place in the ELB pool.

internal boolean

If true, ELB will be an internal ELB.

name string

The name of the ELB. By default generated by this provider.

namePrefix string

Creates a unique name beginning with the specified prefix. Conflicts with name.

securityGroups string[]

A list of security group IDs to assign to the ELB. Only valid if creating an ELB within a VPC

sourceSecurityGroup string

The name of the security group that you can use as part of your inbound rules for your load balancer’s back-end application instances. Use this for Classic or Default VPC only.

subnets string[]

A list of subnet IDs to attach to the ELB.

tags {[key: string]: string}

A map of tags to assign to the resource.

listeners List[LoadBalancerListener]

A list of listener blocks. Listeners documented below.

access_logs Dict[LoadBalancerAccessLogs]

An Access Logs block. Access Logs documented below.

availability_zones List[str]

The AZ’s to serve traffic in.

connection_draining bool

Boolean to enable connection draining. Default: false

connection_draining_timeout float

The time in seconds to allow for connections to drain. Default: 300

cross_zone_load_balancing bool

Enable cross-zone load balancing. Default: true

health_check Dict[LoadBalancerHealthCheck]

A health_check block. Health Check documented below.

idle_timeout float

The time in seconds that the connection is allowed to be idle. Default: 60

instances List[str]

A list of instance ids to place in the ELB pool.

internal bool

If true, ELB will be an internal ELB.

name str

The name of the ELB. By default generated by this provider.

name_prefix str

Creates a unique name beginning with the specified prefix. Conflicts with name.

security_groups List[str]

A list of security group IDs to assign to the ELB. Only valid if creating an ELB within a VPC

source_security_group str

The name of the security group that you can use as part of your inbound rules for your load balancer’s back-end application instances. Use this for Classic or Default VPC only.

subnets List[str]

A list of subnet IDs to attach to the ELB.

tags Dict[str, str]

A map of tags to assign to the resource.

Outputs

All input properties are implicitly available as output properties. Additionally, the LoadBalancer resource produces the following output properties:

Arn string

The ARN of the ELB

DnsName string

The DNS name of the ELB

Id string
The provider-assigned unique ID for this managed resource.
SourceSecurityGroupId string

The ID of the security group that you can use as part of your inbound rules for your load balancer’s back-end application instances. Only available on ELBs launched in a VPC.

ZoneId string

The canonical hosted zone ID of the ELB (to be used in a Route 53 Alias record)

Arn string

The ARN of the ELB

DnsName string

The DNS name of the ELB

Id string
The provider-assigned unique ID for this managed resource.
SourceSecurityGroupId string

The ID of the security group that you can use as part of your inbound rules for your load balancer’s back-end application instances. Only available on ELBs launched in a VPC.

ZoneId string

The canonical hosted zone ID of the ELB (to be used in a Route 53 Alias record)

arn string

The ARN of the ELB

dnsName string

The DNS name of the ELB

id string
The provider-assigned unique ID for this managed resource.
sourceSecurityGroupId string

The ID of the security group that you can use as part of your inbound rules for your load balancer’s back-end application instances. Only available on ELBs launched in a VPC.

zoneId string

The canonical hosted zone ID of the ELB (to be used in a Route 53 Alias record)

arn str

The ARN of the ELB

dns_name str

The DNS name of the ELB

id str
The provider-assigned unique ID for this managed resource.
source_security_group_id str

The ID of the security group that you can use as part of your inbound rules for your load balancer’s back-end application instances. Only available on ELBs launched in a VPC.

zone_id str

The canonical hosted zone ID of the ELB (to be used in a Route 53 Alias record)

Look up an Existing LoadBalancer Resource

Get an existing LoadBalancer resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: LoadBalancerState, opts?: CustomResourceOptions): LoadBalancer
static get(resource_name, id, opts=None, access_logs=None, arn=None, availability_zones=None, connection_draining=None, connection_draining_timeout=None, cross_zone_load_balancing=None, dns_name=None, health_check=None, idle_timeout=None, instances=None, internal=None, listeners=None, name=None, name_prefix=None, security_groups=None, source_security_group=None, source_security_group_id=None, subnets=None, tags=None, zone_id=None, __props__=None);
func GetLoadBalancer(ctx *Context, name string, id IDInput, state *LoadBalancerState, opts ...ResourceOption) (*LoadBalancer, error)
public static LoadBalancer Get(string name, Input<string> id, LoadBalancerState? state, CustomResourceOptions? opts = null)
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.

The following state arguments are supported:

AccessLogs LoadBalancerAccessLogsArgs

An Access Logs block. Access Logs documented below.

Arn string

The ARN of the ELB

AvailabilityZones List<string>

The AZ’s to serve traffic in.

ConnectionDraining bool

Boolean to enable connection draining. Default: false

ConnectionDrainingTimeout int

The time in seconds to allow for connections to drain. Default: 300

CrossZoneLoadBalancing bool

Enable cross-zone load balancing. Default: true

DnsName string

The DNS name of the ELB

HealthCheck LoadBalancerHealthCheckArgs

A health_check block. Health Check documented below.

IdleTimeout int

The time in seconds that the connection is allowed to be idle. Default: 60

Instances List<string>

A list of instance ids to place in the ELB pool.

Internal bool

If true, ELB will be an internal ELB.

Listeners List<LoadBalancerListenerArgs>

A list of listener blocks. Listeners documented below.

Name string

The name of the ELB. By default generated by this provider.

NamePrefix string

Creates a unique name beginning with the specified prefix. Conflicts with name.

SecurityGroups List<string>

A list of security group IDs to assign to the ELB. Only valid if creating an ELB within a VPC

SourceSecurityGroup string

The name of the security group that you can use as part of your inbound rules for your load balancer’s back-end application instances. Use this for Classic or Default VPC only.

SourceSecurityGroupId string

The ID of the security group that you can use as part of your inbound rules for your load balancer’s back-end application instances. Only available on ELBs launched in a VPC.

Subnets List<string>

A list of subnet IDs to attach to the ELB.

Tags Dictionary<string, string>

A map of tags to assign to the resource.

ZoneId string

The canonical hosted zone ID of the ELB (to be used in a Route 53 Alias record)

AccessLogs LoadBalancerAccessLogs

An Access Logs block. Access Logs documented below.

Arn string

The ARN of the ELB

AvailabilityZones []string

The AZ’s to serve traffic in.

ConnectionDraining bool

Boolean to enable connection draining. Default: false

ConnectionDrainingTimeout int

The time in seconds to allow for connections to drain. Default: 300

CrossZoneLoadBalancing bool

Enable cross-zone load balancing. Default: true

DnsName string

The DNS name of the ELB

HealthCheck LoadBalancerHealthCheck

A health_check block. Health Check documented below.

IdleTimeout int

The time in seconds that the connection is allowed to be idle. Default: 60

Instances []string

A list of instance ids to place in the ELB pool.

Internal bool

If true, ELB will be an internal ELB.

Listeners []LoadBalancerListener

A list of listener blocks. Listeners documented below.

Name string

The name of the ELB. By default generated by this provider.

NamePrefix string

Creates a unique name beginning with the specified prefix. Conflicts with name.

SecurityGroups []string

A list of security group IDs to assign to the ELB. Only valid if creating an ELB within a VPC

SourceSecurityGroup string

The name of the security group that you can use as part of your inbound rules for your load balancer’s back-end application instances. Use this for Classic or Default VPC only.

SourceSecurityGroupId string

The ID of the security group that you can use as part of your inbound rules for your load balancer’s back-end application instances. Only available on ELBs launched in a VPC.

Subnets []string

A list of subnet IDs to attach to the ELB.

Tags map[string]string

A map of tags to assign to the resource.

ZoneId string

The canonical hosted zone ID of the ELB (to be used in a Route 53 Alias record)

accessLogs LoadBalancerAccessLogs

An Access Logs block. Access Logs documented below.

arn string

The ARN of the ELB

availabilityZones string[]

The AZ’s to serve traffic in.

connectionDraining boolean

Boolean to enable connection draining. Default: false

connectionDrainingTimeout number

The time in seconds to allow for connections to drain. Default: 300

crossZoneLoadBalancing boolean

Enable cross-zone load balancing. Default: true

dnsName string

The DNS name of the ELB

healthCheck LoadBalancerHealthCheck

A health_check block. Health Check documented below.

idleTimeout number

The time in seconds that the connection is allowed to be idle. Default: 60

instances string[]

A list of instance ids to place in the ELB pool.

internal boolean

If true, ELB will be an internal ELB.

listeners LoadBalancerListener[]

A list of listener blocks. Listeners documented below.

name string

The name of the ELB. By default generated by this provider.

namePrefix string

Creates a unique name beginning with the specified prefix. Conflicts with name.

securityGroups string[]

A list of security group IDs to assign to the ELB. Only valid if creating an ELB within a VPC

sourceSecurityGroup string

The name of the security group that you can use as part of your inbound rules for your load balancer’s back-end application instances. Use this for Classic or Default VPC only.

sourceSecurityGroupId string

The ID of the security group that you can use as part of your inbound rules for your load balancer’s back-end application instances. Only available on ELBs launched in a VPC.

subnets string[]

A list of subnet IDs to attach to the ELB.

tags {[key: string]: string}

A map of tags to assign to the resource.

zoneId string

The canonical hosted zone ID of the ELB (to be used in a Route 53 Alias record)

access_logs Dict[LoadBalancerAccessLogs]

An Access Logs block. Access Logs documented below.

arn str

The ARN of the ELB

availability_zones List[str]

The AZ’s to serve traffic in.

connection_draining bool

Boolean to enable connection draining. Default: false

connection_draining_timeout float

The time in seconds to allow for connections to drain. Default: 300

cross_zone_load_balancing bool

Enable cross-zone load balancing. Default: true

dns_name str

The DNS name of the ELB

health_check Dict[LoadBalancerHealthCheck]

A health_check block. Health Check documented below.

idle_timeout float

The time in seconds that the connection is allowed to be idle. Default: 60

instances List[str]

A list of instance ids to place in the ELB pool.

internal bool

If true, ELB will be an internal ELB.

listeners List[LoadBalancerListener]

A list of listener blocks. Listeners documented below.

name str

The name of the ELB. By default generated by this provider.

name_prefix str

Creates a unique name beginning with the specified prefix. Conflicts with name.

security_groups List[str]

A list of security group IDs to assign to the ELB. Only valid if creating an ELB within a VPC

source_security_group str

The name of the security group that you can use as part of your inbound rules for your load balancer’s back-end application instances. Use this for Classic or Default VPC only.

source_security_group_id str

The ID of the security group that you can use as part of your inbound rules for your load balancer’s back-end application instances. Only available on ELBs launched in a VPC.

subnets List[str]

A list of subnet IDs to attach to the ELB.

tags Dict[str, str]

A map of tags to assign to the resource.

zone_id str

The canonical hosted zone ID of the ELB (to be used in a Route 53 Alias record)

Supporting Types

LoadBalancerAccessLogs

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

Bucket string

The S3 bucket name to store the logs in.

BucketPrefix string

The S3 bucket prefix. Logs are stored in the root if not configured.

Enabled bool

Boolean to enable / disable access_logs. Default is true

Interval int

The publishing interval in minutes. Default: 60 minutes.

Bucket string

The S3 bucket name to store the logs in.

BucketPrefix string

The S3 bucket prefix. Logs are stored in the root if not configured.

Enabled bool

Boolean to enable / disable access_logs. Default is true

Interval int

The publishing interval in minutes. Default: 60 minutes.

bucket string

The S3 bucket name to store the logs in.

bucketPrefix string

The S3 bucket prefix. Logs are stored in the root if not configured.

enabled boolean

Boolean to enable / disable access_logs. Default is true

interval number

The publishing interval in minutes. Default: 60 minutes.

bucket str

The S3 bucket name to store the logs in.

bucket_prefix str

The S3 bucket prefix. Logs are stored in the root if not configured.

enabled bool

Boolean to enable / disable access_logs. Default is true

interval float

The publishing interval in minutes. Default: 60 minutes.

LoadBalancerHealthCheck

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

HealthyThreshold int

The number of checks before the instance is declared healthy.

Interval int

The interval between checks.

Target string

The target of the check. Valid pattern is “${PROTOCOL}:${PORT}${PATH}“, where PROTOCOL values are: * HTTP, HTTPS - PORT and PATH are required * TCP, SSL - PORT is required, PATH is not supported

Timeout int

The length of time before the check times out.

UnhealthyThreshold int

The number of checks before the instance is declared unhealthy.

HealthyThreshold int

The number of checks before the instance is declared healthy.

Interval int

The interval between checks.

Target string

The target of the check. Valid pattern is “${PROTOCOL}:${PORT}${PATH}“, where PROTOCOL values are: * HTTP, HTTPS - PORT and PATH are required * TCP, SSL - PORT is required, PATH is not supported

Timeout int

The length of time before the check times out.

UnhealthyThreshold int

The number of checks before the instance is declared unhealthy.

healthyThreshold number

The number of checks before the instance is declared healthy.

interval number

The interval between checks.

target string

The target of the check. Valid pattern is “${PROTOCOL}:${PORT}${PATH}“, where PROTOCOL values are: * HTTP, HTTPS - PORT and PATH are required * TCP, SSL - PORT is required, PATH is not supported

timeout number

The length of time before the check times out.

unhealthyThreshold number

The number of checks before the instance is declared unhealthy.

healthyThreshold float

The number of checks before the instance is declared healthy.

interval float

The interval between checks.

target str

The target of the check. Valid pattern is “${PROTOCOL}:${PORT}${PATH}“, where PROTOCOL values are: * HTTP, HTTPS - PORT and PATH are required * TCP, SSL - PORT is required, PATH is not supported

timeout float

The length of time before the check times out.

unhealthyThreshold float

The number of checks before the instance is declared unhealthy.

LoadBalancerListener

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

InstancePort int

The port on the instance to route to

InstanceProtocol string

The protocol to use to the instance. Valid values are HTTP, HTTPS, TCP, or SSL

LbPort int

The port to listen on for the load balancer

LbProtocol string

The protocol to listen on. Valid values are HTTP, HTTPS, TCP, or SSL

SslCertificateId string

The ARN of an SSL certificate you have uploaded to AWS IAM. Note ECDSA-specific restrictions below. Only valid when lb_protocol is either HTTPS or SSL

InstancePort int

The port on the instance to route to

InstanceProtocol string

The protocol to use to the instance. Valid values are HTTP, HTTPS, TCP, or SSL

LbPort int

The port to listen on for the load balancer

LbProtocol string

The protocol to listen on. Valid values are HTTP, HTTPS, TCP, or SSL

SslCertificateId string

The ARN of an SSL certificate you have uploaded to AWS IAM. Note ECDSA-specific restrictions below. Only valid when lb_protocol is either HTTPS or SSL

instancePort number

The port on the instance to route to

instanceProtocol string

The protocol to use to the instance. Valid values are HTTP, HTTPS, TCP, or SSL

lbPort number

The port to listen on for the load balancer

lbProtocol string

The protocol to listen on. Valid values are HTTP, HTTPS, TCP, or SSL

sslCertificateId string

The ARN of an SSL certificate you have uploaded to AWS IAM. Note ECDSA-specific restrictions below. Only valid when lb_protocol is either HTTPS or SSL

instanceProtocol str

The protocol to use to the instance. Valid values are HTTP, HTTPS, TCP, or SSL

instance_port float

The port on the instance to route to

lbProtocol str

The protocol to listen on. Valid values are HTTP, HTTPS, TCP, or SSL

lb_port float

The port to listen on for the load balancer

sslCertificateId str

The ARN of an SSL certificate you have uploaded to AWS IAM. Note ECDSA-specific restrictions below. Only valid when lb_protocol is either HTTPS or SSL

Package Details

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