Reputation: 495
I am new to AWS and I am setting up a API Gateway which will call a Lambda function that will post that data to a Kinesis Stream. The API Gateway Post request will contain several request parameters.
I am reading through the AWS docs and I see 2 options for accessing the request parameters.
1) Via the $input Variable doc
2) via Proxy Integration doc
Can you please explain the use case for proxy integration vs using the input variable?
Upvotes: 0
Views: 1108
Reputation: 7344
Basically, if you control the backend integration interface (as you would with a Lambda function) you should use the 'proxy' integration because it's much easier to manipulate the data in your Lambda function code than in the API Gateway transformation.
If you don't control the backend integration interface (like Kinesis directly, or a legacy HTTP endpoint for example) then you can use the mapping template to transform the data between the client and the backend integration.
Does that make sense? For your use case using Lambda, you should use the proxy. If you wanted to try to use Kinesis directly as the backend, you would have to use a mapping template to construct the correct request to Kinesis.
Upvotes: 2