A Lambda function that handles GET/POST requests from a REST API and loads/stores records into a DynamoDB table.
- Trigger: API Gateway - REST API
- Destination: DynamoDB Table
- Function code:
templates/api - Unit tests:
tests/api - Infra stack:
infra/stacks/api.py
| Endpoint | Description | Response codes |
|---|---|---|
GET /items/{id} |
Retrieve an item by ID | 200, 404, 500 |
POST /items |
Create a new item | 201, 422, 500 |
| Field | Type | Description |
|---|---|---|
id |
UUID string | Unique item identifier (auto-generated) |
name |
string | Human-readable item name |
| Variable | Description |
|---|---|
TABLE_NAME |
DynamoDB table name |
SERVICE_NAME |
Powertools service name |
METRICS_NAMESPACE |
Powertools metrics namespace |
