A team exposes an Amazon API Gateway REST API with a non-proxy Lambda integration. The client sends a JSON body, but the Lambda function expects a different shape that also injects the caller's source IP and the request time. The team wants API Gateway to reshape the incoming request into the function's expected structure before invocation, without changing the function code. Which API Gateway feature reshapes the request?
- AA request validator on the method that rewrites the body to the backend shape after confirming it matches the defined JSON Schema model.
- BA Lambda proxy integration that forwards the raw request unchanged so the function reshapes the body itself at runtime.
- CA gateway response template that rebuilds the request body and adds the source IP before the integration forwards it on.
- DA mapping template on the integration request that uses Velocity to build the new JSON body from the input payload and context variables. Correct
Why A is wrong: Validators only accept or reject a request against a schema, so they verify structure but never transform or reshape the payload.
Why B is wrong: Proxy integration passes the request through untouched, which forces code changes in the function and so does not meet the no-code goal.
Why C is wrong: Gateway responses customise error replies sent back to clients, not the request sent to a backend, so they cannot reshape an incoming body.
Why D is correct: Integration request mapping templates transform the incoming payload into the backend shape and can pull in context values such as source IP and request time.