How can I invoke an AWS Lambda function from my EC2 instance?

↘锁芯ラ 提交于 2019-12-22 13:00:36

问题


I wrote a lambda function to take over some of the multithreaded code in our web app. Now, I'm looking to manually invoke the lambda function from an ASP.NET controller and then pass the function's return value back to the end-user.

I thought about using AWS SQS to invoke the function but I haven't the slightest idea how to grab the return function's return value (the value passed back with context.succeed(returnData);). Any ideas?


回答1:


AWS Lambda now supports synchronous ("RequestResponse") invocations. For .NET, the relevant documentation is here. This will return a InvokeResponse whose Payload property is what is returned by the function -- that is, passed to context.succeed().



来源:https://stackoverflow.com/questions/30021386/how-can-i-invoke-an-aws-lambda-function-from-my-ec2-instance

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!