Lambda client wrapper that knows how to forward correlation IDs (captured via @dazn/lambda-powertools-correlation-ids)
npm install @dazn/lambda-powertools-lambda-clientLambda client wrapper that knows how to forward correlation IDs (captured via @dazn/lambda-powertools-correlation-ids).
Main features:
* auto-injects correlation IDs into the invocation payload when you call invoke or invokeAsync
* direct replacement for AWS.Lambda client
Install from NPM: npm install @dazn/lambda-powertools-lambda-client
It's exactly the same as the Lambda client from the AWS SDK.
``js
const Lambda = require('@dazn/lambda-powertools-lambda-client')
const invoke = async () => {
const invokeReq = {
FunctionName: 'my-function',
InvocationType: 'Event',
Payload: JSON.stringify({ message: 'hello lambda' })
}
await Lambda.invoke(invokeReq).promise()
const invokeAsyncReq = {
FunctionName: 'my-function',
InvokeArgs: JSON.stringify({ message: 'hello lambda' })
}
await Lambda.invokeAsync(invokeAsyncReq).promise()
}
``