LoadBalancer

class LoadBalancer : KotlinCustomResource

Deprecated

aws.elasticloadbalancing.LoadBalancer has been deprecated in favor of aws.elb.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.

Example Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.elb.LoadBalancer;
import com.pulumi.aws.elb.LoadBalancerArgs;
import com.pulumi.aws.elb.inputs.LoadBalancerAccessLogsArgs;
import com.pulumi.aws.elb.inputs.LoadBalancerListenerArgs;
import com.pulumi.aws.elb.inputs.LoadBalancerHealthCheckArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var bar = new LoadBalancer("bar", LoadBalancerArgs.builder()
.availabilityZones(
"us-west-2a",
"us-west-2b",
"us-west-2c")
.accessLogs(LoadBalancerAccessLogsArgs.builder()
.bucket("foo")
.bucketPrefix("bar")
.interval(60)
.build())
.listeners(
LoadBalancerListenerArgs.builder()
.instancePort(8000)
.instanceProtocol("http")
.lbPort(80)
.lbProtocol("http")
.build(),
LoadBalancerListenerArgs.builder()
.instancePort(8000)
.instanceProtocol("http")
.lbPort(443)
.lbProtocol("https")
.sslCertificateId("arn:aws:iam::123456789012:server-certificate/certName")
.build())
.healthCheck(LoadBalancerHealthCheckArgs.builder()
.healthyThreshold(2)
.unhealthyThreshold(2)
.timeout(3)
.target("HTTP:8000/")
.interval(30)
.build())
.instances(aws_instance.foo().id())
.crossZoneLoadBalancing(true)
.idleTimeout(400)
.connectionDraining(true)
.connectionDrainingTimeout(400)
.tags(Map.of("Name", "foobar-elb"))
.build());
}
}

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.

Import

ELBs can be imported using the name, e.g.,

$ pulumi import aws:elasticloadbalancing/loadBalancer:LoadBalancer bar elb-production-12345

Properties

Link copied to clipboard

An Access Logs block. Access Logs documented below.

Link copied to clipboard
val arn: Output<String>

The ARN of the ELB

Link copied to clipboard

The AZ's to serve traffic in.

Link copied to clipboard

Boolean to enable connection draining. Default: false

Link copied to clipboard

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

Link copied to clipboard

Enable cross-zone load balancing. Default: true

Link copied to clipboard

Determines how the load balancer handles requests that might pose a security risk to an application due to HTTP desync. Valid values are monitor, defensive (default), strictest.

Link copied to clipboard
val dnsName: Output<String>

The DNS name of the ELB

Link copied to clipboard

A health_check block. Health Check documented below.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val idleTimeout: Output<Int>?

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

Link copied to clipboard
val instances: Output<List<String>>

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

Link copied to clipboard
val internal: Output<Boolean>

If true, ELB will be an internal ELB.

Link copied to clipboard

A list of listener blocks. Listeners documented below.

Link copied to clipboard
val name: Output<String>

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

Link copied to clipboard
val namePrefix: Output<String>?

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

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val securityGroups: Output<List<String>>

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

Link copied to clipboard

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.

Link copied to clipboard

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.

Link copied to clipboard
val subnets: Output<List<String>>

A list of subnet IDs to attach to the ELB.

Link copied to clipboard
val tags: Output<Map<String, String>>?

A map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level. Exactly one of availability_zones or subnets must be specified: this determines if the ELB exists in a VPC or in EC2-classic.

Link copied to clipboard
val tagsAll: Output<Map<String, String>>

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Link copied to clipboard
val urn: Output<String>
Link copied to clipboard
val zoneId: Output<String>

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