https://github.com/fakorede/go-lambda
Serverless microservice built with Go, Lambda, DynamoDB, API Gateway
https://github.com/fakorede/go-lambda
Last synced: 4 months ago
JSON representation
Serverless microservice built with Go, Lambda, DynamoDB, API Gateway
- Host: GitHub
- URL: https://github.com/fakorede/go-lambda
- Owner: Fakorede
- Created: 2022-03-30T14:57:22.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2022-04-02T20:27:38.000Z (over 3 years ago)
- Last Synced: 2025-04-22T23:16:42.470Z (8 months ago)
- Language: Go
- Homepage: https://documenter.getpostman.com/view/5901558/UVyswvCp
- Size: 12.1 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# go-lambda
> A simple serverless microservice built with Lambda, DynamoDB, and API Gateway
## Deplyment process
- Build application, then zip the build folder
```
GOARCH=amd64 GOOS=linux go build -o build/main cmd/main.go
chmod +x main
zip build/main.zip build/main
```
- Deploy to the Mangt Console (Create function and upload zip file, Create DynamoDB table, Create API Gateway and point it to the lambda function)
- Test Endpoints
```
curl --header "Content-Type: application/json" --request POST --data '{"email": "fab@thefabdev.com", "first_name": "Fab", "last_name": "Dev"}' https://ft20f9aquj.execute-api.us-east-1.amazonaws.com/staging
curl -X GET https://ft20f9aquj.execute-api.us-east-1.amazonaws.com/staging
curl -X GET https://ft20f9aquj.execute-api.us-east-1.amazonaws.com/staging\?email\=fab@thefabdev.com
curl --header "Content-Type: application/json" --request PUT --data '{"email": "fab@thefabdev.com", "first_name": "Fab", "last_name": "Dev"}' https://ft20f9aquj.execute-api.us-east-1.amazonaws.com/staging
curl -X DELETE https://ft20f9aquj.execute-api.us-east-1.amazonaws.com/staging\?email\=fab@thefabdev.com
```