AWS Fundamentals Logo
AWS Fundamentals
aws batch

AWS AWS Batch CLI Commands

39 CLI commands available for AWS Batch.

CommandSample
cancel-job

Cancels a job in an Batch job queue. Jobs that are in a SUBMITTED, PENDING, or RUNNABLE state are cancelled and the job status is updated to FAILED. A PENDING job is canceled after all dependency jobs are completed. Therefore, it may take longer than expected to cancel a job in PENDING status. When

create-compute-environment

Creates an Batch compute environment. You can create MANAGED or UNMANAGED compute environments. MANAGED compute environments can use Amazon EC2 or Fargate resources. UNMANAGED compute environments can only use EC2 resources. In a managed compute environment, Batch manages the capacity and instance t

create-consumable-resource

Creates an Batch consumable resource.

create-job-queue

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 associ

create-scheduling-policy

Creates an Batch scheduling policy.

create-service-environment

Creates a service environment for running service jobs. Service environments define capacity limits for specific service types such as SageMaker Training jobs.

delete-compute-environment

Deletes an Batch compute environment. Before you can delete a compute environment, you must set its state to DISABLED with the UpdateComputeEnvironment API operation and disassociate it from any job queues with the UpdateJobQueue API operation. Compute environments that use Fargate resources must te

delete-consumable-resource

Deletes the specified consumable resource.

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. The jobs are terminated at a rate of about 16 jobs each second. It's not necessary to disassociate compute e

delete-scheduling-policy

Deletes the specified scheduling policy. You can't delete a scheduling policy that's used in any job queues.

delete-service-environment

Deletes a Service environment. Before you can delete a service environment, you must first set its state to DISABLED with the UpdateServiceEnvironment API operation and disassociate it from any job queues with the UpdateJobQueue API operation.

deregister-job-definition

Deregisters an Batch job definition. Job definitions are permanently deleted after 180 days.

describe-compute-environments

Describes one or more of your compute environments. If you're using an unmanaged compute environment, you can use the DescribeComputeEnvironment operation to determine the ecsClusterArn that you launch your Amazon ECS container instances into.

describe-consumable-resource

Returns a description of the specified consumable resource.

describe-job-definitions

Describes a list of job definitions. You can specify a status (such as ACTIVE) to only return job definitions that match that status.

describe-job-queues

Describes one or more of your job queues.

describe-jobs

Describes a list of Batch jobs.

describe-scheduling-policies

Describes one or more of your scheduling policies.

describe-service-environments

Describes one or more of your service environments.

describe-service-job

The details of a service job.

get-job-queue-snapshot

Provides a list of the first 100 RUNNABLE jobs associated to a single job queue and includes capacity utilization, including total usage and breakdown by share for fairshare scheduling job queues.

list-consumable-resources

Returns a list of Batch consumable resources.

list-jobs

Returns a list of Batch jobs. You must specify only one of the following items: A job queue ID to return a list of jobs in that job queue A multi-node parallel job ID to return a list of nodes for that job An array job ID to return a list of the children for that job

list-jobs-by-consumable-resource

Returns a list of Batch jobs that require a specific consumable resource.

list-scheduling-policies

Returns a list of Batch scheduling policies.

list-service-jobs

Returns a list of service jobs for a specified job queue.

list-tags-for-resource

Lists the tags for an Batch resource. Batch resources that support tags are compute environments, jobs, job definitions, job queues, and scheduling policies. ARNs for child jobs of array and multi-node parallel (MNP) jobs aren't supported.

register-job-definition

Registers an Batch job definition.

submit-job

Submits an Batch job from a job definition. Parameters that are specified during SubmitJob override parameters defined in the job definition. vCPU and memory requirements that are specified in the resourceRequirements objects in the job definition are the exception. They can't be overridden this way

submit-service-job

Submits a service job to a specified job queue to run on SageMaker AI. A service job is a unit of work that you submit to Batch for execution on SageMaker AI.

tag-resource

Associates the specified tags to a resource with the specified resourceArn. If existing tags on a resource aren't specified in the request parameters, they aren't changed. When a resource is deleted, the tags that are associated with that resource are deleted as well. Batch resources that support ta

terminate-job

Terminates a job in a job queue. Jobs that are in the STARTING or RUNNING state are terminated, which causes them to transition to FAILED. Jobs that have not progressed to the STARTING state are cancelled.

terminate-service-job

Terminates a service job in a job queue.

untag-resource

Deletes specified tags from an Batch resource.

update-compute-environment

Updates an Batch compute environment.

update-consumable-resource

Updates a consumable resource.

update-job-queue

Updates a job queue.

update-scheduling-policy

Updates a scheduling policy.

update-service-environment

Updates a service environment. You can update the state of a service environment from ENABLED to DISABLED to prevent new service jobs from being placed in the service environment.

Learn AWS the Practical Way

Our bi-weekly newsletter teaches hands-on AWS fundamentals. No certification fluff - just practical knowledge.

Subscribe to Newsletter

Learn AWS the Practical Way

Our bi-weekly newsletter teaches hands-on AWS fundamentals. No certification fluff - just practical knowledge.

Subscribe to Newsletter

Quick Stats

Total Commands39
ServiceBatch