Add support for Kinesis Data Streams Enhanced Fan-out (Consumers)#7320
Conversation
More discussion in issue serverless#5510
medikoo
left a comment
There was a problem hiding this comment.
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.
|
medikoo
left a comment
There was a problem hiding this comment.
Thanks @zaccharles looks really good now, just added one extra suggestion.
|
It's quite a lot simpler now without any of the validation 😄 |
medikoo
left a comment
There was a problem hiding this comment.
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: trueThe 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
trueand uses an existing consumer if given the ARN of one.It manages the necessary IAM permissions and supports functions such as
RefandImportValue(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