javascript - 无权承担所提供的角色

标签 javascript node.js aws-lambda aws-step-functions

我正在关注 AWS Step Functions tutorial .整个状态机流程是这样的。

enter image description here

我有一个名为 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/

相关文章:

node.js - context.done 在处理程序 'graphql' 中调用了两次

考虑到colspan和rowspan的Javascript获取表格单元格二维数组

javascript - Express 中的脚本标签

javascript - 如何将 jQuery 插件 Mapael 包含到 Angular 5 中?

node.js - 监听终端 session "close"事件

node.js - 如何在 Mongoose 中进行嵌套查找?

java - 将 AWS Lambda 函数放入 VPC,然后 "IOException: Connection reset by peer"开始发生,但只是偶尔发生

javascript - jQuery DataTables 初始化延迟

node.js - jenkins.build.log() 被 jenkins : build. 日志拒绝:禁止

swift - 在 Swift 中通过 APIGateway 同步调用 AWS Lambda 函数