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

AWS streams: Introduce dynamodb and kinesis events, deprecate stream #8137

Open
medikoo opened this issue Aug 26, 2020 · 0 comments
Open

AWS streams: Introduce dynamodb and kinesis events, deprecate stream #8137

medikoo opened this issue Aug 26, 2020 · 0 comments
Labels
breaking A breaking change bug/design Functionality design flaw cat/aws-event-stream deprecation Deprecation proposal (breaking with next major) enhancement needs feedback

Comments

@medikoo
Copy link
Contributor

medikoo commented Aug 26, 2020

Initially discussed here: #8117 (comment)

Use case description

To avoid ambiguity it'll be nice to handle both stream types with two distinct event types.

Benefits of that change:

  • Event source type is clear upfront at event defitnition
  • Internally we do not have to resolve event source type from ARN (and possiblities of that are limited)
  • Allows to improve property naming (e.g. batchWindow and maximumRecordAgeInSeconds doesn't seem to follow same convention)
  • Allows to address inconsistencies and bugs as:

Proposed solution

  1. Deprecate currently implementedstream event
  2. Introduce kinesis and dynamodb events, but configure them with same AWS::Lambda::EventSourceMapping resource generator.
    As we need to leave stream event working as is, I believe this should be introduced as new implementation.
    List of properties to be supported by those events (note new naming in some cases):
  • batchSize: optional, maps to BatchSize
  • bisectBatchOnFunctionError: optional, maps to BisectBatchOnFunctionError
  • onFailureDestination: optional, maps to DestinationConfig.OnFailure
  • arn: required, maps to EventSourceArn
  • maximumBatchingWindow: optional, maps to MaximumBatchingWindowInSeconds
  • maximumRecordAge: optional, maps to MaximumRecordAgeInSeconds
  • maximumRetryAttempts: optional, maps to MaximumRetryAttempts
  • parallelizationFactor: optional, maps to ParallelizationFactor
  • startingPosition: optional (but required in AWS), maps to StartingPosition and we should map to TRIM_HORIZON as default (as in case of stream event)
  1. New events should be backed by new tests, configured with runServerless util (follow: https://github.com/serverless/serverless/tree/master/tests#unit-tests). Integration tests should be also introduced (we may reuse those already configured for those events, but it'll also be good to keep testng stream event)
  2. Documentation should be updated to document dynamodb and kinesis as separate events (it's fine to remove documentation for stream event)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking A breaking change bug/design Functionality design flaw cat/aws-event-stream deprecation Deprecation proposal (breaking with next major) enhancement needs feedback
Projects
None yet
Development

No branches or pull requests

1 participant