fpco / terraform-aws-foundation

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

availability zones of asg module should be removed. #242

Open Magicloud opened 5 years ago

Magicloud commented 5 years ago

After upgrading to terraform 0.12, it happened to me that code using asg module cannot be applied sometimes, with "inconsistent plan" error. After trying the fix of following issue, it seemed working fine.

https://github.com/terraform-providers/terraform-provider-aws/issues/9622

Magicloud commented 5 years ago

@ketzacoatl Please review the reference issue and the purposal before I submit PR.

ketzacoatl commented 5 years ago

Yep, that LGTM. Maybe you can have @JoseD92 make the updates?

JoseD92 commented 5 years ago

@Magicloud I was able to reproduce the "inconsistent plan" error, and deleting the availability zones from the asg module does solve the issue, but as stated in the docs for aws_autoscaling_group, availability zones is Required only for EC2-Classic, the asg module would become useless if working with EC2-Classic, I am not sure if that is a use case for terraform-aws-foundation or not, but in the case it is, I think a better solution would be adding warnings in the readme of asg module and add assertions (preferably if the can run on both planning and applying) so that terraform exits with an error and an informative message if availability_zones and vpc_zone_identifier are used at the same time

ketzacoatl commented 5 years ago

Great review and comment @joseD92! I think it's ok for us to skip out on support for EC2 classic at this point. We should only see non-classic EC2 from now on.

JoseD92 commented 5 years ago

I add a MR with the fix