lambci / docker-lambda

Docker images and test runners that replicate the live AWS Lambda environment
MIT License
5.83k stars 431 forks source link

Simulate AWS Gateway Proxy Integration #317

Closed benze closed 3 years ago

benze commented 3 years ago

Is there a way with lambci/lambda to integrate with another container to simulate the AWS API Gateway Proxy Integration?

At the moment, to test out a given lambda, I need to provide the complete body to lambda call that would be provided by the AWS Proxy Integration (see AWS Set up Lambda proxy integrations in API Gateway. For example, I need to send the following body to my curl call to simulate what the Gateway is producing:

{
"headers" : {
      "Content-Type": "application/json"
},
"body":   {
    "url": "http://192.168.56.99:8081/templates/78086b3e-b935-4e66-a01a-faa0246568e7.tgz",
    "data": { "firstName": "eric"   }   } 
}

Is there a way (or another container) that I can use to integrate/simulate all this behaviour so I can more easily call a lambda via an API instead?

mhart commented 3 years ago

Duplicate of #246

You can see some comments in there from ppl with projects that do this