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
, "Tags" :Json
} }
YAML
Type: AWS::Batch::JobQueue Properties: ComputeEnvironmentOrder:
- ComputeEnvironmentOrder
JobQueueName:String
Priority:Integer
State:String
Tags:Json
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 run a specific 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. All of the compute environments must be either EC2 (EC2
orSPOT
) or Fargate (FARGATE
orFARGATE_SPOT
); EC2 and Fargate compute environments can't be mixed.Note All compute environments that are associated with a job queue must share the same architecture. AWS Batch doesn't support mixing compute environment architecture types in a single job queue.
Required: Yes
Type: List of ComputeEnvironmentOrder
Update requires: No interruption
JobQueueName
-
The name of the job queue. Up to 128 letters (uppercase and lowercase), numbers, and underscores are allowed.
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 of10
is given scheduling preference over a job queue with a priority value of1
. All of the compute environments must be either EC2 (EC2
orSPOT
) or Fargate (FARGATE
orFARGATE_SPOT
); EC2 and Fargate compute environments cannot be mixed.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. If the job queue state isDISABLED
, new jobs can't be added to the queue, but jobs already in the queue can finish.Required: No
Type: String
Allowed values:
DISABLED | ENABLED
Update requires: No interruption
Tags
-
The tags applied to the job queue. For more information, see Tagging your AWS Batch resources in AWS Batch User Guide.
Required: No
Type: Json
Update requires: Replacement
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
See also
-
Job Queue Parameters in the AWS Batch User Guide.