Class EcsJobDefinitionProps.Builder
java.lang.Object
software.amazon.awscdk.services.batch.EcsJobDefinitionProps.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<EcsJobDefinitionProps>
- Enclosing interface:
EcsJobDefinitionProps
@Stability(Stable)
public static final class EcsJobDefinitionProps.Builder
extends Object
implements software.amazon.jsii.Builder<EcsJobDefinitionProps>
A builder for
EcsJobDefinitionProps
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds the configured instance.container
(IEcsContainerDefinition container) Sets the value ofEcsJobDefinitionProps.getContainer()
jobDefinitionName
(String jobDefinitionName) Sets the value ofJobDefinitionProps.getJobDefinitionName()
parameters
(Map<String, ? extends Object> parameters) Sets the value ofJobDefinitionProps.getParameters()
propagateTags
(Boolean propagateTags) Sets the value ofEcsJobDefinitionProps.getPropagateTags()
retryAttempts
(Number retryAttempts) Sets the value ofJobDefinitionProps.getRetryAttempts()
retryStrategies
(List<? extends RetryStrategy> retryStrategies) Sets the value ofJobDefinitionProps.getRetryStrategies()
schedulingPriority
(Number schedulingPriority) Sets the value ofJobDefinitionProps.getSchedulingPriority()
Sets the value ofJobDefinitionProps.getTimeout()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
container
@Stability(Stable) public EcsJobDefinitionProps.Builder container(IEcsContainerDefinition container) Sets the value ofEcsJobDefinitionProps.getContainer()
- Parameters:
container
- The container that this job will run. This parameter is required.- Returns:
this
-
propagateTags
Sets the value ofEcsJobDefinitionProps.getPropagateTags()
- Parameters:
propagateTags
- Whether to propogate tags from the JobDefinition to the ECS task that Batch spawns.- Returns:
this
-
jobDefinitionName
Sets the value ofJobDefinitionProps.getJobDefinitionName()
- Parameters:
jobDefinitionName
- The name of this job definition.- Returns:
this
-
parameters
@Stability(Stable) public EcsJobDefinitionProps.Builder parameters(Map<String, ? extends Object> parameters) Sets the value ofJobDefinitionProps.getParameters()
- Parameters:
parameters
- The default parameters passed to the container These parameters can be referenced in thecommand
that you give to the container.- Returns:
this
-
retryAttempts
Sets the value ofJobDefinitionProps.getRetryAttempts()
- Parameters:
retryAttempts
- The number of times to retry a job. The job is retried on failure the same number of attempts as the value.- Returns:
this
-
retryStrategies
@Stability(Stable) public EcsJobDefinitionProps.Builder retryStrategies(List<? extends RetryStrategy> retryStrategies) Sets the value ofJobDefinitionProps.getRetryStrategies()
- Parameters:
retryStrategies
- Defines the retry behavior for this job.- Returns:
this
-
schedulingPriority
@Stability(Stable) public EcsJobDefinitionProps.Builder schedulingPriority(Number schedulingPriority) Sets the value ofJobDefinitionProps.getSchedulingPriority()
- Parameters:
schedulingPriority
- 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:
this
-
timeout
Sets the value ofJobDefinitionProps.getTimeout()
- Parameters:
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:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<EcsJobDefinitionProps>
- Returns:
- a new instance of
EcsJobDefinitionProps
- Throws:
NullPointerException
- if any required attribute was not provided
-