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
Register multiple DynamoDB streams #2243
Comments
Hey @Malivuk we've just started to work on the It also supports multiple streams for one function (e.g. for two different tables). Would be great if you could try it out and report back if it works for you. |
Hi @pmuens, thanks for your support. I updated my local environment with your pull request but I have an issue while scanning tables. AWS returns {lambda} is not authorized to perform: dynamodb:Scan on resource {db stream}. I manually added Any idea what I could be doing wrong? |
Hmm. That's interesting. I used the permission definitions from this table: http://docs.aws.amazon.com/lambda/latest/dg/lambda-api-permissions-ref.html Not sure about the |
Hi, I guess the problem is coming from my settings anyways. I ended up redeploying the service using the following
It seems to override the default policy, which finally looks like:
It's kind of ugly and I know I'm probably missing something out. But well, it's working (demo). Each view is calling |
Awesome @Malivuk 💃 Great to hear that it's working now. Yes, you can always overwrite specific configuration that way. So it's completely fine how you've done it 👍 Let me know if you need anything else. |
This is resolved 🎉 |
@Malivuk We're trying to setup Lambda to listen on a dynamodb stream using the wildcard syntax similar to what you are using above. Trying it this way because the stream is actually setup by an independent DynamoDB deployment and I'm trying to avoid hardcoding the stream label. However, when I include a wildcard in the ARN it doesn't seem to work. Just wondering if you ran into similar issues. (x'd out our acct id) Serverless: Deployment failed! from serverless.yml
from cloudformation-template-update-stack.json
Thanks for any input! |
Hi @mdgbayly if you refer to the |
@Malivuk That's no way to get streamId dynamically? I have multiple stages, then I need to hardcode all streamIds... |
@marckaraujo you might try another approach then, making full use of Serverless Variables. You can declare some variables inside your
Then, later in your file:
I don't know if that helps but it sure provides more flexibility. |
Thanks for jumping in @Malivuk 👍 Yes, Serverless Variables would be the go-to solution here! A very feature rich real-world application which uses them heavily is hello-retail by Nordstrom. Here you could e.g. see their This file is then used in other places to reference the streams: |
@Malivuk and @pmuens , I just found an easier solution:
With this you dont need streamId 👍 |
Great. Even better @marckaraujo 👍 Thanks for sharing! |
Hello,
I did manage to add a DynamoDB stream (one single table) as a resource, following serverless and aws docs, however, what would be the correct syntax to implement two or more tables?
Thanks
The text was updated successfully, but these errors were encountered: