步骤函数中的跨帐户Lambda调用 [英] Cross Account Lambda calls from Step Function
本文介绍了步骤函数中的跨帐户Lambda调用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在帐户A中有Step函数,在帐户B中有lambda,但在运行Step函数时,它给出:
An error occurred while executing the state 'lambdaB' (entered at the event id #2). The resource belongs to a different account from the running execution.
是否有可能进行此配置。
推荐答案
我们可以在STEP函数中这样做:
Parameters": {
"FunctionName": "FUNCTION_ARN",
"Payload.$": "$"
},
"Resource": "arn:aws:states:::lambda:invoke"
在Lambda中,我们需要添加权限:
"Version": "2012-10-17",
"Id": "default",
"Statement": [
{
"Sid": "sid-1",
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::ACCOUNT_A:root"
},
"Action": "lambda:InvokeFunction",
"Resource": "FUNCTION_ARN"
}
]
}
这篇关于步骤函数中的跨帐户Lambda调用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文