diff --git a/README.md b/README.md index 1f837c1..f7fc09f 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,7 @@ Module Input Variables - `min_servers` - Minimum number of ECS Servers to start in the cluster - defaults to 1 - `max_servers` - Maximum number of ECS Servers to start in the cluster - defaults to 10 - `instance_type` - AWS instance type - defaults to t2.micro +- `load_balancers` - List of elastic load balancer (classic only) names to put in front of your instances - defaults to [] - `iam_path` - IAM path, this is useful when creating resources with the same name across multiple regions. Defaults to / - `associate_public_ip_address` - assign a publicly-routable IP address to every instance in the cluster - default: `false`. - `docker_storage_size` - EBS Volume size in Gib that the ECS Instance uses for Docker images and metadata - defaults to 22 diff --git a/main.tf b/main.tf index 47b5ba9..f241f58 100644 --- a/main.tf +++ b/main.tf @@ -60,6 +60,7 @@ resource "aws_autoscaling_group" "ecs" { max_size = "${var.max_servers}" desired_capacity = "${var.servers}" termination_policies = ["OldestLaunchConfiguration", "ClosestToNextInstanceHour", "Default"] + load_balancers = ["${var.load_balancers}"] tags = [{ key = "Name" diff --git a/variables.tf b/variables.tf index c81a8ee..32cffba 100644 --- a/variables.tf +++ b/variables.tf @@ -56,7 +56,7 @@ variable "ebs_block_device" { } variable "extra_tags" { - type = "list" + type = "list" default = [] } @@ -84,6 +84,12 @@ variable "key_name" { description = "SSH key name in your AWS account for AWS instances." } +variable "load_balancers" { + type = "list" + default = [] + description = "A list of elastic load balancer names to add to the autoscaling group names. Only valid for classic load balancers." +} + variable "min_servers" { description = "Minimum number of ECS servers to run." default = 1 @@ -129,7 +135,7 @@ variable "servers" { } variable "spot_bid_price" { - default = "" + default = "" description = "If specified, spot instances will be requested at this bid price. If not specified, on-demand instances will be used." }