From 406db94657c7770b8efcd139092dc2a02d61be58 Mon Sep 17 00:00:00 2001 From: Tom Davidson Date: Fri, 22 Jul 2016 12:32:03 -0600 Subject: [PATCH 01/19] document ecs_instance_ebs_optimize input var Documenting this input will help users avoid confusion over why the ASG fails to populate with lower bandwidth instance types that are set to be EBS Optimized (T2.*, M3.medium, etc). Smaller instance types are likely to be used in DDD for a collection of domain related microservices where as one big Stack of large instances types would make more sense for sharing the Stack among multiple domains. --- docs.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs.md b/docs.md index b8ed07d4..4398bb3d 100644 --- a/docs.md +++ b/docs.md @@ -30,6 +30,7 @@ | external_subnets | a comma-separated list of CIDRs for external subnets in your VPC, must be set if the cidr variable is defined, needs to have as many elements as there are availability zones | `"10.30.32.0/20,10.30.96.0/20,10.30.160.0/20"` | no | | availability_zones | a comma-separated list of availability zones, defaults to all AZ of the region, if set to something other than the defaults, both internal_subnets and external_subnets have to be defined as well | `"us-west-2a,us-west-2b,us-west-2c"` | no | | ecs_instance_type | the instance type to use for your default ecs cluster | `"m4.large"` | no | +| ecs_instance_ebs_optimized | use EBS - not all instance types support EBS | `"true"` | no | | ecs_min_size | the minimum number of instances to use in the default ecs cluster | `3` | no | | ecs_max_size | the maximum number of instances to use in the default ecs cluster | `100` | no | | ecs_desired_capacity | the desired number of instances to use in the default ecs cluster | `3` | no | From 5572b3b8d4ba25c469235cf850f5ee55149006cd Mon Sep 17 00:00:00 2001 From: Achille Roussel Date: Fri, 22 Jul 2016 15:34:47 -0700 Subject: [PATCH 02/19] [hot fix] update description --- main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.tf b/main.tf index f4b689a1..38588911 100644 --- a/main.tf +++ b/main.tf @@ -76,7 +76,7 @@ variable "ecs_instance_type" { } variable "ecs_instance_ebs_optimized" { - description = "ebs optimize or not cluster instances" + description = "use EBS - not all instance types support EBS" default = true } From 3ce318f2db45bdb3b05f0067e57b81d3152faa1d Mon Sep 17 00:00:00 2001 From: Jeff Gonzalez Date: Tue, 9 Aug 2016 15:56:30 -0500 Subject: [PATCH 03/19] Refactor to support Terraform 0.7 * Only refactored external/internal subnet variables & availability zones for now. --- ecs-cluster/main.tf | 14 ++++++++------ main.tf | 12 ++++++------ vpc/main.tf | 39 +++++++++++++++++++++------------------ 3 files changed, 35 insertions(+), 30 deletions(-) diff --git a/ecs-cluster/main.tf b/ecs-cluster/main.tf index ca6267d0..23176c3e 100644 --- a/ecs-cluster/main.tf +++ b/ecs-cluster/main.tf @@ -14,12 +14,12 @@ * name = "cdn" * vpc_id = "vpc-id" * image_id = "ami-id" - * subnet_ids = "1,2" + * subnet_ids = ["1" ,"2"] * key_name = "ssh-key" * security_groups = "1,2" * iam_instance_profile = "id" * region = "us-west-2" - * availability_zones = "a,b" + * availability_zones = ["a", "b"] * instance_type = "t2.small" * } * @@ -42,7 +42,8 @@ variable "image_id" { } variable "subnet_ids" { - description = "Comma separated list of subnet IDs" + description = "List of subnet IDs" + type = "list" } variable "key_name" { @@ -62,7 +63,8 @@ variable "region" { } variable "availability_zones" { - description = "Comma separated list of AZs" + description = "List of AZs" + type = "list" } variable "instance_type" { @@ -200,8 +202,8 @@ resource "aws_launch_configuration" "main" { resource "aws_autoscaling_group" "main" { name = "${var.name}" - availability_zones = ["${split(",", var.availability_zones)}"] - vpc_zone_identifier = ["${split(",", var.subnet_ids)}"] + availability_zones = ["${var.availability_zones}"] + vpc_zone_identifier = ["${var.subnet_ids}"] launch_configuration = "${aws_launch_configuration.main.id}" min_size = "${var.min_size}" max_size = "${var.max_size}" diff --git a/main.tf b/main.tf index 38588911..afd576c3 100644 --- a/main.tf +++ b/main.tf @@ -46,18 +46,18 @@ variable "cidr" { } variable "internal_subnets" { - description = "a comma-separated list of CIDRs for internal subnets in your VPC, must be set if the cidr variable is defined, needs to have as many elements as there are availability zones" - default = "10.30.0.0/19,10.30.64.0/19,10.30.128.0/19" + description = "a list of CIDRs for internal subnets in your VPC, must be set if the cidr variable is defined, needs to have as many elements as there are availability zones" + default = ["10.30.0.0/19" ,"10.30.64.0/19", "10.30.128.0/19"] } variable "external_subnets" { - description = "a comma-separated list of CIDRs for external subnets in your VPC, must be set if the cidr variable is defined, needs to have as many elements as there are availability zones" - default = "10.30.32.0/20,10.30.96.0/20,10.30.160.0/20" + description = "a list of CIDRs for external subnets in your VPC, must be set if the cidr variable is defined, needs to have as many elements as there are availability zones" + default = ["10.30.32.0/20", "10.30.96.0/20", "10.30.160.0/20"] } variable "availability_zones" { description = "a comma-separated list of availability zones, defaults to all AZ of the region, if set to something other than the defaults, both internal_subnets and external_subnets have to be defined as well" - default = "us-west-2a,us-west-2b,us-west-2c" + default = ["us-west-2a", "us-west-2b", "us-west-2c"] } variable "bastion_instance_type" { @@ -159,7 +159,7 @@ module "bastion" { instance_type = "${var.bastion_instance_type}" security_groups = "${module.security_groups.external_ssh},${module.security_groups.internal_ssh}" vpc_id = "${module.vpc.id}" - subnet_id = "${element(split(",",module.vpc.external_subnets), 0)}" + subnet_id = "${element(module.vpc.external_subnets, 0)}" key_name = "${var.key_name}" environment = "${var.environment}" } diff --git a/vpc/main.tf b/vpc/main.tf index 12557126..e058ae9c 100644 --- a/vpc/main.tf +++ b/vpc/main.tf @@ -3,11 +3,13 @@ variable "cidr" { } variable "external_subnets" { - description = "Comma separated list of subnets" + description = "List of external subnets" + type = "list" } variable "internal_subnets" { - description = "Comma separated list of subnets" + description = "List of internal subnets" + type = "list" } variable "environment" { @@ -15,7 +17,8 @@ variable "environment" { } variable "availability_zones" { - description = "Comma separated list of availability zones" + description = "List of availability zones" + type = "list" } variable "name" { @@ -52,14 +55,14 @@ resource "aws_internet_gateway" "main" { } resource "aws_nat_gateway" "main" { - count = "${length(compact(split(",", var.internal_subnets)))}" + count = "${length(var.internal_subnets)}" allocation_id = "${element(aws_eip.nat.*.id, count.index)}" subnet_id = "${element(aws_subnet.external.*.id, count.index)}" depends_on = ["aws_internet_gateway.main"] } resource "aws_eip" "nat" { - count = "${length(compact(split(",", var.internal_subnets)))}" + count = "${length(var.internal_subnets)}" vpc = true } @@ -69,9 +72,9 @@ resource "aws_eip" "nat" { resource "aws_subnet" "internal" { vpc_id = "${aws_vpc.main.id}" - cidr_block = "${element(split(",", var.internal_subnets), count.index)}" - availability_zone = "${element(split(",", var.availability_zones), count.index)}" - count = "${length(compact(split(",", var.internal_subnets)))}" + cidr_block = "${element(var.internal_subnets, count.index)}" + availability_zone = "${element(var.availability_zones, count.index)}" + count = "${length(var.internal_subnets)}" tags { Name = "${var.name}-${format("internal-%03d", count.index+1)}" @@ -80,9 +83,9 @@ resource "aws_subnet" "internal" { resource "aws_subnet" "external" { vpc_id = "${aws_vpc.main.id}" - cidr_block = "${element(split(",", var.external_subnets), count.index)}" - availability_zone = "${element(split(",", var.availability_zones), count.index)}" - count = "${length(compact(split(",", var.external_subnets)))}" + cidr_block = "${element(var.external_subnets, count.index)}" + availability_zone = "${element(var.availability_zones, count.index)}" + count = "${length(var.external_subnets)}" map_public_ip_on_launch = true tags { @@ -108,7 +111,7 @@ resource "aws_route_table" "external" { } resource "aws_route_table" "internal" { - count = "${length(compact(split(",", var.internal_subnets)))}" + count = "${length(var.internal_subnets)}" vpc_id = "${aws_vpc.main.id}" route { @@ -126,13 +129,13 @@ resource "aws_route_table" "internal" { */ resource "aws_route_table_association" "internal" { - count = "${length(compact(split(",", var.internal_subnets)))}" + count = "${length(var.internal_subnets)}" subnet_id = "${element(aws_subnet.internal.*.id, count.index)}" route_table_id = "${element(aws_route_table.internal.*.id, count.index)}" } resource "aws_route_table_association" "external" { - count = "${length(compact(split(",", var.external_subnets)))}" + count = "${length(var.external_subnets)}" subnet_id = "${element(aws_subnet.external.*.id, count.index)}" route_table_id = "${aws_route_table.external.id}" } @@ -148,12 +151,12 @@ output "id" { // A comma-separated list of subnet IDs. output "external_subnets" { - value = "${join(",", aws_subnet.external.*.id)}" + value = ["${aws_subnet.external.*.id}"] } -// A comma-separated list of subnet IDs. +// A list of subnet IDs. output "internal_subnets" { - value = "${join(",", aws_subnet.internal.*.id)}" + value = ["${aws_subnet.internal.*.id}"] } // The default VPC security group ID. @@ -163,5 +166,5 @@ output "security_group" { // The list of availability zones of the VPC. output "availability_zones" { - value = "${join(",", aws_subnet.external.*.availability_zone)}" + value = ["${aws_subnet.external.*.availability_zone}"] } From b8744f4c34a45565515ec1dc4c379beaf70ba509 Mon Sep 17 00:00:00 2001 From: Jeff Gonzalez Date: Tue, 9 Aug 2016 16:02:35 -0500 Subject: [PATCH 04/19] Update terraform version to 0.7.0 --- circle.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/circle.yml b/circle.yml index 04eab8e2..b412f501 100644 --- a/circle.yml +++ b/circle.yml @@ -1,7 +1,7 @@ dependencies: override: - - sudo curl -L# https://releases.hashicorp.com/terraform/0.6.16/terraform_0.6.16_linux_amd64.zip -o /usr/local/bin/tf.zip + - sudo curl -L# https://releases.hashicorp.com/terraform/0.7.0/terraform_0.7.0_linux_amd64.zip -o /usr/local/bin/tf.zip - cd /usr/local/bin && sudo unzip tf.zip test: From 36856c60a3ed3f2454c131e6b562237a09ed517c Mon Sep 17 00:00:00 2001 From: Calvin French-Owen Date: Wed, 14 Sep 2016 15:39:59 -0700 Subject: [PATCH 05/19] vpc: add rtb outputs This commit adds an output to the VPC that includes the routing table ids --- vpc/main.tf | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/vpc/main.tf b/vpc/main.tf index 12557126..4dc85c17 100644 --- a/vpc/main.tf +++ b/vpc/main.tf @@ -165,3 +165,13 @@ output "security_group" { output "availability_zones" { value = "${join(",", aws_subnet.external.*.availability_zone)}" } + +// The internal route table ID. +output "internal_rtb_id" { + value = "${aws_route_table.internal.id}" +} + +// The external route table ID. +output "external_rtb_id" { + value = "${aws_route_table.external.id}" +} \ No newline at end of file From bf0ea36c06b8accac2505dc0f85fbaf254a6d701 Mon Sep 17 00:00:00 2001 From: Calvin French-Owen Date: Wed, 14 Sep 2016 15:44:42 -0700 Subject: [PATCH 06/19] docs: updating --- docs.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs.md b/docs.md index 4398bb3d..88fd61e4 100644 --- a/docs.md +++ b/docs.md @@ -485,6 +485,8 @@ | internal_subnets | A comma-separated list of subnet IDs. | | security_group | The default VPC security group ID. | | availability_zones | The list of availability zones of the VPC. | +| internal_rtb_id | The internal route table ID. | +| external_rtb_id | The external route table ID. | # web-service From 27f87fc38e8ec76bd03a4ab5cff25d6a7d42ec95 Mon Sep 17 00:00:00 2001 From: Calvin French-Owen Date: Wed, 14 Sep 2016 15:51:44 -0700 Subject: [PATCH 07/19] adding all route tables --- vpc/main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vpc/main.tf b/vpc/main.tf index 4dc85c17..9bb5bce3 100644 --- a/vpc/main.tf +++ b/vpc/main.tf @@ -168,7 +168,7 @@ output "availability_zones" { // The internal route table ID. output "internal_rtb_id" { - value = "${aws_route_table.internal.id}" + value = "${join(",", aws_route_table.internal.*.id)}" } // The external route table ID. From c42113494a06f8a44e7950ae67b0f95531a76e77 Mon Sep 17 00:00:00 2001 From: Calvin French-Owen Date: Wed, 14 Sep 2016 16:45:50 -0700 Subject: [PATCH 08/19] vpc: split routes This commit preserves the same behavior around stack, but instead allows us to define route associations outside of the stack itself and still use the VPC module. It's due to a known ordering issue in Terraform https://www.terraform.io/docs/providers/aws/r/route.html --- vpc/main.tf | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/vpc/main.tf b/vpc/main.tf index 9bb5bce3..683614c8 100644 --- a/vpc/main.tf +++ b/vpc/main.tf @@ -97,30 +97,33 @@ resource "aws_subnet" "external" { resource "aws_route_table" "external" { vpc_id = "${aws_vpc.main.id}" - route { - cidr_block = "0.0.0.0/0" - gateway_id = "${aws_internet_gateway.main.id}" - } - tags { Name = "${var.name}-external-001" } } +resource "aws_route" "external" { + route_table_id = "${aws_route_table.external.id}" + destination_cidr_block = "0.0.0.0/0" + gateway_id = "${aws_internet_gateway.main.id}" +} + resource "aws_route_table" "internal" { count = "${length(compact(split(",", var.internal_subnets)))}" vpc_id = "${aws_vpc.main.id}" - route { - cidr_block = "0.0.0.0/0" - nat_gateway_id = "${element(aws_nat_gateway.main.*.id, count.index)}" - } - tags { Name = "${var.name}-${format("internal-%03d", count.index+1)}" } } +resource "aws_route" "internal" { + count = "${length(compact(split(",", var.internal_subnets)))}" + route_table_id = "${element(aws_route_table.internal.*.id, count.index)}" + destination_cidr_block = "0.0.0.0/0" + nat_gateway_id = "${element(aws_nat_gateway.main.*.id, count.index)}" +} + /** * Route associations */ From 6d343be99fcd83e38fdcda3ef19d4332a2100217 Mon Sep 17 00:00:00 2001 From: Rakesh Nair Date: Mon, 26 Sep 2016 16:47:05 -0700 Subject: [PATCH 09/19] use pip3 instead of pip in Makefile --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 80d3d819..e58e87f8 100644 --- a/Makefile +++ b/Makefile @@ -25,10 +25,10 @@ endif ifeq (${platform},Darwin) install-python-dependencies: - sudo -H pip install --upgrade ${pydeps} + sudo -H pip3 install --upgrade ${pydeps} else install-python-dependencies: - pip install --upgrade pyyaml boto3 + pip3 install --upgrade pyyaml boto3 endif install-tools: $(tools) From e59fc4ed97bfe0d31f31aa548df5d6942d94a873 Mon Sep 17 00:00:00 2001 From: dazl Date: Sat, 1 Oct 2016 15:00:58 -0700 Subject: [PATCH 10/19] expose route table ids to root stack module --- main.tf | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/main.tf b/main.tf index 38588911..4c794eef 100644 --- a/main.tf +++ b/main.tf @@ -292,3 +292,13 @@ output "vpc_id" { output "ecs_cluster_security_group_id" { value = "${module.ecs_cluster.security_group_id}" } + +// Comma separated list of internal route table IDs. +output "internal_route_tables" { + value = "${module.vpc.internal_rtb_id}" +} + +// The external route table ID. +output "external_route_table" { + value = "${module.vpc.external_rtb_id}" +} From 59a275d24703a2d8ae4d199b3e0ba8acdfddd0e9 Mon Sep 17 00:00:00 2001 From: dazl Date: Sun, 2 Oct 2016 18:10:48 -0700 Subject: [PATCH 11/19] updating docs with route tables outputs --- docs.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs.md b/docs.md index 88fd61e4..cea3753d 100644 --- a/docs.md +++ b/docs.md @@ -52,6 +52,8 @@ | external_elb | Security group for external ELBs. | | internal_subnets | Comma separated list of internal subnet IDs. | | external_subnets | Comma separated list of external subnet IDs. | +| internal_route_tables | Comma separated list of internal route table IDs. | +| external_route_table | The external route table ID. | | iam_role | ECS Service IAM role. | | log_bucket_id | S3 bucket ID for ELB logs. | | domain_name | The internal domain name, e.g "stack.local". | @@ -572,4 +574,3 @@ | desired_count | The desired count | `1` | no | | memory | The number of MiB of memory to reserve for the container | `512` | no | | cpu | The number of cpu units to reserve for the container | `512` | no | - From e602fc37aff7caf504703740a551b2f54ef68842 Mon Sep 17 00:00:00 2001 From: Filip Tepper Date: Tue, 4 Oct 2016 16:44:27 +0200 Subject: [PATCH 12/19] fixed description for external ELB security group --- security-groups/main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security-groups/main.tf b/security-groups/main.tf index 9bee46b8..a3b6a7eb 100644 --- a/security-groups/main.tf +++ b/security-groups/main.tf @@ -50,7 +50,7 @@ resource "aws_security_group" "internal_elb" { resource "aws_security_group" "external_elb" { name = "${format("%s-%s-external-elb", var.name, var.environment)}" vpc_id = "${var.vpc_id}" - description = "Allows internal ELB traffic" + description = "Allows external ELB traffic" ingress { from_port = 80 From 3d3ced93d6bbf748ceff86571c70b1c566d85914 Mon Sep 17 00:00:00 2001 From: dazl Date: Wed, 5 Oct 2016 12:59:00 -0700 Subject: [PATCH 13/19] use plural for consistency --- docs.md | 2 +- main.tf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs.md b/docs.md index cea3753d..db1ea782 100644 --- a/docs.md +++ b/docs.md @@ -53,7 +53,7 @@ | internal_subnets | Comma separated list of internal subnet IDs. | | external_subnets | Comma separated list of external subnet IDs. | | internal_route_tables | Comma separated list of internal route table IDs. | -| external_route_table | The external route table ID. | +| external_route_tables | The external route table ID. | | iam_role | ECS Service IAM role. | | log_bucket_id | S3 bucket ID for ELB logs. | | domain_name | The internal domain name, e.g "stack.local". | diff --git a/main.tf b/main.tf index 4c794eef..321ed91b 100644 --- a/main.tf +++ b/main.tf @@ -299,6 +299,6 @@ output "internal_route_tables" { } // The external route table ID. -output "external_route_table" { +output "external_route_tables" { value = "${module.vpc.external_rtb_id}" } From 60509daeff755ef0b317289b3abd74f73235c24c Mon Sep 17 00:00:00 2001 From: Amir Abushareb Date: Sun, 9 Oct 2016 12:50:22 -0700 Subject: [PATCH 14/19] ecs-cluster,s3-logs: use data sources --- ecs-cluster/main.tf | 2 +- s3-logs/main.tf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ecs-cluster/main.tf b/ecs-cluster/main.tf index 23176c3e..a5637d87 100644 --- a/ecs-cluster/main.tf +++ b/ecs-cluster/main.tf @@ -153,7 +153,7 @@ resource "aws_ecs_cluster" "main" { } } -resource "template_file" "cloud_config" { +data "template_file" "cloud_config" { template = "${file("${path.module}/files/cloud-config.yml.tpl")}" vars { diff --git a/s3-logs/main.tf b/s3-logs/main.tf index caf0da0b..c30f89b4 100644 --- a/s3-logs/main.tf +++ b/s3-logs/main.tf @@ -7,7 +7,7 @@ variable "environment" { variable "account_id" { } -resource "template_file" "policy" { +data "template_file" "policy" { template = "${file("${path.module}/policy.json")}" vars = { From ca1663a2194182f29b51bc1246cba5bb7f59cf70 Mon Sep 17 00:00:00 2001 From: Amir Abushareb Date: Sun, 9 Oct 2016 12:56:16 -0700 Subject: [PATCH 15/19] ecs-cluster,s3-logs: typo --- ecs-cluster/main.tf | 2 +- s3-logs/main.tf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ecs-cluster/main.tf b/ecs-cluster/main.tf index a5637d87..1f6747be 100644 --- a/ecs-cluster/main.tf +++ b/ecs-cluster/main.tf @@ -178,7 +178,7 @@ resource "aws_launch_configuration" "main" { iam_instance_profile = "${var.iam_instance_profile}" key_name = "${var.key_name}" security_groups = ["${aws_security_group.cluster.id}"] - user_data = "${template_file.cloud_config.rendered}" + user_data = "${data.template_file.cloud_config.rendered}" associate_public_ip_address = "${var.associate_public_ip_address}" # root diff --git a/s3-logs/main.tf b/s3-logs/main.tf index c30f89b4..24370bdc 100644 --- a/s3-logs/main.tf +++ b/s3-logs/main.tf @@ -24,7 +24,7 @@ resource "aws_s3_bucket" "logs" { Environment = "${var.environment}" } - policy = "${template_file.policy.rendered}" + policy = "${data.template_file.policy.rendered}" } output "id" { From 1c68f628449c427c70df80149190ad6bbe3bc1a6 Mon Sep 17 00:00:00 2001 From: Amir Abushareb Date: Sun, 9 Oct 2016 12:58:02 -0700 Subject: [PATCH 16/19] vpc: fix string -> list --- vpc/main.tf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vpc/main.tf b/vpc/main.tf index 35470eba..48cdf2de 100644 --- a/vpc/main.tf +++ b/vpc/main.tf @@ -121,7 +121,7 @@ resource "aws_route_table" "internal" { } resource "aws_route" "internal" { - count = "${length(compact(split(",", var.internal_subnets)))}" + count = "${length(compact(var.internal_subnets))}" route_table_id = "${element(aws_route_table.internal.*.id, count.index)}" destination_cidr_block = "0.0.0.0/0" nat_gateway_id = "${element(aws_nat_gateway.main.*.id, count.index)}" @@ -180,4 +180,4 @@ output "internal_rtb_id" { // The external route table ID. output "external_rtb_id" { value = "${aws_route_table.external.id}" -} \ No newline at end of file +} From 2bcbf458ae2c6c7b1e48dcf037dd9d67968e12ea Mon Sep 17 00:00:00 2001 From: Amir Abushareb Date: Sun, 9 Oct 2016 12:59:43 -0700 Subject: [PATCH 17/19] ecs-cluster: remove redundant lifecycle from template_file --- ecs-cluster/main.tf | 4 ---- 1 file changed, 4 deletions(-) diff --git a/ecs-cluster/main.tf b/ecs-cluster/main.tf index 1f6747be..b29f1a51 100644 --- a/ecs-cluster/main.tf +++ b/ecs-cluster/main.tf @@ -163,10 +163,6 @@ data "template_file" "cloud_config" { docker_auth_type = "${var.docker_auth_type}" docker_auth_data = "${var.docker_auth_data}" } - - lifecycle { - create_before_destroy = true - } } resource "aws_launch_configuration" "main" { From 3144449712750ebe976545cc7ab973058d98e818 Mon Sep 17 00:00:00 2001 From: Amir Abushareb Date: Sun, 9 Oct 2016 13:05:40 -0700 Subject: [PATCH 18/19] rds-cluster: use lists --- rds-cluster/main.tf | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/rds-cluster/main.tf b/rds-cluster/main.tf index b6cb253f..d7782d74 100644 --- a/rds-cluster/main.tf +++ b/rds-cluster/main.tf @@ -15,15 +15,18 @@ variable "zone_id" { } variable "security_groups" { - description = "A comma-separated list of security group IDs" + description = "A list of security group IDs" + type = "list" } variable "subnet_ids" { - description = "A comma-separated list of subnet IDs" + description = "A list of subnet IDs" + type = "list" } variable "availability_zones" { - description = "A comma-separated list of availability zones" + description = "A list of availability zones" + type = "list" } variable "database_name" { @@ -82,7 +85,7 @@ resource "aws_security_group" "main" { from_port = "${var.port}" to_port = "${var.port}" protocol = "TCP" - security_groups = ["${split(",", var.security_groups)}"] + security_groups = ["${var.security_groups}"] } egress { @@ -101,7 +104,7 @@ resource "aws_security_group" "main" { resource "aws_db_subnet_group" "main" { name = "${var.name}" description = "RDS cluster subnet group" - subnet_ids = ["${split(",", var.subnet_ids)}"] + subnet_ids = ["${var.subnet_ids}"] } resource "aws_rds_cluster_instance" "cluster_instances" { @@ -114,7 +117,7 @@ resource "aws_rds_cluster_instance" "cluster_instances" { resource "aws_rds_cluster" "main" { cluster_identifier = "${var.name}" - availability_zones = ["${split(",", var.availability_zones)}"] + availability_zones = ["${var.availability_zones}"] database_name = "${var.database_name}" master_username = "${var.master_username}" master_password = "${var.master_password}" From 392f44c267d719607195ce48d3752fa91d696c5b Mon Sep 17 00:00:00 2001 From: Amir Abushareb Date: Sun, 9 Oct 2016 13:10:23 -0700 Subject: [PATCH 19/19] circle: use terraform v0.7.5 --- circle.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/circle.yml b/circle.yml index b412f501..e0d3b56b 100644 --- a/circle.yml +++ b/circle.yml @@ -1,7 +1,7 @@ dependencies: override: - - sudo curl -L# https://releases.hashicorp.com/terraform/0.7.0/terraform_0.7.0_linux_amd64.zip -o /usr/local/bin/tf.zip + - sudo curl -L# https://releases.hashicorp.com/terraform/0.7.5/terraform_0.7.5_linux_amd64.zip -o /usr/local/bin/tf.zip - cd /usr/local/bin && sudo unzip tf.zip test: