0

I'm creating AWS Lambda using Container Image and while developing it locally, I would like it to behave like it would after deploying.

You could say that I'm closely following this guide: https://docs.aws.amazon.com/lambda/latest/dg/ruby-image.html

In my production deployment for this AWS Lambda I'm not using API Gateway, I'm using Function URL.

I know that locally I can invoke it using curl like this:

curl -XPOST "http://localhost:9001/2015-03-31/functions/function/invocations" -d '{"rawPath": "/api/v1/convert"}'

but I would prefer to invoke it "normally" like this:

curl -XPOST "http://localhost:9001/api/v1/convert"

As a solution for this, I can implement myself and setup a second container in docker that will "adapt" my normal requests to /2015-03-31/functions/function/invocations but I wonder if there is a better solution that is available out of the box?

This "adapter" would also be helpful for testing on my staging VM without deploying anything in AWS

I googled for some solutions and couldn't find anything relevant.

ipepe
  • 1
  • 1
  • I'm not aware of anything that does that for you already. You would need something like a Nginx proxy in front of the Lambda function to convert the Function URL request into an invocation request (which is basically all AWS Function URLs are doing for you in the cloud) – Mark B Oct 27 '22 at 15:30
  • @MarkB I think it needs to be more complex than the Nginx proxy. HTTP event payload for lambda needs to have a specific structure. Also, the response from lambda needs to be parsed appropriately. – ipepe Oct 27 '22 at 17:05

0 Answers0