You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 26, 2025. It is now read-only.
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.
The
AssertEC2InstancesBalancedInSubnetsin theawspackage 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.