Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AssertEC2InstancesBalancedInSubnets not giving valid results #17

Open
yardbirdsax opened this issue Dec 2, 2021 · 0 comments
Open

AssertEC2InstancesBalancedInSubnets not giving valid results #17

yardbirdsax opened this issue Dec 2, 2021 · 0 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@yardbirdsax
Copy link
Member

The AssertEC2InstancesBalancedInSubnets in the aws package was built with the assumption that (quoted from the method docs): "instance number 'x' in the [list of instances provided] should be placed in the subnet with an index of 'x modulus the length of the [subnet list provided]'". As it turns out, depending on a number of factors such as the subnet or instance IDs assigned to resources, launch time of instances, etc, this is likely not a valid assumption of consistent behavior from Terraform or other infrastructure providers.

The method needs to be rewritten to use a more algorithmic approach to ensuring that instances in a given list are appropriately spread between the unique list of subnets of all instances in the list, such that no one subnet has more than math.floor(# of instances / # of subnets) instances placed in it.

@yardbirdsax yardbirdsax added bug Something isn't working help wanted Extra attention is needed labels Dec 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant