执行步骤功能“任务".使用ECS Fargate [英] Executing Step Function "Tasks" using ECS Fargate
问题描述
在Re:Invent 2018中,AWS似乎已经启动了与Step Functions的新集成,其中包括ECS Fargate支持.
In Re:Invent 2018, AWS seems to have launched new integrations with Step Functions, which includes ECS Fargate support.
https://docs.aws.amazon.com/step-functions/latest/dg/connectors-ecs.html
我一直在研究这个问题,并且能够启动ECS任务并执行其任务,但是我无法将所需的输出发送回step函数.响应语法似乎也没有对应于特定状态输出的任何内容.
I have been digging up on this, and I am able to get the ECS task to startup, and do its thing, but I am not able to send desired output back to the step function. The response syntax too does not seem to have anything that corresponds to the output of a particular state.
ECS任务是否可以将输出发送回步进功能?任何线索都会有所帮助.
Is it possible for an ECS task to send back output to the step function? Any leads would help.
P.S:我了解活动,并进行了ECS活动调查,并在完成时发送任务成功.但是,我一直在尝试使用调用ECS的步进功能,如果可行的话.
P.S: I am aware of activities, and have ECS poll for activity, and send task success on completion. But, I was looking to leverage step function calling ECS if that works.
推荐答案
您可以使用等待回调( .waitForTaskToken
)" 集成模式进行回调到ECS任务中的步进功能".使用 .waitForTaskToken
而不是 .sync
,执行将暂停并等待SendTaskSuccess或SendTaskFailure,这可以从ECS任务中通过所需的任何输出来完成.它与活动类似,但是任务令牌被推送到下游服务,而不是对其进行轮询.
You can use the "Wait for Callback (.waitForTaskToken
)" integration pattern to callback to Step Functions in the ECS task. Using .waitForTaskToken
instead of .sync
, the execution will pause and wait for SendTaskSuccess or SendTaskFailure, which can be done from the ECS task with any output you want. It's similar to activities, but the task token is pushed to downstream service instead of polling for it.
arn:aws:states :::: ecs:runTask.sync
任务的输出是 https://docs.aws.amazon.com/step-functions/latest/dg/connect-to-resource.html#connect-wait-token
这篇关于执行步骤功能“任务".使用ECS Fargate的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!