AWS::Batch::JobQueue
The AWS::Batch::JobQueue resource specifies the parameters for an Amazon Batch job queue
definition. For more information, see Job
Queues in the Amazon Batch User Guide.
Syntax
To declare this entity in your Amazon CloudFormation template, use the following syntax:
JSON
{ "Type" : "AWS::Batch::JobQueue", "Properties" : { "ComputeEnvironmentOrder" :[ ComputeEnvironmentOrder, ... ], "JobQueueName" :String, "Priority" :Integer, "SchedulingPolicyArn" :String, "State" :String, "Tags" :{} }Key:Value, ...}
YAML
Type: AWS::Batch::JobQueue Properties: ComputeEnvironmentOrder:- ComputeEnvironmentOrderJobQueueName:StringPriority:IntegerSchedulingPolicyArn:StringState:StringTags:Key:Value
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 runs a specific job. Compute environments must be in the
VALIDstate 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 (EC2orSPOT) or Fargate (FARGATEorFARGATE_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. Amazon 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. It can be up to 128 letters long. It can contain uppercase and lowercase letters, numbers, hyphens (-), and underscores (_).
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
priorityparameter) 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 of10is given scheduling preference over a job queue with a priority value of1. All of the compute environments must be either EC2 (EC2orSPOT) or Fargate (FARGATEorFARGATE_SPOT); EC2 and Fargate compute environments can't be mixed.Required: Yes
Type: Integer
Update requires: No interruption
SchedulingPolicyArn-
The Amazon Resource Name (ARN) of the scheduling policy. The format is
aws:Partition:batch:Region:Account:scheduling-policy/Name. For example,aws:aws:batch:us-west-2:123456789012:scheduling-policy/MySchedulingPolicy.Required: No
Type: String
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 | ENABLEDUpdate requires: No interruption
Tags-
The tags that are applied to the job queue. For more information, see Tagging your Amazon Batch resources in Amazon Batch User Guide.
Required: No
Type: Map of String
Update requires: Replacement
Return values
Ref
When you pass the logical ID of this resource to the intrinsic Reffunction, Refreturns the job queue ARN, such as arn:aws-cn:batch:us-east-1:111122223333:job-queue/HighPriority.
For more information about using the Reffunction, see Ref.
Fn::GetAtt
The Fn::GetAttintrinsic function returns a value for a specified attribute of this type. The following are the available attributes and sample return values.
For more information about using the Fn::GetAttintrinsic function, see Fn::GetAtt.
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 Amazon Batch User Guide.