job_queues
Creates, updates, deletes, gets or lists a job_queues resource.
Overview
| Name | job_queues |
| Type | Resource |
| Id | aws.batch.job_queues |
Fields
The following fields are returned by SELECT queries:
- describe_job_queues
| Name | Datatype | Description |
|---|---|---|
compute_environment_order | array | The compute environments that are attached to the job queue and the order that job placement is preferred. Compute environments are selected for job placement in ascending order. |
job_queue_arn | string | The Amazon Resource Name (ARN) of the job queue. |
job_queue_name | string | The job queue name. |
job_queue_type | string | The type of job queue. For service jobs that run on SageMaker Training, this value is SAGEMAKER_TRAINING. For regular container jobs, this value is EKS, ECS, or ECS_FARGATE depending on the compute environment. (EKS, ECS, ECS_FARGATE, SAGEMAKER_TRAINING) |
job_state_time_limit_actions | array | The set of actions that Batch perform on jobs that remain at the head of the job queue in the specified state longer than specified times. Batch will perform each action after maxTimeSeconds has passed. |
priority | integer | The priority of the job queue. Job queue priority determines the order that job queues are evaluated when multiple queues dispatch jobs within a shared compute environment. A higher value for priority indicates a higher priority. Queues are evaluated in cycles, in descending order by priority. For example, a job queue with a priority value of 10 is evaluated before a queue with a priority value of 1. All of the compute environments must be either Amazon EC2 (EC2 or SPOT) or Fargate (FARGATE or FARGATE_SPOT). Amazon EC2 and Fargate compute environments can't be mixed. Job queue priority doesn't guarantee that a particular job executes before a job in a lower priority queue. Jobs added to higher priority queues during the queue evaluation cycle might not be evaluated until the next cycle. A job is dispatched from a queue only if resources are available when the queue is evaluated. If there are insufficient resources available at that time, the cycle proceeds to the next queue. This means that jobs added to higher priority queues might have to wait for jobs in multiple lower priority queues to complete before they are dispatched. You can use job dependencies to control the order for jobs from queues with different priorities. For more information, see Job Dependencies in the Batch User Guide. |
scheduling_policy_arn | string | 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. |
service_environment_order | array | The order of the service environment associated with the job queue. Job queues with a higher priority are evaluated first when associated with the same service environment. |
state | string | Describes the ability of the queue to accept new jobs. If the job queue state is ENABLED, it can accept jobs. If the job queue state is DISABLED, new jobs can't be added to the queue, but jobs already in the queue can finish. (ENABLED, DISABLED) |
status | string | The status of the job queue (for example, CREATING or VALID). (CREATING, UPDATING, DELETING, DELETED, VALID, INVALID) |
status_reason | string | A short, human-readable string to provide additional details for the current status of the job queue. |
tags | object | The tags that are applied to the job queue. For more information, see Tagging your Batch resources in Batch User Guide. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
describe_job_queues | select | region | Describes one or more of your job queues. | |
create_job_queue | insert | region, jobQueueName, priority | Creates an Batch job queue. When you create a job queue, you associate one or more compute environments to the queue and assign an order of preference for the compute environments. You also set a priority to the job queue that determines the order that the Batch scheduler places jobs onto its associated compute environments. For example, if a compute environment is associated with more than one job queue, the job queue with a higher priority is given preference for scheduling jobs to that compute environment. | |
update_job_queue | update | region, jobQueue | Updates a job queue. | |
delete_job_queue | delete | region | Deletes the specified job queue. You must first disable submissions for a queue with the UpdateJobQueue operation. All jobs in the queue are eventually terminated when you delete a job queue. It's not necessary to disassociate compute environments from a queue before submitting a DeleteJobQueue request. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
region | string | AWS region (default: us-east-1) |
SELECT examples
- describe_job_queues
Describes one or more of your job queues.
SELECT
compute_environment_order,
job_queue_arn,
job_queue_name,
job_queue_type,
job_state_time_limit_actions,
priority,
scheduling_policy_arn,
service_environment_order,
state,
status,
status_reason,
tags
FROM aws.batch.job_queues
WHERE region = '{{ region }}' -- required
;
INSERT examples
- create_job_queue
- Manifest
Creates an Batch job queue. When you create a job queue, you associate one or more compute environments to the queue and assign an order of preference for the compute environments. You also set a priority to the job queue that determines the order that the Batch scheduler places jobs onto its associated compute environments. For example, if a compute environment is associated with more than one job queue, the job queue with a higher priority is given preference for scheduling jobs to that compute environment.
INSERT INTO aws.batch.job_queues (
jobQueueName,
state,
schedulingPolicyArn,
priority,
computeEnvironmentOrder,
serviceEnvironmentOrder,
jobQueueType,
tags,
jobStateTimeLimitActions,
region
)
SELECT
'{{ jobQueueName }}' /* required */,
'{{ state }}',
'{{ schedulingPolicyArn }}',
{{ priority }} /* required */,
'{{ computeEnvironmentOrder }}',
'{{ serviceEnvironmentOrder }}',
'{{ jobQueueType }}',
'{{ tags }}',
'{{ jobStateTimeLimitActions }}',
'{{ region }}'
RETURNING
job_queue_arn,
job_queue_name
;
# Description fields are for documentation purposes
- name: job_queues
props:
- name: region
value: "{{ region }}"
description: Required parameter for the job_queues resource.
- name: jobQueueName
value: "{{ jobQueueName }}"
- name: state
value: "{{ state }}"
valid_values: ['ENABLED', 'DISABLED']
- name: schedulingPolicyArn
value: "{{ schedulingPolicyArn }}"
- name: priority
value: {{ priority }}
- name: computeEnvironmentOrder
value:
- order: {{ order }}
computeEnvironment: "{{ computeEnvironment }}"
- name: serviceEnvironmentOrder
value:
- order: {{ order }}
serviceEnvironment: "{{ serviceEnvironment }}"
- name: jobQueueType
value: "{{ jobQueueType }}"
valid_values: ['EKS', 'ECS', 'ECS_FARGATE', 'SAGEMAKER_TRAINING']
- name: tags
value: "{{ tags }}"
- name: jobStateTimeLimitActions
value:
- reason: "{{ reason }}"
state: "{{ state }}"
maxTimeSeconds: {{ maxTimeSeconds }}
action: "{{ action }}"
UPDATE examples
- update_job_queue
Updates a job queue.
UPDATE aws.batch.job_queues
SET
jobQueue = '{{ jobQueue }}',
state = '{{ state }}',
schedulingPolicyArn = '{{ schedulingPolicyArn }}',
priority = {{ priority }},
computeEnvironmentOrder = '{{ computeEnvironmentOrder }}',
serviceEnvironmentOrder = '{{ serviceEnvironmentOrder }}',
jobStateTimeLimitActions = '{{ jobStateTimeLimitActions }}'
WHERE
region = '{{ region }}' --required
AND jobQueue = '{{ jobQueue }}' --required
RETURNING
job_queue_arn,
job_queue_name;
DELETE examples
- delete_job_queue
Deletes the specified job queue. You must first disable submissions for a queue with the UpdateJobQueue operation. All jobs in the queue are eventually terminated when you delete a job queue. It's not necessary to disassociate compute environments from a queue before submitting a DeleteJobQueue request.
DELETE FROM aws.batch.job_queues
WHERE region = '{{ region }}' --required
;