【问题标题】:AWS Step Functions: new startExecution.sync:2 <role> not authorized to create managed-ruleAWS Step Functions:新的 startExecution.sync:2 <role> 未授权创建托管规则
【发布时间】:2020-07-10 21:19:48
【问题描述】:

我想尝试新的 AWS Step Functions 功能,通过 startExecution.sync:2 启动嵌套的 Step Function,这应该与 startExecution.sync 完全相同,但将结果返回为 json-object 而不是序列化字符串。

当我想使用 CloudFormation 部署 Step Functions 时,我收到错误“' is not authorized to create managed-rule. (Service: AWSStepFunctions; Status Code: 400; Error Code: AccessDeniedException; Request ID: ... ; 代理:null)"

这个错误只发生在新的 startExecution.sync:2 中,startExecution.sync 可以完美运行。

我的 Inline-IAM-Statement 是

iamRoleStatements:
# Event to start SF synchronous
- Effect: Allow
  Action:
    - events:PutTargets
    - events:PutRule
    - events:DescribeRule
    - events:DeleteRule
    - events:DisableRule
    - events:EnableRule
    - events:ListRules
  Resource:
    - arn:aws:events:eu-central-1:<MY_AWS_ACCOUNT_ID>:rule/StepFunctionsGetEventsForStepFunctionsExecutionRule
- Effect: Allow
  Action:
    - states:StartExecution
  Resource:
    - <arn of other sf>
- Effect: Allow
  Action:
    - states:DescribeExecution
    - states:StopExecution
  Resource:
    - "*"

任务启动其他功能的代码是

callOcrSf:
  Type: Task
  Resource: "arn:aws:states:::states:startExecution.sync:2"
  Parameters:
    StateMachineArn: <arn of other sf>
    Input.$: "$"
  ResultPath: "$.otherResult"
  Next: nextTask

有谁知道,为什么这不起作用?我正在使用无服务器框架进行部署,但我认为这应该没什么区别,因为它只会创建 CloudFormation 堆栈。

【问题讨论】:

    标签: amazon-web-services serverless-framework aws-step-functions


    【解决方案1】:

    我一直在使用无服务器框架的步进函数,他们有一个有趣的指南可以帮助您配置它: https://www.serverless.com/plugins/serverless-step-functions

    您需要在项目上安装的另一件事是该插件实际上能够在您的无服务器 yaml https://github.com/serverless-operations/serverless-step-functions 上创建 step 函数

    也根据这个 PR https://github.com/serverless-operations/serverless-step-functions/pull/333 startExecution.sync:2 已添加到包的 2.19.0 版本中。

    【讨论】:

    • 嘿,非常感谢,现在可以使用了。我实际上认为我的一切都是最新的,但显然,我错过了一些东西。
    猜你喜欢
    • 2020-06-22
    • 2021-11-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-09-05
    • 2018-08-28
    • 2020-01-29
    • 1970-01-01
    相关资源
    最近更新 更多