79297226

Date: 2024-12-20 12:28:14
Score: 2
Natty:
Report link

Research Summary: If you check the events in the CloudTrail you can easily find the deregister-job-definition events getting triggered. That causes the latest revision of the job-definition to go into inactive state and eligible for deletion after 90 days.

Further, CloudTrail Event's could help you to trace the issue was coming from the terraform.

How to fix the issue?

The fix is to explicitly add deregister_on_new_revision in the aws_batch_job_definition resource block of your terraform like below:

resource "aws_batch_job_definition" "test" {
  name = "tf_test_batch_job_definition"
  type = "container"

  .. 
  deregister_on_new_revision = false
}

Description:

deregister_on_new_revision - (Optional) When updating a job definition a new revision is created. This parameter determines if the previous version is deregistered (INACTIVE) or left ACTIVE. Defaults to true.

Reasons:
  • RegEx Blacklisted phrase (1.5): How to fix the issue?
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Low reputation (1):
Posted by: Sarvat Mir