Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bragg-firehose

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bragg-firehose

bragg middleware for Firehose transformation trigger

  • 0.0.1-0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

bragg-firehose Build Status

bragg middleware for Firehose transformation Lambda trigger

About

This bragg middleware converts the AWS Kinesis Firehose data stream to a typical bragg request data structure. The implementation of a bragg Lambda for Firehose data transformation follows a strict structure and failure to implement the Lambda according to those rules will result in an error. See the documentation here and here

All transformed records from Lambda must contain the following parameters, or Kinesis Data Firehose rejects them and treats that as a data transformation failure.

recordId: The record ID is passed from Kinesis Data Firehose to Lambda during the invocation. The transformed record must contain the same record ID. Any mismatch between the ID of the original record and the ID of the transformed record is treated as a data transformation failure.

result: The status of the data transformation of the record. The possible values are: Ok (the record was transformed successfully), Dropped (the record was dropped intentionally by your processing logic), and ProcessingFailed (the record could not be transformed). If a record has a status of Ok or Dropped, Kinesis Data Firehose considers it successfully processed. Otherwise, Kinesis Data Firehose considers it unsuccessfully processed.

data: The transformed data payload, after base64-encoding.

Install

$ npm install bragg-firehose

Usage

const app = require('bragg');
const router = require('bragg-router');
const firehose = require('bragg-firehose');

const app = bragg();
// Install the Firehose bragg middleware
app.use(firehose());
app.use(routes());

const routes = () => {
	const router = router();

	router.post('forehose:myStreamName', ctx => {
		ctx.body = [
			{
				recordId: 'myReceivedRecordId',
				result: 'Ok',
				data: 'eyJmb28iOiJiYXIifQ=='
			}
		];
	});

	return router.routes();
};

export const handler = app.listen();

API

firehose()

Install the bragg Firehose middleware

License

MIT © Simon Jang

Keywords

FAQs

Package last updated on 09 Oct 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc