AWS CloudFormation
User Guide (Version )

AWS::Batch::JobQueue

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.

Syntax

To declare this entity in your AWS CloudFormation template, use the following syntax:

JSON

{ "Type" : "AWS::Batch::JobQueue", "Properties" : { "ComputeEnvironmentOrder" : [ ComputeEnvironmentOrder, ... ], "JobQueueName" : String, "Priority" : Integer, "State" : String } }

YAML

Type: AWS::Batch::JobQueue Properties: ComputeEnvironmentOrder: - ComputeEnvironmentOrder JobQueueName: String Priority: Integer State: String

Properties

ComputeEnvironmentOrder

The set of compute environments mapped to a job queue and their order relative to each other. The job scheduler uses this parameter to determine which compute environment should execute a given job. Compute environments must be in the VALID state before you can associate them with a job queue. You can associate up to three compute environments with a job queue.

Required: Yes

Type: List of ComputeEnvironmentOrder

Update requires: No interruption

JobQueueName

The name of the job queue.

Required: No

Type: String

Update requires: Replacement

Priority

The priority of the job queue. Job queues with a higher priority (or a higher integer value for the priority parameter) are evaluated first when associated with the same compute environment. Priority is determined in descending order, for example, a job queue with a priority value of 10 is given scheduling preference over a job queue with a priority value of 1.

Required: Yes

Type: Integer

Update requires: No interruption

State

The state of the job queue. If the job queue state is ENABLED, it is able to accept jobs.

Required: No

Type: String

Allowed Values: DISABLED | ENABLED

Update requires: No interruption

Return Values

Ref

When you pass the logical ID of this resource to the intrinsic Ref function, Ref returns the job queue ARN, such as arn:aws:batch:us-east-1:111122223333:job-queue/HighPriority.

For more information about using the Ref function, see Ref.

Examples

Job queue with two compute environments

The following example defines a job queue called HighPriority that has two compute environments mapped to it.

JSON

{ "JobQueue": { "Type": "AWS::Batch::JobQueue", "Properties": { "ComputeEnvironmentOrder": [ { "Order": 1, "ComputeEnvironment": "C4OnDemand" }, { "Order": 2, "ComputeEnvironment": "M4Spot" } ], "State": "ENABLED", "Priority": 1, "JobQueueName": "HighPriority" } } }

YAML

JobQueue: Type: AWS::Batch::JobQueue Properties: ComputeEnvironmentOrder: - Order: 1 ComputeEnvironment: C4OnDemand - Order: 2 ComputeEnvironment: M4Spot State: ENABLED Priority: 1 JobQueueName: HighPriority