Mil*_*lan 9 aws-step-functions
我有一个工作 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
}
}
}
Run Code Online (Sandbox Code Playgroud)
有任何想法吗?我已经在这个问题上摸索了一段时间了。
Mil*_*lan 16
正如 AWS 一贯的做法一样,它是权限。
我忘记允许我的 StepFunction 访问事件,这是需要的:
"Action": [
"events:PutTargets",
"events:PutRule",
"events:DescribeRule"
],
Run Code Online (Sandbox Code Playgroud)
https://docs.aws.amazon.com/step-functions/latest/dg/ecs-iam.html
但是,我真的很感激更详细的错误消息!
| 归档时间: |
|
| 查看次数: |
4448 次 |
| 最近记录: |