NPM module - izara-middleware
Overview
Code that is shared by all services, including middleware code that executes at the beginning and end of each Lambda function and supporting code.
Middleware
The middleware that executes at the beginning and end of Lambda functions uses the Middy middleware module.
Middleware components
The below middleware components are executed in the below order:
captureCorrelationIds
..
integrationTests
Checks correlation ids for intTest-tag
which should only exist if the request was initiated by the Integration Testing service.
If is part of an integration test then send a message to MsgOut queue with the event object.
sampleLogging
...
stopInfiniteLoop
...
logTimeout
...
httpHeaderNormalizer
...
jsonParseBody
...
urlEncodeBodyParser
...
validator
...
flattenRequest
...
Middleware: Debug Message
All services will have an SNS queue deployed named MsgOut, this middleware adds a message to this queue when the middleware's LOG_LEVEL is set to DEBUG at the start of the request with the functions received request properties and at the end of the function with the final response formatted in a standard way for Integration Testing to process.
Service requests
The middleware module includes wrapped objects that manage requests sent to other AWS services, this allows the middleware to add or adjust the request in a standard way, passing on values across the lifetime of a multi-resource action.
Services
The following services are supported:
DynamoDB
..
Firehose
..
Http (API Gateway)
..
Kinesis
..
Lambda
..
SNS
..
SQS
..
Step Functions
..