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回答
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年前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ