Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Dynamodb stream events #111

Merged
merged 2 commits into from
Mar 16, 2018
Merged

Fix Dynamodb stream events #111

merged 2 commits into from
Mar 16, 2018

Conversation

HyperBrain
Copy link
Member

@HyperBrain HyperBrain commented Mar 16, 2018

Closes #85

The problem of the bug is, that stream references are implemented as relation from the alias stack to the base stack, but using Fn::Import. As that works for most cases, it breaks with DynamoDB streams, because their ARNs change between deploys. When CF tries to update the output variable that is referenced, it bails out, because all outputs that are referenced by Fn::ImportValue are made read-only and their values must not change anymore.

I implemented a solution in a way, that instead of the read-only reference, now the plain arn is fetched via the API from the base stack and added to the alias stack. Now it will succeed, even if the ARN changes.
This change does not mean any descrease in reliability or protection of the resources, because that is already guaranteed by the ImportValues that are used to reference the resources themselves.
As the reference resolution is deferred now, I also had to move the sequence of uploading the CF alias template behind the upload of the base stack. This has no effects on the plugin or its execution.

Frank Schmid added 2 commits March 16, 2018 16:57
Resolve deferred outputs before uploading the template

Modified logging to show resolutions

Use non-locking deferred outputs for event references.
@HyperBrain
Copy link
Member Author

I will do a unit test cleanup in a separate PR. There are lots of tests missing (e.g. stackInformation, etc.)

@HyperBrain HyperBrain merged commit 4517330 into master Mar 16, 2018
@HyperBrain HyperBrain deleted the dynamodb-stream-events branch March 16, 2018 16:01
defnotrobbie pushed a commit to 1stdibs/serverless-aws-alias that referenced this pull request Nov 14, 2022
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.

1 participant