Resource: aws_batch_job_queue

Provides a Batch Job Queue resource.

Example Usage

Basic Job Queue

resource "aws_batch_job_queue" "test_queue" {
  name     = "tf-test-batch-job-queue"
  state    = "ENABLED"
  priority = 1

  compute_environment_order {
    order               = 1
    compute_environment = aws_batch_compute_environment.test_environment_1.arn
  }

  compute_environment_order {
    order               = 2
    compute_environment = aws_batch_compute_environment.test_environment_2.arn
  }
}

Job Queue with a fair share scheduling policy

resource "aws_batch_scheduling_policy" "example" {
  name = "example"

  fair_share_policy {
    compute_reservation = 1
    share_decay_seconds = 3600

    share_distribution {
      share_identifier = "A1*"
      weight_factor    = 0.1
    }
  }
}

resource "aws_batch_job_queue" "example" {
  name = "tf-test-batch-job-queue"

  scheduling_policy_arn = aws_batch_scheduling_policy.example.arn
  state                 = "ENABLED"
  priority              = 1

  compute_environment_order {
    order               = 1
    compute_environment = aws_batch_compute_environment.test_environment_1.arn
  }

  compute_environment_order {
    order               = 2
    compute_environment = aws_batch_compute_environment.test_environment_2.arn
  }
}

Argument Reference

This resource supports the following arguments:

compute_environment_order

Attribute Reference

This resource exports the following attributes in addition to the arguments above:

Timeouts

Configuration options:

Import

In Terraform v1.5.0 and later, use an import block to import Batch Job Queue using the arn. For example:

import {
  to = aws_batch_job_queue.test_queue
  id = "arn:aws:batch:us-east-1:123456789012:job-queue/sample"
}

Using terraform import, import Batch Job Queue using the arn. For example:

% terraform import aws_batch_job_queue.test_queue arn:aws:batch:us-east-1:123456789012:job-queue/sample