This repo contains a Module to deploy a Elastic Load Balancer (ELB) on AWS using Terraform.
This Module works well with the following related modules:
- Consumer EC2 Module
This module is maintained by the Organization's Infrastructure Team. Email [email protected] for more info.
Version | Description | Security Team Approval? | Approver | Approval Date |
---|---|---|---|---|
v1.1 | closed firewall ports | Yes | John Doe | 01/01/2019 |
v1.0 | Initial ELB | No | N/A | N/A |
module "elb" {
source = "app.terraform.io/<YOURTFEORGNAME>/consumer-elb/aws"
version = "1.13"
name = "${var.name}-elb"
environment = "${var.environment}"
# ELB attachments
number_of_instances = "${var.number_of_instances}"
instances = ["${module.ec2_instances.id}"]
}
module "ec2_instances" {
source = "app.terraform.io/<YOURTFEORGNAME>/consumer-ec2-instance/aws"
version = "1.4"
name = "${var.name}-ec2"
instance_count = "${var.number_of_instances}"
}
Name | Description | Type | Default | Required |
---|---|---|---|---|
environment | Choose: dev,stage,prod | string | - | yes |
instances | List of instances ID to place in the ELB pool | list | <list> |
yes |
name | The name of the ELB | string | - | yes |
number_of_instances | Number of instances to attach to ELB | string | 2 |
no |
This module contains no outputs.
Name | Description |
---|
Name | Description |
---|---|
security group | Ingress: Allow TCP port 80 from 0.0.0.0/0 |
listener | lb_port = 80 lb_protocol = "http" instance_port = "8080" instance_protocol = "http" |
health check | healthy_threshold = 2 unhealthy_threshold = 2 timeout = 3 interval = 30 target = "HTTP:8080/" |