fpco / terraform-aws-foundation

Establish a solid Foundation on AWS with these modules for Terraform
MIT License
204 stars 97 forks source link

removed availability_zones from asg #247

Closed JoseD92 closed 4 years ago

JoseD92 commented 5 years ago

This PR removes availability_zones from the asg module, as https://www.terraform.io/docs/providers/aws/r/autoscaling_group.html says availability_zones and vpc_zone_identifier should not be used together causing issue #242, it is also important to note that availability_zones is required to use EC2-Classic, so this update will make terraform-aws-foundation possibly not work on EC2-Classic

JoseD92 commented 4 years ago

running examples with master branch will result, when applying, in:

...
aws_security_group.sg: Creation complete after 5s [id=sg-044dff8dea12d391c]
module.asg.aws_launch_configuration.cluster: Creating...
module.asg.aws_launch_configuration.cluster: Creation complete after 3s [id=terraform-20191112203922703500000001]

Error: Provider produced inconsistent final plan

When expanding the plan for module.asg.aws_autoscaling_group.cluster to
include new values learned so far during apply, provider "aws" produced an
invalid new value for .availability_zones: was known, but now unknown.

This is a bug in the provider, which should be reported in the provider's own
issue tracker.

Using the change in this PR allows examples to apply correctly taking with the asg's taking the AZ of the subnets used in creating them.

Magicloud commented 4 years ago

Looks good to me. Did not know the PR is still open and I got the issue again.

qrilka commented 4 years ago

This broke the tests:

qrilka@qdesktop ~/ws/fpco/terraform-aws-foundation/tests $ make plan

Error: Unsupported argument

  on ../modules/consul-leaders/main.tf line 29, in module "leader-asg":
  29:   azs                = ["${var.region}a", "${var.region}c"]

An argument named "azs" is not expected here.

make: *** [Makefile:25: plan] Ошибка 1