-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
Add support for Kinesis Data Streams Enhanced Fan-out (Consumers) #7320
Conversation
More discussion in issue serverless#5510
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great thanks @zaccharles It looks really good.
I've proposed few improvements, let me know what you think
@medikoo Hi, thanks for the review. I've made some more changes. Specifically, I've relied more on CloudFormation validating things, which is probably a good approach. This has allowed me to simplify things a bit. I'm happy to accept more feedback. |
Codecov Report
@@ Coverage Diff @@
## master #7320 +/- ##
=======================================
Coverage 87.91% 87.91%
=======================================
Files 240 240
Lines 8888 8888
=======================================
Hits 7814 7814
Misses 1074 1074
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @zaccharles looks really good now, just added one extra suggestion.
It's quite a lot simpler now without any of the validation 😄 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, thank you @zaccharles !
@zaccharles Is it possible to use the function name defined with name in serverless under function. functions:
preprocess:
name: preprocess-test
handler: handler.preprocess
events:
- stream:
arn: arn:aws:kinesis:region:XXXXXX:stream/foo
consumer: true The Kinesis consumer is created with I my use case I need to deploy multiple functions with stages name so I am adding stage name in functions names using name |
What did you implement
Closes #5510
I added the a new configuration property for Kinesis data stream events which configures the event source mapping to use a stream consumer instead of shard iterator.
It creates a new stream consumer when set to
true
and uses an existing consumer if given the ARN of one.It manages the necessary IAM permissions and supports functions such as
Ref
andImportValue
(essential since stream consumer ARNs are AWS generated with timestamps in them).This is my first PR of this size to this project, so apologies if I didn't quite get some conventions right.
How can we verify it
Todos
No todos at the moment.
Is this ready for review?: YES
Is it a breaking change?: NO