Closed ghost closed 4 years ago
Yes, I've hit this issue before as well. I think AWS recently added some availability zones to existing AWS accounts without adding default subnets for them. Not sure I can get this into the book before it goes to production, but it's a good idea to have the bug filed in this repo.
It may be worth filing a bug (or rather, feature request) with the Terraform folks so that there is a way to select availability zones that have default subnets.
This sounds like a Terraform issue and is 3 years old now, so closing.
I've come across this problem, and a google seems to suggest others are too. While something like the following is supposed to get your availability_zones, and use them, it can bail out if it finds a zone without a default subnet:
I think your book uses 'all' instead? - Neither work.
This was because my account (maybe others, unsure with AWS) had access to us-east-1b, but that particular dc didn't have a default subnet.
I got around this problem using a hardcoded list:
I don't know if this is the best way to go around the problem (not if you don't like hard-coding things, and who does?) but it was the best I could see initially.
I don't know if it may be worth a note to this effect in the release version of the book?