Class: AWSCDK::Batch::EKSJobDefinitionProps

Inherits:
JobDefinitionProps
  • Object
show all
Defined in:
batch/eks_job_definition_props.rb

Overview

Props for EksJobDefinition.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(job_definition_name: nil, parameters: nil, retry_attempts: nil, retry_strategies: nil, scheduling_priority: nil, skip_deregister_on_update: nil, timeout: nil, container:, dns_policy: nil, service_account: nil, use_host_network: nil) ⇒ EKSJobDefinitionProps

Returns a new instance of EKSJobDefinitionProps.

Parameters:

  • job_definition_name (String, nil) (defaults to: nil)

    The name of this job definition.

  • parameters (Hash{String => Object}, nil) (defaults to: nil)

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

  • retry_attempts (Numeric, nil) (defaults to: nil)

    The number of times to retry a job.

  • retry_strategies (Array<AWSCDK::Batch::RetryStrategy>, nil) (defaults to: nil)

    Defines the retry behavior for this job.

  • scheduling_priority (Numeric, nil) (defaults to: nil)

    The priority of this Job.

  • skip_deregister_on_update (Boolean, nil) (defaults to: nil)

    Specifies whether the previous revision of the job definition is retained in an active status after UPDATE events for the resource.

  • timeout (AWSCDK::Duration, nil) (defaults to: nil)

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

  • container (AWSCDK::Batch::EKSContainerDefinition)

    The container this Job Definition will run.

  • dns_policy (AWSCDK::Batch::DNSPolicy, nil) (defaults to: nil)

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

  • service_account (String, nil) (defaults to: nil)

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

  • use_host_network (Boolean, nil) (defaults to: nil)

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



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'batch/eks_job_definition_props.rb', line 18

def initialize(job_definition_name: nil, parameters: nil, retry_attempts: nil, retry_strategies: nil, scheduling_priority: nil, skip_deregister_on_update: nil, timeout: nil, container:, dns_policy: nil, service_account: nil, use_host_network: nil)
  @job_definition_name = job_definition_name
  Jsii::Type.check_type(@job_definition_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "jobDefinitionName") unless @job_definition_name.nil?
  @parameters = parameters
  Jsii::Type.check_type(@parameters, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6ImFueSJ9LCJraW5kIjoibWFwIn19")), "parameters") unless @parameters.nil?
  @retry_attempts = retry_attempts
  Jsii::Type.check_type(@retry_attempts, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "retryAttempts") unless @retry_attempts.nil?
  @retry_strategies = retry_strategies
  Jsii::Type.check_type(@retry_strategies, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19iYXRjaC5SZXRyeVN0cmF0ZWd5In0sImtpbmQiOiJhcnJheSJ9fQ==")), "retryStrategies") unless @retry_strategies.nil?
  @scheduling_priority = scheduling_priority
  Jsii::Type.check_type(@scheduling_priority, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "schedulingPriority") unless @scheduling_priority.nil?
  @skip_deregister_on_update = skip_deregister_on_update
  Jsii::Type.check_type(@skip_deregister_on_update, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "skipDeregisterOnUpdate") unless @skip_deregister_on_update.nil?
  @timeout = timeout
  Jsii::Type.check_type(@timeout, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5EdXJhdGlvbiJ9")), "timeout") unless @timeout.nil?
  @container = container
  Jsii::Type.check_type(@container, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYmF0Y2guRWtzQ29udGFpbmVyRGVmaW5pdGlvbiJ9")), "container")
  @dns_policy = dns_policy
  Jsii::Type.check_type(@dns_policy, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYmF0Y2guRG5zUG9saWN5In0=")), "dnsPolicy") unless @dns_policy.nil?
  @service_account = 
  Jsii::Type.check_type(@service_account, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "serviceAccount") unless @service_account.nil?
  @use_host_network = use_host_network
  Jsii::Type.check_type(@use_host_network, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "useHostNetwork") unless @use_host_network.nil?
end

Instance Attribute Details

#containerAWSCDK::Batch::EKSContainerDefinition (readonly)

The container this Job Definition will run.



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

def container
  @container
end

#dns_policyAWSCDK::Batch::DNSPolicy? (readonly)

Note:

Default: DnsPolicy.CLUSTER_FIRST

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



100
101
102
# File 'batch/eks_job_definition_props.rb', line 100

def dns_policy
  @dns_policy
end

#job_definition_nameString? (readonly)

Note:

Default: - generated by CloudFormation

The name of this job definition.

Returns:

  • (String, nil)


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

def job_definition_name
  @job_definition_name
end

#parametersHash{String => Object}? (readonly)

Note:

Default: none

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



53
54
55
# File 'batch/eks_job_definition_props.rb', line 53

def parameters
  @parameters
end

#retry_attemptsNumeric? (readonly)

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)


60
61
62
# File 'batch/eks_job_definition_props.rb', line 60

def retry_attempts
  @retry_attempts
end

#retry_strategiesArray<AWSCDK::Batch::RetryStrategy>? (readonly)

Note:

Default: - no RetryStrategy

Defines the retry behavior for this job.

Returns:



65
66
67
# File 'batch/eks_job_definition_props.rb', line 65

def retry_strategies
  @retry_strategies
end

#scheduling_priorityNumeric? (readonly)

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)


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

def scheduling_priority
  @scheduling_priority
end

#service_accountString? (readonly)

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.



109
110
111
# File 'batch/eks_job_definition_props.rb', line 109

def 
  @service_account
end

#skip_deregister_on_updateBoolean? (readonly)

Note:

Default: undefined - AWS Batch default is false

Specifies whether the previous revision of the job definition is retained in an active status after UPDATE events for the resource.

When the property is set to false, the previous revision of the job definition is de-registered after a new revision is created. When the property is set to true, the previous revision of the job definition is not de-registered.

Returns:

  • (Boolean, nil)


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

def skip_deregister_on_update
  @skip_deregister_on_update
end

#timeoutAWSCDK::Duration? (readonly)

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:



90
91
92
# File 'batch/eks_job_definition_props.rb', line 90

def timeout
  @timeout
end

#use_host_networkBoolean? (readonly)

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.



118
119
120
# File 'batch/eks_job_definition_props.rb', line 118

def use_host_network
  @use_host_network
end

Class Method Details

.jsii_propertiesObject



120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
# File 'batch/eks_job_definition_props.rb', line 120

def self.jsii_properties
  {
    :job_definition_name => "jobDefinitionName",
    :parameters => "parameters",
    :retry_attempts => "retryAttempts",
    :retry_strategies => "retryStrategies",
    :scheduling_priority => "schedulingPriority",
    :skip_deregister_on_update => "skipDeregisterOnUpdate",
    :timeout => "timeout",
    :container => "container",
    :dns_policy => "dnsPolicy",
    :service_account => "serviceAccount",
    :use_host_network => "useHostNetwork",
  }
end

Instance Method Details

#to_jsiiObject



136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
# File 'batch/eks_job_definition_props.rb', line 136

def to_jsii
  result = {}
  result.merge!(super)
  result.merge!({
    "jobDefinitionName" => @job_definition_name,
    "parameters" => @parameters,
    "retryAttempts" => @retry_attempts,
    "retryStrategies" => @retry_strategies,
    "schedulingPriority" => @scheduling_priority,
    "skipDeregisterOnUpdate" => @skip_deregister_on_update,
    "timeout" => @timeout,
    "container" => @container,
    "dnsPolicy" => @dns_policy,
    "serviceAccount" => @service_account,
    "useHostNetwork" => @use_host_network,
  })
  result.compact
end