AWS Elastic Load Balancing ELB

This page shows how to write Terraform and CloudFormation for Elastic Load Balancing ELB and write them securely.

aws_elb (Terraform)

The ELB in Elastic Load Balancing can be configured in Terraform with the resource name aws_elb. The following sections describe 2 examples of how to use the resource and its parameters.

Example Usage from GitHub

github-iconstelligent/config-lint
resource "aws_elb" "access_logs_set" {
  availability_zones = [
    "us-east-1a",
    "us-east-1b",
    "us-east-1c"
  ]
github-iconstelligent/config-lint
resource "aws_elb" "access_logs_set" {
  availability_zones = [
    "us-east-1a",
    "us-east-1b",
    "us-east-1c"
  ]

Parameters

Explanation in Terraform Registry

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: Terraform 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.

AWS::ElasticLoadBalancing::LoadBalancer (CloudFormation)

The LoadBalancer in ElasticLoadBalancing can be configured in CloudFormation with the resource name AWS::ElasticLoadBalancing::LoadBalancer. The following sections describe how to use the resource and its parameters.

Parameters

Explanation in CloudFormation Registry

Specifies a Classic Load Balancer.

You can specify the AvailabilityZones or Subnets property, but not both.

If this resource has a public IP address and is also in a VPC that is defined in the same template, you must use the DependsOn attribute to declare a dependency on the VPC-gateway attachment.

Frequently asked questions

What is AWS Elastic Load Balancing ELB?

AWS Elastic Load Balancing ELB is a resource for Elastic Load Balancing of Amazon Web Service. Settings can be wrote in Terraform and CloudFormation.

Where can I find the example code for the AWS Elastic Load Balancing ELB?

For Terraform, the stelligent/config-lint and stelligent/config-lint source code examples are useful. See the Terraform Example section for further details.