JobQueue

class aws_cdk.aws_batch.JobQueue(scope, id, *, compute_environments, enabled=None, job_queue_name=None, priority=None)

Bases: Resource

(experimental) Batch Job Queue.

Defines a batch job queue to define how submitted batch jobs should be ran based on specified batch compute environments.

Stability:

experimental

ExampleMetadata:

infused

Example:

# shared_compute_envs: batch.ComputeEnvironment

high_prio_queue = batch.JobQueue(self, "JobQueue",
    compute_environments=[batch.JobQueueComputeEnvironment(
        compute_environment=shared_compute_envs,
        order=1
    )],
    priority=2
)

low_prio_queue = batch.JobQueue(self, "JobQueue",
    compute_environments=[batch.JobQueueComputeEnvironment(
        compute_environment=shared_compute_envs,
        order=1
    )],
    priority=1
)
Parameters:
  • scope (Construct) –

  • id (str) –

  • compute_environments (Sequence[Union[JobQueueComputeEnvironment, Dict[str, Any]]]) – (experimental) 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.

  • enabled (Optional[bool]) – (experimental) The state of the job queue. If set to true, it is able to accept jobs. Default: true

  • job_queue_name (Optional[str]) – (experimental) A name for the job queue. Up to 128 letters (uppercase and lowercase), numbers, hyphens, and underscores are allowed. Default: - Cloudformation-generated name

  • priority (Union[int, float, None]) – (experimental) 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. Default: 1

Stability:

experimental

Methods

apply_removal_policy(policy)

Apply the given removal policy to this resource.

The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you’ve removed it from the CDK application or because you’ve made a change that requires the resource to be replaced.

The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN).

Parameters:

policy (RemovalPolicy) –

Return type:

None

to_string()

Returns a string representation of this construct.

Return type:

str

Attributes

env

The environment this resource belongs to.

For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.

job_queue_arn

(experimental) The ARN of this batch job queue.

Stability:

experimental

job_queue_name

(experimental) A name for the job queue.

Up to 128 letters (uppercase and lowercase), numbers, hyphens, and underscores are allowed.

Stability:

experimental

node

The construct tree node associated with this construct.

stack

The stack in which this resource is defined.

Static Methods

classmethod from_job_queue_arn(scope, id, job_queue_arn)

(experimental) Fetches an existing batch job queue by its amazon resource name.

Parameters:
  • scope (Construct) –

  • id (str) –

  • job_queue_arn (str) –

Stability:

experimental

Return type:

IJobQueue

classmethod is_construct(x)

Return whether the given object is a Construct.

Parameters:

x (Any) –

Return type:

bool

classmethod is_resource(construct)

Check whether the given construct is a Resource.

Parameters:

construct (IConstruct) –

Return type:

bool