By using AWS re:Post, you agree to the Terms of Use
/Trigger Step Function with API Gateway and use Fargate within Step Function?/

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

1 Answers
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".
answered 2 months ago
  • @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

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions