diff --git a/README.md b/README.md index ebe0c9f..0393033 100644 --- a/README.md +++ b/README.md @@ -17,9 +17,9 @@ Module Input Variables - `region` - AWS Region - defaults to us-east-1 - `servers` - Number of ECS Servers to start in the cluster - defaults to 2 - `instance_type` - AWS instance type - defaults to t2.micro +- `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 - `dockerhub_email` - Email Address used to authenticate to dockerhub. http://docs.aws.amazon.com/AmazonECS/latest/developerguide/private-auth.html - - `dockerhub_token` - Auth Token used for dockerhub. http://docs.aws.amazon.com/AmazonECS/latest/developerguide/private-auth.html - `extra_tags` - Additional tags to be added to the ECS autoscaling group. Must be in the form of an array of hashes. See https://www.terraform.io/docs/providers/aws/r/autoscaling_group.html for examples. ``` diff --git a/main.tf b/main.tf index d9b521e..eaa25dd 100644 --- a/main.tf +++ b/main.tf @@ -13,13 +13,13 @@ data "aws_ami" "ecs_ami" { } resource "aws_launch_configuration" "ecs" { - #name = "ecs-${var.name}" name_prefix = "ecs-${var.name}-" image_id = "${var.ami == "" ? format("%s", data.aws_ami.ecs_ami.id) : var.ami}" # Workaround until 0.9.6 instance_type = "${var.instance_type}" key_name = "${var.key_name}" iam_instance_profile = "${aws_iam_instance_profile.ecs_profile.name}" security_groups = ["${aws_security_group.ecs.id}"] + associate_public_ip_address = "${var.associate_public_ip_address}" ebs_block_device { device_name = "/dev/xvdcz" volume_size = "${var.docker_storage_size}" @@ -40,7 +40,6 @@ EOF } resource "aws_autoscaling_group" "ecs" { - #name = "ecs-asg-${var.name}" name = "asg-${aws_launch_configuration.ecs.name}" vpc_zone_identifier = ["${var.subnet_id}"] launch_configuration = "${aws_launch_configuration.ecs.name}" diff --git a/variables.tf b/variables.tf index 5c0c942..da01d3d 100644 --- a/variables.tf +++ b/variables.tf @@ -79,3 +79,7 @@ variable "tagName" { variable "vpc_id" { description = "The AWS VPC ID which you want to deploy your instances" } + +variable "associate_public_ip_address" { + default = false +}