Hello serverless people.
I just came across this thing i didn’t know exists: “API Gateway as a proxy for DynamoDB” (ref: Using Amazon API Gateway as a proxy for DynamoDB | AWS Compute Blog)
I want to replace my lambdas to this^
all my requests are pretty simple, except of my GET request that have some built-in customised filters.
I did came across the plugin “apigateway-service-proxy”, but not sure if this will be sufficient for my future needs, and prefer to apply this in a “raw” custom way while merging it to my current api gateway.
if it’s possible to get some kind of a boiler plate template on how to apply this in .yml (and probably code, so in python) i’d be super happy.
I cannot edit my post so i’ll add some examples:
GET requests to
/devices - should return all the devices in my dynamodb table.
/devices?customer_id=42 - should return all devices with customer_id column equals to 42.
/devices?customer_id=null - (could be other indicator that isn’t null but similar) returns all devices that doesn’t have a “customer_id” column.
/devices?created=12345,67899 - returns all devices created between the 2 timestamps.
- Combinations of more than one filter, like
/devices?customer_id=42&created=12345,67899 - will return all devices assigned to user id 42 and created between the 2 stated timestamps.
POST request for
/devices: Adds a device row in the Devices dynamodb table, while some inputs like “customer_id, name, url” are mandatory.
PATCH request for
/devices: Updates a row with a “customer_id” (can be an non existing column too).
Note: The solution doesn’t have to include all the requests i mentioned, although, the more the better. I can build a function that builds a filter. I just need the general guidelines for doing that with Serverless Framework.