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
질문됨 일 년 전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
지원 엔지니어
답변함 일 년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠