typelevel / feral

Feral cats are homeless, feral functions are serverless
Apache License 2.0
167 stars 41 forks source link

Create models for the myriad of AWS Lambda event types #48

Open armanbilge opened 2 years ago

armanbilge commented 2 years ago

For feral-lambda to be useful for the "zoo" of Lambda types available on AWS, we need to provide models for the various events (aka "triggers") and responses used by each of these lambdas. These will live in the feral-lambda-events module.

We are currently sourcing them from the Java and JavaScript/TypeScript implementations.

The TypeScript definitions are especially important, because they are the definitive representation of these events as "plain old JavaScript objects" which is isomorphic to their JSON representation. Therefore, our models should match them exactly in name, structure, etc. in order for parsing to work correctly.

For an example of this, see the existing events: https://github.com/typelevel/feral/blob/main/lambda/shared/src/main/scala/feral/lambda/events/

fredshonorio commented 2 years ago

@armanbilge we talked on discord, for the purposes of project management I'll be looking at the SQS event first.

armanbilge commented 2 years ago

@bpholt I've again arrived at the opinion that the CloudFormationCustomResourceEvent should probably join the rest of the events in this module 😅 these are my assumptions:

  1. Not every event requires its own special lambda (like we have for http4s or CloudFormation). So this justifies the existence of the feral-lambda-events module, to host these events.
  2. For consistency/least surprise, if some events are in feral-lambda-events, they should all be there :)

I could be wrong about (1). When we figure out how to deploy these things, maybe each type of Lambda will have to be treated differently anyway? I hope not.