How can I get Tags to be configured on the AWS Batch job started by the Eventbridge?

0

Following a tutorial example it is possible to configure an eventbridge rule to trigger an AWS Batch job.

It is even possible to set other container override configurations like Environment as a list of Name, Value objects in the request json. After using uppercase to start these attribute names, you can see them in Cloudtrail in the SubmitJob request as lowercase values that match the job definition.

The issue I have is that we have is that the jobs started by eventbridge do not contain any tags. How can I get Tags to be configured on the AWS Batch job started by the Eventbridge?

Random facts:

  • The submission role has batch:TagResource permission
  • Using Tags or tags as an attribute in the transformer next to ContainerOverrides does not work
  • Both tags have been tried with [{"Name": "tag_name", "Value": "tag value"}] and {"tag_name":"tag value"} values
  • In the Cloudtrail I can see the SubmitJob coming from events.amazon.com and the request parameters include jobName, containerOverrides, jobQueue and jobDefinition
  • The Batch Job Definition does have tags configured
1 Answer
1
Accepted Answer

Hello,

Below are the set of parameters that can be passed while submitting a Batch job using AWS EventBridge. Please refer this document for more info.

  1. ArrayProperties
  2. JobDefinition
  3. JobName
  4. RetryStrategy

As you can see, it doesn't have a parameter for specifying tag information.

As per the AWS Batch tagging resources documentation, the AWS Batch jobs do not support tag propagation. This means that tags do not propagate from Batch Job definition to the Batch job. They can currently be added through AWS API/CLI/SDK only.

If you prefer, you can have the EventBridge trigger a lambda function that can use AWS API/SDK to submit the Batch job by passing the tag information.

I hope this helps!

profile pictureAWS
SUPPORT ENGINEER
answered 2 years ago
profile picture
EXPERT
reviewed 22 days ago

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