Module: AWSCDK::Batch::IEKSJobDefinition

Includes:
IJobDefinition
Included in:
EKSJobDefinition
Defined in:
batch/ieks_job_definition.rb

Overview

A JobDefinition that uses Eks orchestration.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.jsii_overridable_methodsObject



188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
# File 'batch/ieks_job_definition.rb', line 188

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 },
    :container => { kind: :property, name: "container", is_optional: false },
    :dns_policy => { kind: :property, name: "dnsPolicy", is_optional: true },
    :service_account => { kind: :property, name: "serviceAccount", is_optional: true },
    :use_host_network => { kind: :property, name: "useHostNetwork", 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:



183
184
185
186
# File 'batch/ieks_job_definition.rb', line 183

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:



174
175
176
177
# File 'batch/ieks_job_definition.rb', line 174

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

#containerAWSCDK::Batch::EKSContainerDefinition

The container this Job Definition will run.



111
112
113
# File 'batch/ieks_job_definition.rb', line 111

def container()
  jsii_get_property("container")
end

#dns_policyAWSCDK::Batch::DNSPolicy?

Note:

Default: DnsPolicy.CLUSTER_FIRST

The DNS Policy of the pod used by this Job Definition.



120
121
122
# File 'batch/ieks_job_definition.rb', line 120

def dns_policy()
  jsii_get_property("dnsPolicy")
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.



26
27
28
# File 'batch/ieks_job_definition.rb', line 26

def env()
  jsii_get_property("env")
end

#job_definition_arnString

The ARN of this job definition.

Returns:

  • (String)


47
48
49
# File 'batch/ieks_job_definition.rb', line 47

def job_definition_arn()
  jsii_get_property("jobDefinitionArn")
end

#job_definition_nameString

The name of this job definition.

Returns:

  • (String)


54
55
56
# File 'batch/ieks_job_definition.rb', line 54

def job_definition_name()
  jsii_get_property("jobDefinitionName")
end

#job_definition_refAWSCDK::Interfaces::AWSBatch::JobDefinitionReference

A reference to a JobDefinition resource.



40
41
42
# File 'batch/ieks_job_definition.rb', line 40

def job_definition_ref()
  jsii_get_property("jobDefinitionRef")
end

#nodeConstructs::Node

The tree node.

Returns:

  • (Constructs::Node)


11
12
13
# File 'batch/ieks_job_definition.rb', line 11

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.



71
72
73
# File 'batch/ieks_job_definition.rb', line 71

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)


81
82
83
# File 'batch/ieks_job_definition.rb', line 81

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:



62
63
64
# File 'batch/ieks_job_definition.rb', line 62

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)


93
94
95
# File 'batch/ieks_job_definition.rb', line 93

def scheduling_priority()
  jsii_get_property("schedulingPriority")
end

#service_accountString?

Note:

Default: - the default service account of the container

The name of the service account that's used to run the container.

service accounts are Kubernetes method of identification and authentication, roughly analogous to IAM users.



132
133
134
# File 'batch/ieks_job_definition.rb', line 132

def ()
  jsii_get_property("serviceAccount")
end

#stackAWSCDK::Stack

The stack in which this resource is defined.

Returns:



33
34
35
# File 'batch/ieks_job_definition.rb', line 33

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:



104
105
106
# File 'batch/ieks_job_definition.rb', line 104

def timeout()
  jsii_get_property("timeout")
end

#use_host_networkBoolean?

Note:

Default: true

If specified, the Pod used by this Job Definition will use the host's network IP address.

Otherwise, the Kubernetes pod networking model is enabled. Most AWS Batch workloads are egress-only and don't require the overhead of IP allocation for each pod for incoming connections.



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

def use_host_network()
  jsii_get_property("useHostNetwork")
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



155
156
157
158
159
160
# File 'batch/ieks_job_definition.rb', line 155

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