Skip to content

izikaj/go-lambda-geoip

Repository files navigation

Repo for easy creating geoip API based on AWS lambda and Maxmind's GeoLite2 database.

Inspired by tmaiaroto/go-lambda-geoip.

Prerequisites

Useful links

Instructions

Deploy with Docker

Build image

docker build . -t izikaj/geoip --build-arg MAXMIND_LICENSE_KEY=$MAXMIND_LICENSE_KEY

Deploy it to AWS

docker run -e AWS_ACCESS_KEY_ID="XXXXXXXXX" -e AWS_SECRET_ACCESS_KEY="YYYYYYYYYYYYY" -it izikaj/geoip

To run shell on image:

docker run -e AWS_ACCESS_KEY_ID="XXXXXXXXX" -e AWS_SECRET_ACCESS_KEY="YYYYYYYYYYYYY" -it izikaj/geoip sh

go language

Download binary

Install Guide

go-bindata

go install github.com/jteeuwen/go-bindata/go-bindata

if all set

Assuming you have AWS credentials configured and you've got the serverless and go-bindata ready to use.

You can run the following to retrieve the geoip data set, build, and deploy:

Download fresh Maxmind's database:

make download

To receive access to download the GeoLite2 databases, it now requires registration and license key usage.

Deploy stack:

make deploy

It should build and deploy the Lambda. It may take a little bit due to the size of the database file.

Features:

TODO:

  • write tests
  • return errors more detailed errors
  • refactor code
arch -x86_64 zsh

About

Repo for easy creating geoip API based on AWS lambda and Maxmind's GeoLite2 database.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •