Closed usabe closed 2 years ago
Hi @usabe 👋 thanks for reaching out!
I've been thinking about implementing special support to power-tune Lambda functions behind an API Gateway endpoint.
The main challenge is that there are multiple integration types and the event your Lambda function expects is highly dependant on both integration type and any mapping template (Velocity) that your API Gateway is applying. An easy solution (or workaround) would be supporting only the default structure with a simple URL and METHOD mapping.
What payload
structure are you using right now? Have you looked into the official payload structure for APIGW documentation?
Hi, Alex,
Thank you for the explanation. Good to know that you have been thinking about supporting this. Indeed, to fully cover all those scenarios, there are a lot of work to do. For our case, I think the easy solution you mentioned to support the default structure with a simple URL and METHOD mapping should work. Could you please give it a quick update of this? Or how could we implement that?
I didn't check into the APIGW payload structure yet before this. Not very familiar with this. Do you mean we can add the http URL and METHOD into the payload and then apiGateway will pass this to the lambda function?
@usabe yes, you'd need to "manually" construct the full payload (including url, method, headers, etc.).
The fastest solution right now would be printing out the payload structure that your function expects, and then building your power-tuning payload based on that (changing the URL/METHOD based on your tuning needs).
Simply use the JSON input as your payload
input for the power-tuning state machine.
Great. Then I'll try that. Thank you, Alex. Your help is really appreciated.
Closing this for now. Please reopen if you need more help :)
Hi, team,
Our lambda functions are only served through the apiGateway. When I directly send the lambda function test request with ARN to specify the target, it always gives result of "request unhandled". Is there any way I can send URL on top of the ARN for the tuning test? Like adding the URL inside the payload or somewhere so that I can power tune them as other regular lambda functions?
Thanks