1

The AWS docs here state that "You can use parameter mapping in your integration request for proxy and non-proxy integrations, but to use parameter mapping for an integration response, you need a non-proxy integration."

I'm trying to map (i.e. rename) a query string parameter in the request so according to the docs this should work. I have the original parameter name required in the method request and I've set up the mapping in the integration request. So, the console let's me do this but when I print out my event in my Lambda and look in the logs the query string parameter name has not been changed. I just see the original.

AI and other parts of AWS documentation state that the proxy integration just forwards the everything as-is to the Lambda, which is what I'm experiencing.

Is the documentation wrong, or can you really do a query string parameter transformation using a Lambda proxy integration?

I'm not super familiar with API Gateway, have been involved with some work in the past, but now just trying to re-familiarize myself for the AWS Developer associate exam I plan to take soon. So just trying to clarify what's possible and what's not. I can provide screenshots more details if needed. Thanks.

2 Answers 2

0

Following the documentation it does actually map the HTTP headers as specified by the user in the Integration requests tab. However, the parameters passed to the Lambda function's event parameter are before they're transformed. You can test this behavior from API Gateway, in your resource, click the Test tab. In my example, I map puppies to DogAge0, like the documentation, passing puppies:true we see the following log results:

Wed Jul 30 08:23:43 UTC 2025 : Method request headers: {puppies=true}
Wed Jul 30 08:23:43 UTC 2025 : Method request body before transformations: 
Wed Jul 30 08:23:43 UTC 2025 : Endpoint request URI: <removed>
Wed Jul 30 08:23:43 UTC 2025 : Endpoint request headers: {x-amzn-lambda-integration-tag=<removed>, Authorization=<removed>, X-Amz-Date=20250730T082343Z, DogsAge0=true, x-amzn-apigateway-api-id=<removed>, X-Amz-Source-Arn=<removed>, Accept=application/json, User-Agent=<removed>, X-Amz-Security-Token=<removed> [TRUNCATED]

My Lambda function still receives puppies=true but the header is actually DogsAge0=true. Hope this helps.

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

3 Comments

Yes, you can map header parameters, but it looks like you can't map query string parameters. Even though the first link in that doc specifically says you can do method request query strings using the method.request.querystring.name format and it lets you do this in the console. I did it but it seems like it's completely ignored on a proxy integration. They should grey it out those boxes on the integration request configuration if you can't actually do it. Very annoying and misleading.
With proxy integration and query parameter follows the same logic as described above. I've just tested it and it passes the parameters as-is into the event parameter to the Lambda function but while using the "Test" functionality of API Gateway the logs show it changes the query parameter based on the mapping. It is confusing, when using a Lambda integrations it would make it easier if the fields were just grayed out like you suggested.
I just tested with headers too and got the same result. I think that part of the documentation is just wrong. If you click on the examples link, in each example it states "Your method must have a non-proxy integration." docs.aws.amazon.com/apigateway/latest/developerguide/… AI tells me something a little different each time, depending on how I phrase my question, but some of the responses state that proxy integrations "are designed to pass the entire request through to the backend without requiring explicit parameter mapping."
0

I've concluded that it is just not possible to modify query parameters with a proxy integration. One part of AWS docs says that it's possible, but all examples provided are for non-proxy integrations. My testing has confirmed that it's not possible.

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.