Class 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.
Example Usage
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
// Create a new load balancer
var bar = new Aws.Elb.LoadBalancer("bar", new Aws.Elb.LoadBalancerArgs
{
AccessLogs = new Aws.Elb.Inputs.LoadBalancerAccessLogsArgs
{
Bucket = "foo",
BucketPrefix = "bar",
Interval = 60,
},
AvailabilityZones =
{
"us-west-2a",
"us-west-2b",
"us-west-2c",
},
ConnectionDraining = true,
ConnectionDrainingTimeout = 400,
CrossZoneLoadBalancing = true,
HealthCheck = new Aws.Elb.Inputs.LoadBalancerHealthCheckArgs
{
HealthyThreshold = 2,
Interval = 30,
Target = "HTTP:8000/",
Timeout = 3,
UnhealthyThreshold = 2,
},
IdleTimeout = 400,
Instances =
{
aws_instance.Foo.Id,
},
Listeners =
{
new Aws.Elb.Inputs.LoadBalancerListenerArgs
{
InstancePort = 8000,
InstanceProtocol = "http",
LbPort = 80,
LbProtocol = "http",
},
new Aws.Elb.Inputs.LoadBalancerListenerArgs
{
InstancePort = 8000,
InstanceProtocol = "http",
LbPort = 443,
LbProtocol = "https",
SslCertificateId = "arn:aws:iam::123456789012:server-certificate/certName",
},
},
Tags =
{
{ "Name", "foobar-elb" },
},
});
}
}
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.
Inherited Members
Namespace: Pulumi.Aws.Elb
Assembly: Pulumi.Aws.dll
Syntax
public class LoadBalancer : CustomResource
Constructors
View SourceLoadBalancer(String, LoadBalancerArgs, CustomResourceOptions)
Create a LoadBalancer resource with the given unique name, arguments, and options.
Declaration
public LoadBalancer(string name, LoadBalancerArgs args, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resource |
| LoadBalancerArgs | args | The arguments used to populate this resource's properties |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Properties
View SourceAccessLogs
An Access Logs block. Access Logs documented below.
Declaration
public Output<LoadBalancerAccessLogs> AccessLogs { get; }
Property Value
| Type | Description |
|---|---|
| Output<LoadBalancerAccessLogs> |
Arn
The ARN of the ELB
Declaration
public Output<string> Arn { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
AvailabilityZones
The AZ's to serve traffic in.
Declaration
public Output<ImmutableArray<string>> AvailabilityZones { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<System.String>> |
ConnectionDraining
Boolean to enable connection draining. Default: false
Declaration
public Output<bool?> ConnectionDraining { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Boolean>> |
ConnectionDrainingTimeout
The time in seconds to allow for connections to drain. Default: 300
Declaration
public Output<int?> ConnectionDrainingTimeout { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Int32>> |
CrossZoneLoadBalancing
Enable cross-zone load balancing. Default: true
Declaration
public Output<bool?> CrossZoneLoadBalancing { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Boolean>> |
DnsName
The DNS name of the ELB
Declaration
public Output<string> DnsName { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
HealthCheck
A health_check block. Health Check documented below.
Declaration
public Output<LoadBalancerHealthCheck> HealthCheck { get; }
Property Value
| Type | Description |
|---|---|
| Output<LoadBalancerHealthCheck> |
IdleTimeout
The time in seconds that the connection is allowed to be idle. Default: 60
Declaration
public Output<int?> IdleTimeout { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Int32>> |
Instances
A list of instance ids to place in the ELB pool.
Declaration
public Output<ImmutableArray<string>> Instances { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<System.String>> |
Internal
If true, ELB will be an internal ELB.
Declaration
public Output<bool> Internal { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Boolean> |
Listeners
A list of listener blocks. Listeners documented below.
Declaration
public Output<ImmutableArray<LoadBalancerListener>> Listeners { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<LoadBalancerListener>> |
Name
The name of the ELB. By default generated by this provider.
Declaration
public Output<string> Name { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
NamePrefix
Creates a unique name beginning with the specified
prefix. Conflicts with name.
Declaration
public Output<string> NamePrefix { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
SecurityGroups
A list of security group IDs to assign to the ELB. Only valid if creating an ELB within a VPC
Declaration
public Output<ImmutableArray<string>> SecurityGroups { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<System.String>> |
SourceSecurityGroup
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.
Declaration
public Output<string> SourceSecurityGroup { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
SourceSecurityGroupId
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.
Declaration
public Output<string> SourceSecurityGroupId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Subnets
A list of subnet IDs to attach to the ELB.
Declaration
public Output<ImmutableArray<string>> Subnets { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<System.String>> |
Tags
A map of tags to assign to the resource.
Declaration
public Output<ImmutableDictionary<string, object>> Tags { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableDictionary<System.String, System.Object>> |
ZoneId
The canonical hosted zone ID of the ELB (to be used in a Route 53 Alias record)
Declaration
public Output<string> ZoneId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Methods
View SourceGet(String, Input<String>, LoadBalancerState, CustomResourceOptions)
Get an existing LoadBalancer resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
Declaration
public static LoadBalancer Get(string name, Input<string> id, LoadBalancerState state = null, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resulting resource. |
| Input<System.String> | id | The unique provider ID of the resource to lookup. |
| LoadBalancerState | state | Any extra arguments used during the lookup. |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Returns
| Type | Description |
|---|---|
| LoadBalancer |