Module: AWSCDK::Batch::IJobDefinition

Includes:
IResource, Interfaces::AWSBatch::IJobDefinitionRef
Included in:
ECSJobDefinition, EKSJobDefinition, IEKSJobDefinition, MultiNodeJobDefinition
Defined in:
batch/i_job_definition.rb

Overview

Represents a JobDefinition.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.jsii_overridable_methodsObject



149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
# File 'batch/i_job_definition.rb', line 149

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_definition_ref => { kind: :property, name: "jobDefinitionRef", is_optional: false },
    :job_definition_arn => { kind: :property, name: "jobDefinitionArn", is_optional: false },
    :job_definition_name => { kind: :property, name: "jobDefinitionName", is_optional: false },
    :retry_strategies => { kind: :property, name: "retryStrategies", is_optional: false },
    :parameters => { kind: :property, name: "parameters", is_optional: true },
    :retry_attempts => { kind: :property, name: "retryAttempts", is_optional: true },
    :scheduling_priority => { kind: :property, name: "schedulingPriority", is_optional: true },
    :timeout => { kind: :property, name: "timeout", is_optional: true },
    :with => { kind: :method, name: "with", is_optional: false },
    :apply_removal_policy => { kind: :method, name: "applyRemovalPolicy", is_optional: false },
    :add_retry_strategy => { kind: :method, name: "addRetryStrategy", is_optional: false },
  }
end

Instance Method Details

#add_retry_strategy(strategy) ⇒ void

This method returns an undefined value.

Add a RetryStrategy to this JobDefinition.

Parameters:



144
145
146
147
# File 'batch/i_job_definition.rb', line 144

def add_retry_strategy(strategy)
  Jsii::Type.check_type(strategy, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYmF0Y2guUmV0cnlTdHJhdGVneSJ9")), "strategy")
  jsii_call_method("addRetryStrategy", [strategy])
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_definition.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

#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_definition.rb', line 27

def env()
  jsii_get_property("env")
end

#job_definition_arnString

The ARN of this job definition.

Returns:

  • (String)


48
49
50
# File 'batch/i_job_definition.rb', line 48

def job_definition_arn()
  jsii_get_property("jobDefinitionArn")
end

#job_definition_nameString

The name of this job definition.

Returns:

  • (String)


55
56
57
# File 'batch/i_job_definition.rb', line 55

def job_definition_name()
  jsii_get_property("jobDefinitionName")
end

#job_definition_refAWSCDK::Interfaces::AWSBatch::JobDefinitionReference

A reference to a JobDefinition resource.



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

def job_definition_ref()
  jsii_get_property("jobDefinitionRef")
end

#nodeConstructs::Node

The tree node.

Returns:

  • (Constructs::Node)


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

def node()
  jsii_get_property("node")
end

#parametersHash{String => Object}?

Note:

Default: none

The default parameters passed to the container These parameters can be referenced in the command that you give to the container.



72
73
74
# File 'batch/i_job_definition.rb', line 72

def parameters()
  jsii_get_property("parameters")
end

#retry_attemptsNumeric?

Note:

Default: 1

The number of times to retry a job.

The job is retried on failure the same number of attempts as the value.

Returns:

  • (Numeric, nil)


82
83
84
# File 'batch/i_job_definition.rb', line 82

def retry_attempts()
  jsii_get_property("retryAttempts")
end

#retry_strategiesArray<AWSCDK::Batch::RetryStrategy>

Note:

Default: - no RetryStrategy

Defines the retry behavior for this job.

Returns:



63
64
65
# File 'batch/i_job_definition.rb', line 63

def retry_strategies()
  jsii_get_property("retryStrategies")
end

#scheduling_priorityNumeric?

Note:

Default: none

The priority of this Job.

Only used in Fairshare Scheduling to decide which job to run first when there are multiple jobs with the same share identifier.

Returns:

  • (Numeric, nil)


94
95
96
# File 'batch/i_job_definition.rb', line 94

def scheduling_priority()
  jsii_get_property("schedulingPriority")
end

#stackAWSCDK::Stack

The stack in which this resource is defined.

Returns:



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

def stack()
  jsii_get_property("stack")
end

#timeoutAWSCDK::Duration?

Note:

Default: - no timeout

The timeout time for jobs that are submitted with this job definition.

After the amount of time you specify passes, Batch terminates your jobs if they aren't finished.

Returns:



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

def timeout()
  jsii_get_property("timeout")
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_definition.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