Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/techjacker/appsync-elasticsearch-geosearch
Example Geo Search API built on AWS Appysnc & Elasticsearch
https://github.com/techjacker/appsync-elasticsearch-geosearch
aws-appsync elasticsearch geosearch
Last synced: 3 months ago
JSON representation
Example Geo Search API built on AWS Appysnc & Elasticsearch
- Host: GitHub
- URL: https://github.com/techjacker/appsync-elasticsearch-geosearch
- Owner: techjacker
- Created: 2018-06-04T19:29:27.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2022-12-08T02:13:22.000Z (about 2 years ago)
- Last Synced: 2024-08-02T12:50:25.879Z (6 months ago)
- Topics: aws-appsync, elasticsearch, geosearch
- Language: Shell
- Homepage: https://andrewgriffithsonline.com/blog/build-geosearch-graphql-api-aws-appsyncelasticsearch
- Size: 22.5 KB
- Stars: 16
- Watchers: 3
- Forks: 5
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-starred - techjacker/appsync-elasticsearch-geosearch - Example Geo Search API built on AWS Appysnc & Elasticsearch (others)
README
# Appsync Elasticsearch Geo Search
Example Geo Search API built on AWS Appysnc & Elasticsearch.
-----------------------------------------------------------
## Example Usage### 1. Set up
Install the Serverless Framework plugins used by the project.
```Shell
$ npm install
```Create an `.env` file and update the `AWS_ACCOUNT_ID` variable.
```Shell
export AWS_ACCCOUNT_ID=123456789
```### 2. Deploy Elasticsearch
```Shell
$ ./bin/deploy
```### 3. Create Elasticsearch Geo Mapping
Redeploy the lambda function so it has the updated elasticsearch endpoint value created in the last step.
```Shell
$ ./bin/deploy-lambda
```Then invoke it to create the mapping in elasticsearch.
```Shell
$ ./bin/invoke-lambda
```### 4. Deploy the Appsync API
```Shell
$ ./bin/deploy-appsync
```### 5. Update the Appsync API.
```Shell
$ ./bin/update-appsync
```### 6. Destroy Stack
```Shell
$ ./bin/destroy
```-----------------------------------------------------------
## Lambda Development SetupCreate a virtualenv then install requirements:
```
$ make env
$ source env/bin/activate
$ make deps
```-----------------------------------------------------------
## Unit Tests
```
$ make test
```-----------------------------------------------------------
## Local Development
To invoke the lambda function locally do the following.
#### 1. Add the following to the `.env` file
```Shell
# .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
```#### 2. Invoke the lambda function.
```Shell
$ ./bin/invoke-local
```