Class CfnTaskDefinitionPropsMixin.RestartPolicyProperty.Builder
java.lang.Object
software.amazon.awscdk.cfnpropertymixins.services.ecs.CfnTaskDefinitionPropsMixin.RestartPolicyProperty.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<CfnTaskDefinitionPropsMixin.RestartPolicyProperty>
- Enclosing interface:
CfnTaskDefinitionPropsMixin.RestartPolicyProperty
@Stability(Stable)
public static final class CfnTaskDefinitionPropsMixin.RestartPolicyProperty.Builder
extends Object
implements software.amazon.jsii.Builder<CfnTaskDefinitionPropsMixin.RestartPolicyProperty>
A builder for
CfnTaskDefinitionPropsMixin.RestartPolicyProperty-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds the configured instance.Sets the value ofCfnTaskDefinitionPropsMixin.RestartPolicyProperty.getEnabled()enabled(IResolvable enabled) Sets the value ofCfnTaskDefinitionPropsMixin.RestartPolicyProperty.getEnabled()ignoredExitCodes(List<? extends Number> ignoredExitCodes) Sets the value ofCfnTaskDefinitionPropsMixin.RestartPolicyProperty.getIgnoredExitCodes()ignoredExitCodes(IResolvable ignoredExitCodes) Sets the value ofCfnTaskDefinitionPropsMixin.RestartPolicyProperty.getIgnoredExitCodes()restartAttemptPeriod(Number restartAttemptPeriod)
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
enabled
@Stability(Stable) public CfnTaskDefinitionPropsMixin.RestartPolicyProperty.Builder enabled(Boolean enabled) Sets the value ofCfnTaskDefinitionPropsMixin.RestartPolicyProperty.getEnabled()- Parameters:
enabled- Specifies whether a restart policy is enabled for the container.- Returns:
this
-
enabled
@Stability(Stable) public CfnTaskDefinitionPropsMixin.RestartPolicyProperty.Builder enabled(IResolvable enabled) Sets the value ofCfnTaskDefinitionPropsMixin.RestartPolicyProperty.getEnabled()- Parameters:
enabled- Specifies whether a restart policy is enabled for the container.- Returns:
this
-
ignoredExitCodes
@Stability(Stable) public CfnTaskDefinitionPropsMixin.RestartPolicyProperty.Builder ignoredExitCodes(List<? extends Number> ignoredExitCodes) Sets the value ofCfnTaskDefinitionPropsMixin.RestartPolicyProperty.getIgnoredExitCodes()- Parameters:
ignoredExitCodes- A list of exit codes that Amazon ECS will ignore and not attempt a restart on. You can specify a maximum of 50 container exit codes. By default, Amazon ECS does not ignore any exit codes.- Returns:
this
-
ignoredExitCodes
@Stability(Stable) public CfnTaskDefinitionPropsMixin.RestartPolicyProperty.Builder ignoredExitCodes(IResolvable ignoredExitCodes) Sets the value ofCfnTaskDefinitionPropsMixin.RestartPolicyProperty.getIgnoredExitCodes()- Parameters:
ignoredExitCodes- A list of exit codes that Amazon ECS will ignore and not attempt a restart on. You can specify a maximum of 50 container exit codes. By default, Amazon ECS does not ignore any exit codes.- Returns:
this
-
restartAttemptPeriod
@Stability(Stable) public CfnTaskDefinitionPropsMixin.RestartPolicyProperty.Builder restartAttemptPeriod(Number restartAttemptPeriod) - Parameters:
restartAttemptPeriod- A period of time (in seconds) that the container must run for before a restart can be attempted. A container can be restarted only once everyrestartAttemptPeriodseconds. If a container isn't able to run for this time period and exits early, it will not be restarted. You can set a minimumrestartAttemptPeriodof 60 seconds and a maximumrestartAttemptPeriodof 1800 seconds. By default, a container must run for 300 seconds before it can be restarted.- Returns:
this
-
build
Builds the configured instance.- Specified by:
buildin interfacesoftware.amazon.jsii.Builder<CfnTaskDefinitionPropsMixin.RestartPolicyProperty>- Returns:
- a new instance of
CfnTaskDefinitionPropsMixin.RestartPolicyProperty - Throws:
NullPointerException- if any required attribute was not provided
-