I'm looking a solution for my problem and maybe someone could give me some ideas. I have a API Gateway
plugged to a aws lambda
A. I have to handle cases like this:
APi Gateway
. So, my problem is how to chain these lambdas, because I don't want to have a huge lambda. At first, I thought about using Step Functions
except that this works in a asynchronous mode, so no good for my case. I know I can do a lambda to call the step function and wait for the result, but I don't like this solution.
Any ideas for a nice solution ?
Thanks.
CC
You can use invoke lambda with "async await" here is docs:
https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Lambda.html#invoke-property
For asynchronous call: https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Lambda.html#invokeAsync-property
您可以使用AWS Step Function管理 AWS lambda 函数之间的协调。
Really B & C are apis that A is calling
Put lambda B & C behind another api gateway, using IAM auth. Give A rights to call that Api via your IAM Role.
For a more granular approach, you can have B/C as their own api gateways, meaning your have decoupled them fully
MiniEdit: For something like this I'd also consider using the Lambda Function URLs now: https://docs.aws.amazon.com/lambda/latest/dg/lambda-urls.html
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.