Build private & public subnet in every AZ #590
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue #, if available:
Description of changes:
Updates the infrastructure stack to include a private and public subnet in every availability zone in the region. Various capacity constraints make selecting two random availability zones, like we were doing before, too restrictive. For example, if a instance type is only offered in 2 out of 5 availability zones in a region, then those are also currently our odds of even including a subnet in the necessary AZ to try to launch the capacity.
There's enough different scenarios to consider that we shouldn't try to pre-process like we were doing before with capacity reservations, to try to ensure that the particular AZ we need is included. That strategy also opens up weird failure modes. Since the infrastructure stack is created before cluster creation (which can take several minutes), a terminating instance in an ASG would not be counted for the subnet selection, but then we might try to target it if it is available by the time we start creating nodegroups.
Unfortunately cloudformation currently has no native support for loops so I made this a go template, which we're already using for all other stacks at this point.
At this point, I've only tested directly creating the stack to confirm that all resources are valid and unique where needed. I'll do some runs of a couple e2e scenarios before merging.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.