SHINDE UJJWAL ANIL
SHINDE UJJWAL ANIL

Reputation: 1

How to track Aws batch job status to perform other actions when that particular job is completed

I want to perform some actions after my submitted aws batch job using aws-sdk is completed. I get job id, job name and some more parameters in response but I get this response when my batch job is submitted and not after finished. Is there any way to get data after completing aws batch job so that I'll know that job is completed and I can do further work base on that output of job ? Is there any way to get response from aws batch job about status after completing or failing the job?

Upvotes: 0

Views: 2315

Answers (1)

MyStackRunnethOver
MyStackRunnethOver

Reputation: 5275

Looks like you have a couple options:

  1. Use the AWS Batch Events your jobs create. CloudWatch events can automatically trigger a bunch of other things. However, you can't control the content of the event since it's auto-generated.

AWS Batch sends job status change events to CloudWatch Events. AWS Batch tracks the state of your jobs. If a previously submitted job's status changes, an event is invoked. For example, if a job in the RUNNING status moves to the FAILED status

  1. Make your Batch workflow part of a Step Function. You can choose what to pass from one step (Batch) to another (whatever it triggers). You also get a bunch of built-in state tracking and failure handling courtesy of Step Functions.

  2. Make your Batch jobs trigger their own followup process. E.g. after they write their output, send an SNS message to an SQS queue with info about where their output was written. Then, a lambda listening to the SQS queue can pick up the SNS message and do work based on it. You get full customization of your interactions, but no built-in state tracking or failure handling except for what you implement in your connections.

Upvotes: 1

Related Questions