AWS Batch Job Queue

This page shows how to write Terraform and CloudFormation for AWS Batch Job Queue and write them securely.

aws_batch_job_queue (Terraform)

The Job Queue in AWS Batch can be configured in Terraform with the resource name aws_batch_job_queue. The following sections describe 3 examples of how to use the resource and its parameters.

Example Usage from GitHub

nextflow-batch.tf#L19
resource "aws_batch_job_queue" "nf_default_queue" {
  name     = "nextflow-batch-default-queue"
  tags     = var.default_tags
  state    = "ENABLED"
  priority = 1
  compute_environments = [
AWS_Batch_Queue.tf#L1
resource "aws_batch_job_queue" "nextflow-queue" {
  name     = "nextflow-batch-job-queue"
  state    = "ENABLED"
  priority = 1
  compute_environments = [
    aws_batch_compute_environment.sample.arn
main.tf#L1
resource "aws_batch_job_queue" "queue" {
  name                 = var.name
  state                = var.state
  priority             = var.priority
  compute_environments = var.compute_environments

Parameters

Explanation in Terraform Registry

Provides a Batch Job Queue resource.

AWS::Batch::JobQueue (CloudFormation)

The JobQueue in Batch can be configured in CloudFormation with the resource name AWS::Batch::JobQueue. The following sections describe 10 examples of how to use the resource and its parameters.

Example Usage from GitHub

batch_env_template_cfn.yml#L86
    Type: AWS::Batch::JobQueue
    Properties:
      JobQueueName: "HighPriority"
      Priority: 1000
      State: ENABLED
      ComputeEnvironmentOrder:
batch_env_template_cfn.yml#L86
    Type: AWS::Batch::JobQueue
    Properties:
      JobQueueName: "HighPriority"
      Priority: 1000
      State: ENABLED
      ComputeEnvironmentOrder:
batch_env_template_cfn.yml#L86
    Type: AWS::Batch::JobQueue
    Properties:
      JobQueueName: "ScHighPriority"
      Priority: 1000
      State: ENABLED
      ComputeEnvironmentOrder:
batch_env_template_cfn.yml#L86
    Type: AWS::Batch::JobQueue
    Properties:
      JobQueueName: "HighPriority"
      Priority: 1000
      State: ENABLED
      ComputeEnvironmentOrder:
serverless.yml#L108
      Type: AWS::Batch::JobQueue
      Properties:
        ComputeEnvironmentOrder:
          - Order: 0
            ComputeEnvironment: !Ref SmallCPUMultifishOnDemandEnv
        State: ENABLED
BatchJobQueueSpecification.json#L3
    "AWS::Batch::JobQueue.ComputeEnvironmentOrder": {
      "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobqueue-computeenvironmentorder.html",
      "Properties": {
        "ComputeEnvironment": {
          "Required": true,
          "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobqueue-computeenvironmentorder.html#cfn-batch-jobqueue-computeenvironmentorder-computeenvironment",
BatchJobQueueSpecification.json#L3
    "AWS::Batch::JobQueue.ComputeEnvironmentOrder": {
      "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobqueue-computeenvironmentorder.html",
      "Properties": {
        "ComputeEnvironment": {
          "Required": true,
          "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobqueue-computeenvironmentorder.html#cfn-batch-jobqueue-computeenvironmentorder-computeenvironment",
saberAirflowMICrONS.json#L184
            "Type": "AWS::Batch::JobQueue"
        },
        "GenJobQueue": {
            "Properties": {
                "ComputeEnvironmentOrder": [
                    {
saberAirflowGeneral.json#L184
            "Type": "AWS::Batch::JobQueue"
        },
        "GenJobQueue": {
            "Properties": {
                "ComputeEnvironmentOrder": [
                    {
Managed_EC2_and_Spot_Batch_Environment.json#L162
      "Type" : "AWS::Batch::JobQueue",
      "Properties" : {
        "Priority" : 1,
        "ComputeEnvironmentOrder" : [
          {
            "Order" : 1,

Parameters

Explanation in CloudFormation Registry

The AWS::Batch::JobQueue resource specifies the parameters for an AWS Batch job queue definition. For more information, see Job Queues in the AWS Batch User Guide.

Frequently asked questions

What is AWS Batch Job Queue?

AWS Batch Job Queue is a resource for Batch of Amazon Web Service. Settings can be wrote in Terraform and CloudFormation.

Where can I find the example code for the AWS Batch Job Queue?

For Terraform, the AlexsLemonade/alsf-scpca, kujalk/NextFlow-AWS-Batch and wojtek099/samples source code examples are useful. See the Terraform Example section for further details.

For CloudFormation, the jbaden15/aws_batch_genomics_step_function, jbaden15/aws_batch_genomics and ImerM/sag_aws source code examples are useful. See the CloudFormation Example section for further details.