Skip to content

fix: scope API mapping cache entries to their domains - #2194

Open
Shubham-Padkonde wants to merge 1 commit into
aws:masterfrom
Shubham-Padkonde:fix/domain-mapping-cache
Open

Shubham-Padkonde wants to merge 1 commit into
aws:masterfrom
Shubham-Padkonde:fix/domain-mapping-cache

Conversation

@Shubham-Padkonde

Copy link
Copy Markdown

Issue #: Fixes #2134.

Description of changes:

The REST and WebSocket API mapping models both use api_mapping as their resource name. When their mount paths match, RemoteState reuses an existence result from the other domain because its cache key does not include the domain passed to resource_exists.

After an existing REST mapping is checked, a new WebSocket mapping can therefore appear to exist. Planning then fails while reading deployment values for the new domain with ValueError: Deployed values for resource does not exist: websocket_api_custom_domain. In the opposite order, an existing mapping can incorrectly appear to be missing.

Include the domain name in API-mapping cache keys. Repeated checks within the same domain stay cached, and other resource keys are unchanged. Adds a release note and three regression cases: both existence-result orders, with exact underlying calls and repeated cache hits, plus planning a new WebSocket domain after an existing REST domain using real RemoteState and mocked AWS responses. All three fail on unmodified master; the planner test reproduces the reported exception exactly. All 111 planner tests pass after the fix.

Validation: 1,400 tests passed and 27 skipped on Linux/Python 3.11.15 with pinned development requirements. Full make prcheck passed, including linting, documentation link checking and HTML build, and mypy (63 source files).

No live AWS deployment or other Python/OS matrix was run. Implementation and validation were assisted by OpenAI Codex; no independent human review is claimed.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@Shubham-Padkonde
Shubham-Padkonde requested a review from a team as a code owner September 21, 2026 07:45

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ValueError: Resource does not exist: websocket_api_custom_domain - For an already existing api

1 participant