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 年前檢視次數 659 次
1 個回答
1
已接受的答案

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
支援工程師
已回答 1 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南