Skip to content
This repository was archived by the owner on Sep 26, 2025. It is now read-only.
This repository was archived by the owner on Sep 26, 2025. It is now read-only.

AssertEC2InstancesBalancedInSubnets not giving valid results #17

@yardbirdsax

Description

@yardbirdsax

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions