serverless-offline-msk
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

serverless-offline-msk

A serverless offline plugin that enables AWS MSK events.

serverless npm version License: MIT

Note

Something not working? Open an issue. Pull requests welcome.

Getting Started

Example

See the ./examples folder for fully built out examples.

Installation

Install the plugin:

# NPM or Yarn examples below:

npm install --save-dev serverless-offline-msk
yarn add -D serverless-offline-msk

In your serverless.yml we'll want to add the plugin after serverless-offline:

plugins:
  - serverless-offline
  - serverless-offline-msk

Plugin Configuration

custom:
  serverless-offline-msk:
    allowAutoTopicCreation: true # If we can create topics in kafka automatically
    brokers: # list of brokers to use for kafka
      - "kafka:19092" # this example here is from a docker compose example in examples

Function Event Configuration

The supported options are the same that are supported by serverless and MSK. See the serverless docs for more information.

functions:
  consumerName:
    events:
      - msk: # list of MSK events.
          arn: 'arn:*' # requried! in AWS you would use a real MSK ARN, but this can be anything locally
          topic: some_topic_name # required! whatever the topic name is.
          batchSize: 1
          startingPosition: LATEST
          enabled: false # this will turn it off

LICENSE

See LICENSE for more info.

Package Sidebar

Install

npm i serverless-offline-msk

Weekly Downloads

110

Version

1.0.0

License

MIT

Unpacked Size

188 MB

Total Files

13436

Last publish

Collaborators

  • lukevers