fix(aws-sqs): precreate self-referential queue identity - #1356
Open
aryasaatvik wants to merge 3 commits into
Open
fix(aws-sqs): precreate self-referential queue identity#1356aryasaatvik wants to merge 3 commits into
aryasaatvik wants to merge 3 commits into
Conversation
Precreate the queue URL and ARN before resolving self-referential policies, and grant the bootstrap calls needed to discover that immutable identity. Original-Commits: 210799615 8ae19a190 Upstream-Candidate: SQS precreated identity
sam-goodwin
reviewed
Aug 25, 2026
| } | ||
| // Return undefined to allow update function to be called for other attribute changes | ||
| }), | ||
| precreate: Effect.fn(function* ({ id, news = {}, session }) { |
Contributor
There was a problem hiding this comment.
can we share any logic with create? Looks a bit redundant.
Contributor
Author
There was a problem hiding this comment.
I pulled the shared queue logic into helpers; precreate still only creates the shell. Pushed in 6c6d3f3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Pre-create the stable SQS queue identity before reconciliation so queue policies can safely reference the queue's own ARN during a greenfield deploy.
Lifecycle
The precreate phase creates or adopts only the physical shell, validates ownership and FIFO compatibility, and leaves mutable state to reconciliation. Existing foreign queues fail with a typed
QueuePrecreateConflict; recently deleted queues retain bounded retry behavior.Validation
ALCHEMY_TEST_DEV=1 mise exec bun@1.3.13 -- bun node_modules/alchemy-test/bin/alchemy-test.ts --sequential --test-name-pattern 'fresh create resolves a queue policy' test/AWS/SQS/Queue.test.ts0 failed | 1 passedALCHEMY_TEST_DEV=1 mise exec bun@1.3.13 -- bun node_modules/alchemy-test/bin/alchemy-test.ts --sequential --test-name-pattern '^(?!.*QueueSink)' test/AWS/SQS/Queue.test.ts0 failed | 15 passed15 passed | 1 failed; the excluded existingQueueSinktest has a virtual-entry resolution failure foralchemy/Runtime/Bootstrap/Lambdabefore the queue assertion runs. The same failure reproduces onorigin/main, outside this diff.Scope
This keeps queue identity creation separate from mutable reconciliation and does not change the existing queue attribute model.