This RESTful CRUD API will manage your profile data on AWS at any scale. Just hit deploy and your new microservice will be up and running!
API Gateway routes requests, Lambda handles the corresponding logic and your profile data gets stored in DynamoDB. Should you like to take a deeper look, logs are stored in CloudWatch and X-Ray handles the distributed tracing, both of which conveniently make this microservice's internals available to you in dashboards.
- Create profile
POST api/v1/profiles
- Read / retrieve profile
GET api/v1/profiles/{id}
- Update profile
PUT api/v1/profiles/{id}
- Delete profile
DELETE api/v1/profiles/{id}
- Health
GET api/v1/health
- Golang >= 1.11
- Terraform >= 0.12.8
- AWS CLI >= 1.16.230
- Infrastructure costs fit comfortably within AWS' Free-Tier with typical development usage
- All of the above
- Docker
- DynamoDB-local Docker Image
git clone https://github.com/teohrt/cruddyAPI.git
cd cruddyAPI
go mod download
make deploy
This requires two terminals. One to run the local db, and one to run the API server. To Set up the local db, run the command
make db-start
Now, initialize the db table in another terminal and start the API server with these commands:
- This app listens to API Gateway requests by default. For local development you will need to make it accessible to normal http requests. Do this by commenting line 37 and uncomment lines 17 and 35 in file "app/app.go".
make db-table-init
make run-locally
make destroy
See LICENSE.