Skip to content
This repository has been archived by the owner on Jan 14, 2020. It is now read-only.

Latest commit

 

History

History
53 lines (39 loc) · 1.63 KB

File metadata and controls

53 lines (39 loc) · 1.63 KB

Amazon Kinesis Firehose Events

Back to Home Go Doc AWS Doc

This package allows you to write AWS Lambda functions to transform incoming Amazon Kinesis Firehose source data and deliver the transformed data to destinations.

Quick Hands-On

For step by step instructions on how to author your AWS Lambda function code in Go, see eawsy/aws-lambda-go-shim.

go get -u -d github.com/eawsy/aws-lambda-go-event/...
package main

import (
	"log"

	"github.com/eawsy/aws-lambda-go-event/service/lambda/runtime/event/kinesisfirehoseevt"
	"github.com/eawsy/aws-lambda-go-core/service/lambda/runtime"
)

func Handle(in *kinesisfirehoseevt.Input, ctx *runtime.Context) (kinesisfirehoseevt.Output, error) {
	rcds := make([]*kinesisfirehoseevt.OutputRecord, 0)
	for _, r := range in.Records {
		log.Println(r)
		rcds = append(rcds, &kinesisfirehoseevt.OutputRecord{
			RecordID: r.RecordID,
			Result:   "Ok",
			Data:     r.Data,
		})
	}
	return kinesisfirehoseevt.Output{Records: rcds}, nil
}