1.28.1 • Published 3 years ago

@dazn/lambda-powertools-cloudwatchevents-client v1.28.1

Weekly downloads
187
License
MIT
Repository
github
Last release
3 years ago

lambda-powertools-cloudwatchevents-client

CloudWatchEvents client wrapper that knows how to forward correlation IDs (captured via @dazn/lambda-powertools-correlation-ids).

Main features:

  • auto-injects correlation IDs into the CloudWatchEvents events when you call putEvents

  • direct replacement for AWS.CloudWatchEvents client

Getting Started

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

API

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

const CloudWatchEvents = require('@dazn/lambda-powertools-cloudwatchevents-client')

const publishEvents = async () => {
  const putEventsReq = {
    Entries: [
      {
        Source: "my-source",
        "Detail-Type": "my-type",
        Detail: JSON.stringify({ message: 'hello cloudwatchevents' })
      },
      {
        Source: "my-source",
        "Detail-Type": "my-type",
        Detail: JSON.stringify({ message: 'hello lambda-powertools' })
      }
    ]
  }

  await CloudWatchEvents.putEvents(putEventsReq).promise()
}
1.28.1

3 years ago

1.28.0

3 years ago

1.26.0

4 years ago

1.24.1

4 years ago

1.24.0

4 years ago

1.23.2

4 years ago

1.23.1

4 years ago

1.23.0

4 years ago

1.22.1

4 years ago

1.22.0

4 years ago

1.21.1

4 years ago

1.21.0

4 years ago

1.18.0

4 years ago