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
instancesdefined 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
new LoadBalancer(name: string, args: LoadBalancerArgs, opts?: CustomResourceOptions);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)public LoadBalancer(string name, LoadBalancerArgs args, CustomResourceOptions? opts = null)- 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<Load
Balancer Listener Args> A list of listener blocks. Listeners documented below.
- Access
Logs LoadBalancer Access Logs Args An Access Logs block. Access Logs documented below.
- Availability
Zones List<string> The AZ’s to serve traffic in.
- Connection
Draining bool Boolean to enable connection draining. Default:
false- Connection
Draining intTimeout The time in seconds to allow for connections to drain. Default:
300- Cross
Zone boolLoad Balancing Enable cross-zone load balancing. Default:
true- Health
Check LoadBalancer Health Check Args A health_check block. Health Check documented below.
- Idle
Timeout 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.
- Name
Prefix string Creates a unique name beginning with the specified prefix. Conflicts with
name.- Security
Groups List<string> A list of security group IDs to assign to the ELB. Only valid if creating an ELB within a VPC
- Source
Security stringGroup 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.
- Dictionary<string, string>
A map of tags to assign to the resource.
- Listeners
[]Load
Balancer Listener A list of listener blocks. Listeners documented below.
- Access
Logs LoadBalancer Access Logs An Access Logs block. Access Logs documented below.
- Availability
Zones []string The AZ’s to serve traffic in.
- Connection
Draining bool Boolean to enable connection draining. Default:
false- Connection
Draining intTimeout The time in seconds to allow for connections to drain. Default:
300- Cross
Zone boolLoad Balancing Enable cross-zone load balancing. Default:
true- Health
Check LoadBalancer Health Check A health_check block. Health Check documented below.
- Idle
Timeout 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.
- Name
Prefix string Creates a unique name beginning with the specified prefix. Conflicts with
name.- Security
Groups []string A list of security group IDs to assign to the ELB. Only valid if creating an ELB within a VPC
- Source
Security stringGroup 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.
- map[string]string
A map of tags to assign to the resource.
- listeners
Load
Balancer Listener[] A list of listener blocks. Listeners documented below.
- access
Logs LoadBalancer Access Logs An Access Logs block. Access Logs documented below.
- availability
Zones string[] The AZ’s to serve traffic in.
- connection
Draining boolean Boolean to enable connection draining. Default:
false- connection
Draining numberTimeout The time in seconds to allow for connections to drain. Default:
300- cross
Zone booleanLoad Balancing Enable cross-zone load balancing. Default:
true- health
Check LoadBalancer Health Check A health_check block. Health Check documented below.
- idle
Timeout 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.
- name
Prefix string Creates a unique name beginning with the specified prefix. Conflicts with
name.- security
Groups string[] A list of security group IDs to assign to the ELB. Only valid if creating an ELB within a VPC
- source
Security stringGroup 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.
- {[key: string]: string}
A map of tags to assign to the resource.
- listeners
List[Load
Balancer Listener] A list of listener blocks. Listeners documented below.
- access_
logs Dict[LoadBalancer Access Logs] 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_ floattimeout The time in seconds to allow for connections to drain. Default:
300- cross_
zone_ boolload_ balancing Enable cross-zone load balancing. Default:
true- health_
check Dict[LoadBalancer Health Check] 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_ strgroup 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.
- 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
- Dns
Name string The DNS name of the ELB
- Id string
- The provider-assigned unique ID for this managed resource.
- Source
Security stringGroup Id 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 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
- Dns
Name string The DNS name of the ELB
- Id string
- The provider-assigned unique ID for this managed resource.
- Source
Security stringGroup Id 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 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
- dns
Name string The DNS name of the ELB
- id string
- The provider-assigned unique ID for this managed resource.
- source
Security stringGroup Id 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 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_ strgroup_ id 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): LoadBalancerstatic 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:
- Access
Logs LoadBalancer Access Logs Args An Access Logs block. Access Logs documented below.
- Arn string
The ARN of the ELB
- Availability
Zones List<string> The AZ’s to serve traffic in.
- Connection
Draining bool Boolean to enable connection draining. Default:
false- Connection
Draining intTimeout The time in seconds to allow for connections to drain. Default:
300- Cross
Zone boolLoad Balancing Enable cross-zone load balancing. Default:
true- Dns
Name string The DNS name of the ELB
- Health
Check LoadBalancer Health Check Args A health_check block. Health Check documented below.
- Idle
Timeout 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<Load
Balancer Listener Args> A list of listener blocks. Listeners documented below.
- Name string
The name of the ELB. By default generated by this provider.
- Name
Prefix string Creates a unique name beginning with the specified prefix. Conflicts with
name.- Security
Groups List<string> A list of security group IDs to assign to the ELB. Only valid if creating an ELB within a VPC
- Source
Security stringGroup 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 stringGroup Id 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.
- Dictionary<string, string>
A map of tags to assign to the resource.
- Zone
Id string The canonical hosted zone ID of the ELB (to be used in a Route 53 Alias record)
- Access
Logs LoadBalancer Access Logs An Access Logs block. Access Logs documented below.
- Arn string
The ARN of the ELB
- Availability
Zones []string The AZ’s to serve traffic in.
- Connection
Draining bool Boolean to enable connection draining. Default:
false- Connection
Draining intTimeout The time in seconds to allow for connections to drain. Default:
300- Cross
Zone boolLoad Balancing Enable cross-zone load balancing. Default:
true- Dns
Name string The DNS name of the ELB
- Health
Check LoadBalancer Health Check A health_check block. Health Check documented below.
- Idle
Timeout 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
[]Load
Balancer Listener A list of listener blocks. Listeners documented below.
- Name string
The name of the ELB. By default generated by this provider.
- Name
Prefix string Creates a unique name beginning with the specified prefix. Conflicts with
name.- Security
Groups []string A list of security group IDs to assign to the ELB. Only valid if creating an ELB within a VPC
- Source
Security stringGroup 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 stringGroup Id 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.
- map[string]string
A map of tags to assign to the resource.
- Zone
Id string The canonical hosted zone ID of the ELB (to be used in a Route 53 Alias record)
- access
Logs LoadBalancer Access Logs An Access Logs block. Access Logs documented below.
- arn string
The ARN of the ELB
- availability
Zones string[] The AZ’s to serve traffic in.
- connection
Draining boolean Boolean to enable connection draining. Default:
false- connection
Draining numberTimeout The time in seconds to allow for connections to drain. Default:
300- cross
Zone booleanLoad Balancing Enable cross-zone load balancing. Default:
true- dns
Name string The DNS name of the ELB
- health
Check LoadBalancer Health Check A health_check block. Health Check documented below.
- idle
Timeout 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
Load
Balancer Listener[] A list of listener blocks. Listeners documented below.
- name string
The name of the ELB. By default generated by this provider.
- name
Prefix string Creates a unique name beginning with the specified prefix. Conflicts with
name.- security
Groups string[] A list of security group IDs to assign to the ELB. Only valid if creating an ELB within a VPC
- source
Security stringGroup 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 stringGroup Id 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.
- {[key: string]: string}
A map of tags to assign to the resource.
- zone
Id string The canonical hosted zone ID of the ELB (to be used in a Route 53 Alias record)
- access_
logs Dict[LoadBalancer Access Logs] 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_ floattimeout The time in seconds to allow for connections to drain. Default:
300- cross_
zone_ boolload_ balancing Enable cross-zone load balancing. Default:
true- dns_
name str The DNS name of the ELB
- health_
check Dict[LoadBalancer Health Check] 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[Load
Balancer Listener] 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_ strgroup 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_ strgroup_ id 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.
- 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
LoadBalancerHealthCheck
- Healthy
Threshold 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.
- Unhealthy
Threshold int The number of checks before the instance is declared unhealthy.
- Healthy
Threshold 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.
- Unhealthy
Threshold int The number of checks before the instance is declared unhealthy.
- healthy
Threshold 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.
- unhealthy
Threshold number The number of checks before the instance is declared unhealthy.
- healthy
Threshold 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.
- unhealthy
Threshold float The number of checks before the instance is declared unhealthy.
LoadBalancerListener
- Instance
Port int The port on the instance to route to
- Instance
Protocol string The protocol to use to the instance. Valid values are
HTTP,HTTPS,TCP, orSSL- Lb
Port int The port to listen on for the load balancer
- Lb
Protocol string The protocol to listen on. Valid values are
HTTP,HTTPS,TCP, orSSL- Ssl
Certificate stringId The ARN of an SSL certificate you have uploaded to AWS IAM. Note ECDSA-specific restrictions below. Only valid when
lb_protocolis either HTTPS or SSL
- Instance
Port int The port on the instance to route to
- Instance
Protocol string The protocol to use to the instance. Valid values are
HTTP,HTTPS,TCP, orSSL- Lb
Port int The port to listen on for the load balancer
- Lb
Protocol string The protocol to listen on. Valid values are
HTTP,HTTPS,TCP, orSSL- Ssl
Certificate stringId The ARN of an SSL certificate you have uploaded to AWS IAM. Note ECDSA-specific restrictions below. Only valid when
lb_protocolis either HTTPS or SSL
- instance
Port number The port on the instance to route to
- instance
Protocol string The protocol to use to the instance. Valid values are
HTTP,HTTPS,TCP, orSSL- lb
Port number The port to listen on for the load balancer
- lb
Protocol string The protocol to listen on. Valid values are
HTTP,HTTPS,TCP, orSSL- ssl
Certificate stringId The ARN of an SSL certificate you have uploaded to AWS IAM. Note ECDSA-specific restrictions below. Only valid when
lb_protocolis either HTTPS or SSL
- instance
Protocol str The protocol to use to the instance. Valid values are
HTTP,HTTPS,TCP, orSSL- instance_
port float The port on the instance to route to
- lb
Protocol str The protocol to listen on. Valid values are
HTTP,HTTPS,TCP, orSSL- lb_
port float The port to listen on for the load balancer
- ssl
Certificate strId The ARN of an SSL certificate you have uploaded to AWS IAM. Note ECDSA-specific restrictions below. Only valid when
lb_protocolis 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
awsTerraform Provider.