How can I invoke an AWS Lambda function from my EC

2019-05-28 22:00发布

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条回答
Emotional °昔
2楼-- · 2019-05-28 22:43

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().

查看更多
登录 后发表回答