From e1e21fb60640d130308aacaa30406c39f4afca4b Mon Sep 17 00:00:00 2001 From: Jose Duran Date: Tue, 19 Nov 2019 07:11:56 -0500 Subject: [PATCH] removed availability_zones from asg (#247) `azs` attribute is for legacy EC2 ASG, which we do not have plan to support any more. Now with terraform 0.12, it causes inconsistent plan issue. So it has to go. --- examples/asg-lifecycle-hooks/main.tf | 1 - examples/load-asg/main.tf | 1 - examples/vpc-scenario-2-nat-instance/main.tf | 1 - examples/vpc-scenario-2-nat-instances-per-az/main.tf | 1 - examples/vpc-scenario-2/main.tf | 1 - examples/vpc-scenario-3/main.tf | 1 - modules/asg/main.tf | 1 - modules/asg/variables.tf | 5 ----- tests/main.tf | 1 - 9 files changed, 13 deletions(-) diff --git a/examples/asg-lifecycle-hooks/main.tf b/examples/asg-lifecycle-hooks/main.tf index 71504c93..1a8f1737 100644 --- a/examples/asg-lifecycle-hooks/main.tf +++ b/examples/asg-lifecycle-hooks/main.tf @@ -147,7 +147,6 @@ resource "aws_sns_topic" "main" { module "asg" { source = "../../modules/asg" name_prefix = var.name_prefix - azs = local.azs elb_names = [aws_elb.web.name] subnet_ids = module.vpc.public_subnet_ids min_nodes = 1 diff --git a/examples/load-asg/main.tf b/examples/load-asg/main.tf index 5d4ae394..ce3f762f 100644 --- a/examples/load-asg/main.tf +++ b/examples/load-asg/main.tf @@ -118,7 +118,6 @@ module "ubuntu-xenial-ami" { module "web-asg" { source = "../../modules/asg" ami = module.ubuntu-xenial-ami.id - azs = local.azs name_prefix = "${var.name}-${var.web_app_name}" elb_names = [aws_elb.web.name] instance_type = var.instance_type diff --git a/examples/vpc-scenario-2-nat-instance/main.tf b/examples/vpc-scenario-2-nat-instance/main.tf index c185bed2..5af733a4 100644 --- a/examples/vpc-scenario-2-nat-instance/main.tf +++ b/examples/vpc-scenario-2-nat-instance/main.tf @@ -233,7 +233,6 @@ resource "aws_elb" "web" { module "web" { source = "../../modules/asg" ami = module.ubuntu-xenial-ami.id - azs = slice(data.aws_availability_zones.available.names, 0, 3) name_prefix = var.name name_suffix = "webapp-server" elb_names = [aws_elb.web.name] diff --git a/examples/vpc-scenario-2-nat-instances-per-az/main.tf b/examples/vpc-scenario-2-nat-instances-per-az/main.tf index 905bf8a3..3e24e7e0 100644 --- a/examples/vpc-scenario-2-nat-instances-per-az/main.tf +++ b/examples/vpc-scenario-2-nat-instances-per-az/main.tf @@ -244,7 +244,6 @@ resource "aws_elb" "web" { module "web" { source = "../../modules/asg" ami = module.ubuntu-xenial-ami.id - azs = slice(data.aws_availability_zones.available.names, 0, 3) name_prefix = var.name name_suffix = "webapp-server" elb_names = [aws_elb.web.name] diff --git a/examples/vpc-scenario-2/main.tf b/examples/vpc-scenario-2/main.tf index 4b8fddc1..1e9e4659 100644 --- a/examples/vpc-scenario-2/main.tf +++ b/examples/vpc-scenario-2/main.tf @@ -166,7 +166,6 @@ resource "aws_elb" "web" { module "web" { source = "../../modules/asg" ami = module.ubuntu-xenial-ami.id - azs = local.azs name_prefix = "${var.name}-web" elb_names = [aws_elb.web.name] instance_type = "t2.nano" diff --git a/examples/vpc-scenario-3/main.tf b/examples/vpc-scenario-3/main.tf index c7ab9bb6..5a48995b 100644 --- a/examples/vpc-scenario-3/main.tf +++ b/examples/vpc-scenario-3/main.tf @@ -139,7 +139,6 @@ resource "aws_elb" "web" { module "web" { source = "../../modules/asg" ami = module.ubuntu-xenial-ami.id - azs = local.azs name_prefix = "${var.name}-web" elb_names = [aws_elb.web.name] instance_type = "t2.nano" diff --git a/modules/asg/main.tf b/modules/asg/main.tf index 3958ddc6..672fae17 100644 --- a/modules/asg/main.tf +++ b/modules/asg/main.tf @@ -24,7 +24,6 @@ */ # Auto-Scaling Group resource "aws_autoscaling_group" "cluster" { - availability_zones = var.azs force_delete = true health_check_grace_period = 300 health_check_type = var.health_check_type diff --git a/modules/asg/variables.tf b/modules/asg/variables.tf index c9eac2c8..77cf855d 100644 --- a/modules/asg/variables.tf +++ b/modules/asg/variables.tf @@ -59,11 +59,6 @@ variable "public_ip" { type = string } -variable "azs" { - description = "list of availability zones to associate with the ASG" - type = list(string) -} - variable "subnet_ids" { description = "list of subnets to associate with the ASG (by id)" type = list(string) diff --git a/tests/main.tf b/tests/main.tf index b6182a5b..bd253650 100644 --- a/tests/main.tf +++ b/tests/main.tf @@ -6,7 +6,6 @@ module "asg" { source = "../modules/asg" ami = "" - azs = [] key_name = "" max_nodes = "" min_nodes = ""