Module: AWSCDK::Batch::IJobQueue

Includes:
IResource, Interfaces::AWSBatch::IJobQueueRef
Included in:
JobQueue
Defined in:
batch/i_job_queue.rb

Overview

Represents a JobQueue.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.jsii_overridable_methodsObject



153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
# File 'batch/i_job_queue.rb', line 153

def self.jsii_overridable_methods
  {
    :node => { kind: :property, name: "node", is_optional: false },
    :env => { kind: :property, name: "env", is_optional: false },
    :stack => { kind: :property, name: "stack", is_optional: false },
    :job_queue_ref => { kind: :property, name: "jobQueueRef", is_optional: false },
    :compute_environments => { kind: :property, name: "computeEnvironments", is_optional: false },
    :job_queue_arn => { kind: :property, name: "jobQueueArn", is_optional: false },
    :job_queue_name => { kind: :property, name: "jobQueueName", is_optional: false },
    :priority => { kind: :property, name: "priority", is_optional: false },
    :enabled => { kind: :property, name: "enabled", is_optional: true },
    :scheduling_policy => { kind: :property, name: "schedulingPolicy", is_optional: true },
    :with => { kind: :method, name: "with", is_optional: false },
    :apply_removal_policy => { kind: :method, name: "applyRemovalPolicy", is_optional: false },
    :add_compute_environment => { kind: :method, name: "addComputeEnvironment", is_optional: false },
  }
end

Instance Method Details

#add_compute_environment(compute_environment, order) ⇒ void

This method returns an undefined value.

Add a ComputeEnvironment to this Queue.

The Queue will prefer lower-order ComputeEnvironments.

Parameters:



147
148
149
150
151
# File 'batch/i_job_queue.rb', line 147

def add_compute_environment(compute_environment, order)
  Jsii::Type.check_type(compute_environment, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5pbnRlcmZhY2VzLmF3c19iYXRjaC5JQ29tcHV0ZUVudmlyb25tZW50UmVmIn0=")), "computeEnvironment")
  Jsii::Type.check_type(order, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "order")
  jsii_call_method("addComputeEnvironment", [compute_environment, order])
end

#apply_removal_policy(policy) ⇒ void

This method returns an undefined value.

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:



135
136
137
138
# File 'batch/i_job_queue.rb', line 135

def apply_removal_policy(policy)
  Jsii::Type.check_type(policy, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5SZW1vdmFsUG9saWN5In0=")), "policy")
  jsii_call_method("applyRemovalPolicy", [policy])
end

#compute_environmentsArray<AWSCDK::Batch::OrderedComputeEnvironment>

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 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 or SPOT) or Fargate (FARGATE or FARGATE_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.



57
58
59
# File 'batch/i_job_queue.rb', line 57

def compute_environments()
  jsii_get_property("computeEnvironments")
end

#enabledBoolean?

Note:

Default: true

If the job queue is enabled, it is able to accept jobs.

Otherwise, new jobs can't be added to the queue, but jobs already in the queue can finish.

Returns:

  • (Boolean, nil)


95
96
97
# File 'batch/i_job_queue.rb', line 95

def enabled()
  jsii_get_property("enabled")
end

#envAWSCDK::Interfaces::ResourceEnvironment

The environment this resource belongs to.

For resources that are created and managed in a Stack (those created by creating new class instances like new Role(), new Bucket(), etc.), this is always the same as the environment of the stack they belong to.

For referenced resources (those obtained from referencing methods like Role.fromRoleArn(), Bucket.fromBucketName(), etc.), they might be different than the stack they were imported into.



27
28
29
# File 'batch/i_job_queue.rb', line 27

def env()
  jsii_get_property("env")
end

#job_queue_arnString

The ARN of this job queue.

Returns:

  • (String)


64
65
66
# File 'batch/i_job_queue.rb', line 64

def job_queue_arn()
  jsii_get_property("jobQueueArn")
end

#job_queue_nameString

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 (_)

Returns:

  • (String)


74
75
76
# File 'batch/i_job_queue.rb', line 74

def job_queue_name()
  jsii_get_property("jobQueueName")
end

#job_queue_refAWSCDK::Interfaces::AWSBatch::JobQueueReference

A reference to a JobQueue resource.



41
42
43
# File 'batch/i_job_queue.rb', line 41

def job_queue_ref()
  jsii_get_property("jobQueueRef")
end

#nodeConstructs::Node

The tree node.

Returns:

  • (Constructs::Node)


12
13
14
# File 'batch/i_job_queue.rb', line 12

def node()
  jsii_get_property("node")
end

#priorityNumeric

The priority of the job queue.

Job queues with a higher priority 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.

Returns:

  • (Numeric)


85
86
87
# File 'batch/i_job_queue.rb', line 85

def priority()
  jsii_get_property("priority")
end

#scheduling_policyAWSCDK::Batch::ISchedulingPolicy?

Note:

Default: - no scheduling policy

The SchedulingPolicy for this JobQueue.

Instructs the Scheduler how to schedule different jobs.



105
106
107
# File 'batch/i_job_queue.rb', line 105

def scheduling_policy()
  jsii_get_property("schedulingPolicy")
end

#stackAWSCDK::Stack

The stack in which this resource is defined.

Returns:



34
35
36
# File 'batch/i_job_queue.rb', line 34

def stack()
  jsii_get_property("stack")
end

#with(*mixins) ⇒ Constructs::IConstruct

Applies one or more mixins to this construct.

Mixins are applied in order. The list of constructs is captured at the start of the call, so constructs added by a mixin will not be visited.

Parameters:

  • mixins (Array<Constructs::IMixin>)

    The mixins to apply.

Returns:

  • (Constructs::IConstruct)

    This construct for chaining



116
117
118
119
120
121
# File 'batch/i_job_queue.rb', line 116

def with(*mixins)
  mixins.each_with_index do |item, index|
    Jsii::Type.check_type(item, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLklNaXhpbiJ9")), "mixins[#{index}]")
  end
  jsii_call_method("with", [*mixins])
end