Skip to content
This repository has been archived by the owner on Mar 21, 2024. It is now read-only.

trialspark/kafkajs-msk-iam-authentication-mechanism

 
 

Repository files navigation

Kafka MSK IAM integration

Installation

You need to have "kafkajs": "^2.2.0-beta.0" installed.

For more information look at tulios/kafkajs#840 (comment).

npm i @jm18457/kafkajs-msk-iam-authentication-mechanism 

Setup

const { Kafka } = require('kafkajs')
const {
  awsIamAuthenticator,
  Type
} = require('@jm18457/kafkajs-msk-iam-authentication-mechanism')

const kafka = new Kafka({
  brokers: process.env.BROKERS.split(','),
  clientId: 'consumer',
  ssl: true,
  sasl: {
    mechanism: Type,
    authenticationProvider: awsIamAuthenticator(process.env.REGION, process.env.TTL)
  }
})

Examples

For working examples look at example folder.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 58.8%
  • JavaScript 41.2%