Example Geo Search API built on AWS Appysnc & Elasticsearch.
Install the Serverless Framework plugins used by the project.
$ npm install
Create an .env
file and update the AWS_ACCOUNT_ID
variable.
export AWS_ACCCOUNT_ID=123456789
$ ./bin/deploy
Redeploy the lambda function so it has the updated elasticsearch endpoint value created in the last step.
$ ./bin/deploy-lambda
Then invoke it to create the mapping in elasticsearch.
$ ./bin/invoke-lambda
$ ./bin/deploy-appsync
$ ./bin/update-appsync
$ ./bin/destroy
Create a virtualenv then install requirements:
$ make env
$ source env/bin/activate
$ make deps
$ make test
To invoke the lambda function locally do the following.
# .env
export ES_ENDPOINT=https://xxx.xxx.es.amazonaws.com # UPDATE ME
export ES_INDEX=places
export ES_REGION=eu-west-1
export ES_GEO_MAPPING_FILE=elasticsearch/location_geopoint_mapping.json
$ ./bin/invoke-local