Setting up resources on API Gateway

0

I wish to create one API and 2 endpoints pointing to one lambda function. Endpoint 1 is a GET with possible query parameters to a getOrders lambda function that will scan DynamoDB for a limit of 10 records, say. Endpoint 2 is also a GET to the same function but with a path parameter specifying the order_id. This will return a single record.

I am getting error messages when I specify the 2 resources and when I get past the messages, my lambda function fails to get the parameters I expect. Also do not understand the issue of sub-resources. A short summary, video or tutorial link will assist greatly

1 Answer
0

Hi,

Check this out - https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-dynamo-db.html. Especially the part where event['routeKey'] conditions are defined should meets your needs.

--Syd

profile picture
answered a year ago
profile picture
EXPERT
reviewed 8 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions