Skip to content

fix(ssm): InvalidResourceId is a 400, not a 404 #933

Closed

Description

@scttfrdmn

Summary

SSM answers InvalidResourceId with HTTP 404. AWS publishes 400. Split out of #932 on the
reasoning #921 (ACM), #923 (KMS) and #930 (Secrets Manager) established: correcting which resource
an identifier names is a different change from correcting what status a refusal carries, and a wire
status is a compatibility surface a consumer may already assert.

Verified

From
API_AddTagsToResource
(and identically at API_RemoveTagsFromResource and API_ListTagsForResource):

Code HTTP Status Code
InternalServerError 500
InvalidResourceId 400
InvalidResourceType 400
TooManyTagsError 400
TooManyUpdates 400

SSM publishes no distinct not-found code for these three operations — InvalidResourceId is
how a nonexistent resource is reported, and it is a 400.

Where

After #932 the status lives in one place: the ssmInvalidResourceID helper in
emulator/ssm_tags.go, which all three tag operations route through. Before #932 it was written
inline at emulator/ssm_plugin.go:660, :702 and :741.

The rest of the SSM plugin is not in scope here and is not audited by this issue; other operations
(GetParameter's ParameterNotFound, PutParameter's ParameterAlreadyExists) carry their own
codes and their own statuses, which AWS publishes separately.

Acceptance criteria

  • ssmInvalidResourceID answers http.StatusBadRequest.
  • A test asserts 400 on the wire — not through a decoded struct — for each of
    AddTagsToResource, RemoveTagsFromResource and ListTagsForResource against a parameter that
    does not exist.
  • The doc comment on the helper stops citing this issue as pending.
  • CHANGELOG.md records it under ### Fixed, and docs/services.md's SSM row states the status
    alongside the code, since a caller's retry logic branches on it.
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

    type: bug

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions