https://github.com/kjenney/simple_api_gateway
Provisions an API Gateway with a Lambda and a DynamoDB Table
https://github.com/kjenney/simple_api_gateway
Last synced: 3 months ago
JSON representation
Provisions an API Gateway with a Lambda and a DynamoDB Table
- Host: GitHub
- URL: https://github.com/kjenney/simple_api_gateway
- Owner: kjenney
- Created: 2023-07-26T15:16:31.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-07-26T15:17:32.000Z (almost 2 years ago)
- Last Synced: 2025-01-07T20:12:49.355Z (5 months ago)
- Language: HCL
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# simple-api-gateway
A simple implementation of API gateway with GET and POST reading and writing to DynamoDB.
This example uses products where `id`, `name`, and `price` are stored in a DynamoDB table.
## To deploy run:
```
terraform init
terraform apply
```## To test the API:
Use the `api_url` output from Terraform apply.
To add a product to the table:
`curl -d '{"id":"78911", "name":"Yogurt", "price":"2.45"}' -H "Content-Type: application/json" -X POST {api_url}`
To get a list of products in the table:
`curl {api_url}`