LoadBalancerArgs

data class LoadBalancerArgs constructor(val accessLogs: Output<LoadBalancerAccessLogsArgs>? = null, val availabilityZones: Output<List<String>>? = null, val connectionDraining: Output<Boolean>? = null, val connectionDrainingTimeout: Output<Int>? = null, val crossZoneLoadBalancing: Output<Boolean>? = null, val desyncMitigationMode: Output<String>? = null, val healthCheck: Output<LoadBalancerHealthCheckArgs>? = null, val idleTimeout: Output<Int>? = null, val instances: Output<List<String>>? = null, val internal: Output<Boolean>? = null, val listeners: Output<List<LoadBalancerListenerArgs>>? = null, val name: Output<String>? = null, val namePrefix: Output<String>? = null, val securityGroups: Output<List<String>>? = null, val sourceSecurityGroup: Output<String>? = null, val subnets: Output<List<String>>? = null, val tags: Output<Map<String, String>>? = null) : ConvertibleToJava<LoadBalancerArgs>

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

Constructors

Link copied to clipboard
constructor(accessLogs: Output<LoadBalancerAccessLogsArgs>? = null, availabilityZones: Output<List<String>>? = null, connectionDraining: Output<Boolean>? = null, connectionDrainingTimeout: Output<Int>? = null, crossZoneLoadBalancing: Output<Boolean>? = null, desyncMitigationMode: Output<String>? = null, healthCheck: Output<LoadBalancerHealthCheckArgs>? = null, idleTimeout: Output<Int>? = null, instances: Output<List<String>>? = null, internal: Output<Boolean>? = null, listeners: Output<List<LoadBalancerListenerArgs>>? = null, name: Output<String>? = null, namePrefix: Output<String>? = null, securityGroups: Output<List<String>>? = null, sourceSecurityGroup: Output<String>? = null, subnets: Output<List<String>>? = null, tags: Output<Map<String, String>>? = null)

Properties

Link copied to clipboard

An Access Logs block. Access Logs documented below.

Link copied to clipboard
val availabilityZones: Output<List<String>>? = null

The AZ's to serve traffic in.

Link copied to clipboard
val connectionDraining: Output<Boolean>? = null

Boolean to enable connection draining. Default: false

Link copied to clipboard
val connectionDrainingTimeout: Output<Int>? = null

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

Link copied to clipboard
val crossZoneLoadBalancing: Output<Boolean>? = null

Enable cross-zone load balancing. Default: true

Link copied to clipboard
val desyncMitigationMode: Output<String>? = null

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

A health_check block. Health Check documented below.

Link copied to clipboard
val idleTimeout: Output<Int>? = null

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

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

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

Link copied to clipboard
val internal: Output<Boolean>? = null

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>? = null

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

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

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

Link copied to clipboard
val securityGroups: Output<List<String>>? = null

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

Link copied to clipboard
val sourceSecurityGroup: Output<String>? = null

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
val subnets: Output<List<String>>? = null

A list of subnet IDs to attach to the ELB.

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

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.

Functions

Link copied to clipboard
open override fun toJava(): LoadBalancerArgs