Skip to content

EC2: RunInstances and other tag-on-create paths accept reserved aws: tag keys #468

Closed

Description

@scttfrdmn

Follow-up from #452, which restricted the reserved aws: prefix on CreateTags/DeleteTags only.

The gap

Real EC2 rejects a reserved key on RunInstances tag-on-create as well — in fact both captures #452 rests on are from RunInstances, not CreateTags:

Service: AmazonEC2; Status Code: 400; Error Code: InvalidParameterValue
Tag keys starting with 'aws:' are reserved for internal use

Substrate accepts it there. runInstances parses TagSpecification.N in its own loop (emulator/ec2_plugin.go) and does not route through createTags, so #452's check never runs on that path. Same for any other tag-on-create surface that parses TagSpecification.N independently.

Why #452 deliberately left it

launchFleetPool (emulator/ec2_fleet.go) stamps aws:ec2:fleet-id (#443) by building a synthetic RunInstances param map via fleetIDTagSpec and calling p.runInstances directly. Restricting the request-level parse would reject substrate's own fleet tagging, silently undoing the only route from an instant fleet back to its instances. #452 has a regression test pinning that a fleet still stamps and still filters on the tag.

What closing this needs

The fleet path restructured so it does not ride the request-level TagSpecification.N parse — e.g. stamping the tag after the instances exist, or a separate internal entry point that takes already-parsed tags.

Not a bypass flag. An internal "skip the validation" switch on the request would make the emulator's behaviour depend on state a consumer cannot see or set, which is the opposite of what the deterministic-replay property is for.

Acceptance criteria

  • RunInstances with TagSpecification.N.Tag.M.Key=aws:foo returns InvalidParameterValue, HTTP 400, Tag keys starting with 'aws:' are reserved for internal use
  • No instance is launched when the request is rejected
  • A fleet still stamps aws:ec2:fleet-id, and DescribeInstances filtered on tag:aws:ec2:fleet-id still returns its instances
  • The same check covers the other TagSpecification.N parsers, or the ones left out are named with a reason
  • docs/services.md updated; the provenance stays stated as observed real-AWS behaviour rather than a doc citation
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: taggingfidelitytype: bug

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions