我正在关注 AWS Step Functions tutorial .整个状态机流程是这样的。
我有一个名为 step_functions_basic_execution 的 Angular 色,其策略为 AWSLambdaRole
。我的 Step 函数状态机正在使用这个 Angular 色。
我的步进函数是
{
"Comment": "A simple AWS Step Functions state machine that automates a call center support session.",
"StartAt": "Open Case",
"States": {
"Open Case": {
"Type": "Task",
"Resource": "arn:aws:lambda:us-west-2:829495130000:function:OpenCaseFunction",
"Next": "Assign Case"
},
...
}
对应的Open Case Lambda函数是
exports.handler = (event, context, callback) => {
// Create a support case using the input as the case ID, then return a confirmation message
var myCaseID = event.inputCaseID;
var myMessage = "Case " + myCaseID + ": opened...";
var result = {Case: myCaseID, Message: myMessage};
callback(null, result);
};
当我尝试运行它时,它在第一步 Open Case 失败了。
输入是
{
"inputCaseID": "001"
}
它抛出错误:
States.TaskFailed
Neither the global service principal states.amazonaws.com, nor the regional one is authorized to assume the provided role.
知道如何解决吗?谢谢
最佳答案
感谢 Joel Kinzel 的指导。这是我的错误。
我在第 2c 步做错了。
On the Create Roles screen, leave AWS Service selected, select Step Functions
我选择了 Lambda 而不是 Step Functions,即使下一页我仍然添加了 AWSLambdaRole
,但这并没有帮助并导致了问题.
关于javascript - 无权承担所提供的角色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56436514/