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

1.28.1 • Public • Published

lambda-powertools-cloudwatchevents-client

CloudWatchEvents client wrapper that knows how to forward correlation IDs (captured via @michaelfecher/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 @michaelfecher/lambda-powertools-cloudwatchevents-client

API

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

const CloudWatchEvents = require('@michaelfecher/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()
}

Readme

Keywords

none

Package Sidebar

Install

npm i @michaelfecher/lambda-powertools-cloudwatchevents-client

Weekly Downloads

2

Version

1.28.1

License

MIT

Unpacked Size

11.4 kB

Total Files

7

Last publish

Collaborators

  • michaelfecher