Nike-Inc / hal

hal provides an AWS Lambda Custom Runtime environment for your Haskell applications.
BSD 3-Clause "New" or "Revised" License
240 stars 13 forks source link

Add support for EventBridge and ParameterStoreChange event mappings #107

Closed JackKelly-Bellroy closed 2 years ago

JackKelly-Bellroy commented 2 years ago

EventBridge is quite configurable, so it is possible to send a reduced payload or even completely rearrange the JSON that goes onto the event bus. But it's still useful to capture the entirety of an event in a Haskell type.

I'm not sure how many other event mappings I'll need to add from my work, but the scheme I'm establishing here is AWS.Lambda.Events.EventBridge.#{service}.#{event}, to let people add events as-needed.

Is there some point beyond which we should split hal from event mappings?

IamfromSpace commented 2 years ago

Is there some point beyond which we should split hal from event mappings?

It's a good Q; I'm honestly not sure. I think my primary concern with them long term is the lack of independent evolution could lead to noise in breaks--especially given AWS' example-only approach to schemas, which leave them feeling a bit fragile (or overly defensive and less helpful). I at least feel like we're nearing the threshold where we should change the strategy, but I'm not really able to quantify my take here.

JackKelly-Bellroy commented 2 years ago

Yeah, noise in breaks would be bad. There are several other benefits if we split them out:

IamfromSpace commented 2 years ago

Published in 0.4.10! Docs pending. Thanks for another solid addition :)

JackKelly-Bellroy commented 2 years ago

You're welcome. hal has been a great library for us, and I'm glad that I can give back.