Trigger Step Function with API Gateway and use Fargate within Step Function?

0

I want to be able to have a step function that does the following:

  1. The step function starts with a call to API Gateway from my web app
  2. The step function starts a Fargate pod based on a specific image
  3. The step function runs a task on the pod it just created
  4. After the Fargate task completes, terminate the pod so it does not consume resources

Is this possible to tell Step Functions to start a new pod based on a certain image and then terminate that pod after it returns a success code?

I have not been able to find any info on this.

Thank you

已提问 2 年前411 查看次数
2 回答
1

Please do respect the time others dedicated helping you by mark answers as accepted.

You can do this by -

  1. Once the task has been completed, you can query the TaskARN through the metadata service and terminate the task;
  2. You should also mark the step function step as completed;
  3. Fargate tasks never "completes" before the "pod".
Jason_S
已回答 2 年前
  • @Jason_S Thank you for that info.

    I understand getting the ARN and terminate the task but is it possible to have Step Functions tell Fargate to spin up a pod based on a specific image to run a task like I mentioned in step 2? I have not been able to find any info on this. All I have been able to find is to send a task to an already running pod.

    Thanks

0

The link below and its subordinate pages provide more detail on invoking Fargate tasks from Step Functions workflows, and how to pass all available configuration parameters for control of the "pods". https://docs.aws.amazon.com/step-functions/latest/dg/connect-ecs.html

AWS
AWSdave
已回答 1 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则