Skip to content

Limit security group filter search to security groups in same subnet you are creating a machine in #137

@AaronJaegerVA

Description

@AaronJaegerVA

When defining a MachineSet with the AWSProvider, using tag:Name filters behaves poorly, as the query returns all security groups with a matching tag:Name value, even when they are not in the AWS VPC the subnet you specify in the MachineSet belongs to.

If you have >5 VPCs, and each has a security group with the same tag:Name value, the query returns >5 security group IDs. This results in a Machine provisioning failure with error launching instance: You have exceeded the maximum number of security groups allowed per network interface. The default for this quota is 5.

Can the filter query be limited to returning only SGs that are in the VPC the subnet you specify belongs to? It is not possible to assign SGs associated with one VPC to a machine created in another VPC.

In this example, sg-2 may return many results, even though subnet-abc123 is associated with a specific VPC which can only have one sg-2.

          securityGroups:
            - filters:
                - name: 'tag:Name'
                  values:
                    - sg-1
                    - sg-2
          ...
          subnet:
            id: subnet-abc123

Using the security group ID works okay, but security id's are hard for humans to recognize.

          securityGroups:
            - filters:
                - name: 'tag:Name'
                  values:
                    - sg-1
            -id : sg-abc123
          ...
          subnet:
            id: subnet-abc123

Metadata

Metadata

Assignees

No one assigned

    Labels

    lifecycle/rottenDenotes an issue or PR that has aged beyond stale and will be auto-closed.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions