0

I am new to AWS and I have followed this tutorial : https://docs.aws.amazon.com/apigateway/latest/developerguide/integrating-api-with-aws-services-s3.html, I am now able to read from the TEST console my AWS object stored on s3 which is the following (it is .json file):

[ { "important": "yes", "name": "john", "type": "male" }, { "important": "yes", "name": "sarah", "type": "female" }, { "important": "no", "name": "maxim", "type": "male" } ]

Now, what I am trying to achieve is pass query parameters. I have added type in the Method Request and added a URL Query String Parameter named type with method.request.querystring.type mapping in the Integration Request.

When I want to test, typing type=male is not taken into account, I still get the 3 elements instead of the 2 male elements.

Any reasons you think this is happening ?

For information, the Resources is the following (and I am using AWS Service integration type to create the GET method as explained in the AWS tutorial)

/
 /{folder}
  /{item}
   GET

1 Answer 1

1

In case anyone is interested by the answer, I have been able to solve my problem.

The full detailed solution requires a tutorial but here are the main steps. The difficulty lies in the many moving parts so it is important to test each of them independently to make progress (quite basic you will tell me).

  1. Make sure your SQL query to your s3 DB is correct, for this you can go in your s3 bucket, click on your file and select "query with s3 select" from the action.

  2. Make sure that your lambda function works, so check that you build and pass the correct SQL query from the test event

  3. Setup the API query strings in the Method Request panel and setup the Mapping Template in the Integration Request panel (for me it looked like this "TypeL1":"$input.params('typeL1')") using the json content type

Good luck !

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.