AWS newbie here.
Currently I am using C++ custom runtime for Lambda (as illustrated in this tutorial https://aws.amazon.com/blogs/compute/introducing-the-c-lambda-runtime/)
I integrated it with the AWS API gateway so when the GET/POST on the API is called, my lambda function like this is called,
static invocation_response my_handler(invocation_request const& req)
The "req.payload" would contain the JSON request I sent. So far so good.
For latency/experiment related reasons (also the fact that lack of in memory caching is an issue), I want to do the same using an EC2 instance. i.e. When the REST API is called with a JSON payload, it forwards the request to the C++ code running on my EC2. In other words, as if my lambda was running on an EC2 instance.
How do I achieve this?