@dazn/lambda-powertools-lambda-client
TypeScript icon, indicating that this package has built-in type declarations

1.28.1 • Public • Published

lambda-powertools-lambda-client

Lambda 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

Getting Started

Install from NPM: npm install @dazn/lambda-powertools-lambda-client

API

It's exactly the same as the Lambda client from the AWS SDK.

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()
}

Readme

Keywords

none

Package Sidebar

Install

npm i @dazn/lambda-powertools-lambda-client

Weekly Downloads

460

Version

1.28.1

License

MIT

Unpacked Size

17.9 kB

Total Files

7

Last publish

Collaborators

  • gideonparanoid
  • davidrv87
  • gabriela_nowicka
  • dazn.builder.frontend
  • automation-drone
  • m.bazalik
  • dazn.oss.lambda.powertools