Adds support for lambda subscriptions to SQS, including SQS subscribed to SNS.
HOW
I've added a new module for SQS events.
Moved MessageAttribute into its own module to be shared between SNS and SQS events.
Modified the FromJSON instance for SNSMessage (see below) which is now hand rolled.
Added test for the inception style message of an S3 event, inside of an SNS event, inside of a SQS event. There was some brain hurt involved in that one!
SNS message format
When a lambda is triggered directly off of an SNS topic, the SNS message contains message attributes.
When a lambda is triggered off of an SQS queue which is subscribed to an SNS topic, the SNS message changes in two ways:
The casing of Url changes to URL for SigningCertUrl and UnsubscribeUrl
MessageAttributes is not present. I think this is because they move to the SQS message, but not sure of the reasoning.
WHAT
Adds support for lambda subscriptions to SQS, including SQS subscribed to SNS.
HOW
MessageAttribute
into its own module to be shared between SNS and SQS events.FromJSON
instance forSNSMessage
(see below) which is now hand rolled.SNS message format
When a lambda is triggered directly off of an SNS topic, the SNS message contains message attributes. When a lambda is triggered off of an SQS queue which is subscribed to an SNS topic, the SNS message changes in two ways:
Url
changes toURL
forSigningCertUrl
andUnsubscribeUrl
MessageAttributes
is not present. I think this is because they move to the SQS message, but not sure of the reasoning.This PR will replace https://github.com/seek-oss/serverless-haskell/pull/120