Skip to content

czerasz/go-lambda-sns-to-es

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AWS Lambda: SNS to ElasticSearch

Requirements

  • Golang >= 1.11

Development

Install dependencies:

go get

Tests

Run tests with:

go test -cover ./...

Build

Generate artifact ./dist/deployment.zip:

./scripts/build

Environment Variables

Name Default Value Description
ES_URL http://127.0.0.1:9200 The URL to ElasticSearch
ES_INDEX_TEMPLATE {{ .Prefix }}-{{ .Date.Year }}.{{ .Date.Month }}.{{ .Date.Day }} ElasticSearch index template.

Available objects:
- Env
- Date
- Prefix
ES_DOC_TYPE_NAME notification Document type used to index the event message
DEBUG false Enable debugging mode

Testing/Debugging Localy

  • start HTTP debugging server:

    docker run --rm \
              --name=http-debugger \
              --publish 8080:80 \
              mendhak/http-https-echo
  • execute lambda function with sample event:

    cat ./test-data/event.json | LOCAL_TEST=true DEBUG=true ES_URL='http://localhost:8080' go run ./src/main.go

About

Move SNS events to ElasticSearch

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published