gpt4 book ai didi

aws-step-functions - AWS StepFunction - 无法更新状态机

转载 作者:行者123 更新时间:2023-12-04 12:42:20 24 4
gpt4 key购买 nike

我有一个可用的 StepFunction 状态机,有 4 个步骤触发 4 个 Lambda。

由于其中一个步骤将是一个运行时间更长的任务,因此我决定将其中一个 Lambda 转换为 Fargate 任务。

配置 ECS 和 Fargate 任务后,我尝试更新我的状态机定义,但收到错误:Failed to update state machine.没有任何额外的消息。

我的状态机定义似乎是有效的,这里是,只是没有实际的 ARN:

{
"Comment": "My Workflow",
"StartAt": "Step1",
"States": {
"Step1": {
"Type": "Task",
"Resource": "copy-pasted-arn-of-lambda",
"Next": "Step2"
},
"Step2": {
"Type": "Task",
"Resource": "arn:aws:states:::ecs:runTask.sync",
"Parameters": {
"LaunchType": "FARGATE",
"Cluster": "copy-pasted-arn-of-cluster",
"TaskDefinition": "copy-paster-arn-of-task-definition",
"Overrides": {
"ContainerOverrides": [
{
"Name": "container-name",
"Command.$": "$.commands"
}
]
}
},
"Next": "Step3",
"Catch": [
{
"ErrorEquals": [
"States.ALL"
],
"Next": "Step4"
}
]
},
"Step3": {
"Type": "Task",
"Resource": "copy-pasted-arn-of-lambda",
"Next": "Step4"
},
"Step4": {
"Type": "Task",
"Resource": "copy-pasted-arn-of-lambda",
"End": true
}
}
}

这是错误的屏幕截图:
enter image description here

有任何想法吗?我一直在这个问题上敲我的头一段时间。

最佳答案

与 AWS 一样,它是权限。

我忘记允许我的 StepFunction 访问事件,这是必需的:

"Action": [
"events:PutTargets",
"events:PutRule",
"events:DescribeRule"
],

https://docs.aws.amazon.com/step-functions/latest/dg/ecs-iam.html

但是,我真的很感激更详细的错误消息!

关于aws-step-functions - AWS StepFunction - 无法更新状态机,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57096836/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com