Skip to content

ec2: DescribeSubnets renders no tagSet and applies no filters at all #685

Closed

Description

@scttfrdmn

Split out of #670, which fixed the same shape on volumes. describeSubnets (emulator/ec2_plugin.go:1435-1483) renders no tagSet and applies no filters at all — not even vpc-id — despite subnets being fully taggable: ec2TaggableStateKey already routes subnet- IDs, EC2Subnet.Tags persists, and CreateSubnet accepts a TagSpecification. So a tag written through CreateTags is stored and then invisible, and a caller cannot narrow the list.

This is the store-and-hide shape #670 describes, on a resource CDK and Terraform tag constantly and then look up by tag. It is more visible than #670 was, because a subnet list is unfiltered rather than merely un-taggable.

Acceptance criteria

  • DescribeSubnets renders tagSet for each subnet, using the package-level ec2TagItem rather than a new local copy, with no omitempty on the wrapper.
  • DescribeSubnets applies filters through extractEC2Filters plus a match function, following what ec2: a volume cannot be tagged at creation and cannot report or be filtered by its tags #670 established for describeVolumes — not a hand-rolled switch.
  • The filter set is what AWS documents for DescribeSubnets, verified against the API reference, and includes tag:<key> and tag-key.
  • A test writes a tag with CreateTags, reads it back through DescribeSubnets, and finds the subnet by tag: and by tag-key.
  • docs/services.md records the filter list.

describeSnapshots is the milder version of the same thing and can be folded in or split, whichever keeps the diff readable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: ec2area: taggingtype: bug

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions