Class Ec2TaskDefinitionProps.Builder
java.lang.Object
software.amazon.awscdk.services.ecs.Ec2TaskDefinitionProps.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<Ec2TaskDefinitionProps>
- Enclosing interface:
Ec2TaskDefinitionProps
@Stability(Stable)
public static final class Ec2TaskDefinitionProps.Builder
extends Object
implements software.amazon.jsii.Builder<Ec2TaskDefinitionProps>
A builder for
Ec2TaskDefinitionProps
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds the configured instance.executionRole
(IRole executionRole) Sets the value ofCommonTaskDefinitionProps.getExecutionRole()
Sets the value ofCommonTaskDefinitionProps.getFamily()
inferenceAccelerators
(List<? extends InferenceAccelerator> inferenceAccelerators) Sets the value ofEc2TaskDefinitionProps.getInferenceAccelerators()
Sets the value ofEc2TaskDefinitionProps.getIpcMode()
networkMode
(NetworkMode networkMode) Sets the value ofEc2TaskDefinitionProps.getNetworkMode()
Sets the value ofEc2TaskDefinitionProps.getPidMode()
placementConstraints
(List<? extends PlacementConstraint> placementConstraints) Sets the value ofEc2TaskDefinitionProps.getPlacementConstraints()
proxyConfiguration
(ProxyConfiguration proxyConfiguration) Sets the value ofCommonTaskDefinitionProps.getProxyConfiguration()
Sets the value ofCommonTaskDefinitionProps.getTaskRole()
Sets the value ofCommonTaskDefinitionProps.getVolumes()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
inferenceAccelerators
@Stability(Stable) public Ec2TaskDefinitionProps.Builder inferenceAccelerators(List<? extends InferenceAccelerator> inferenceAccelerators) Sets the value ofEc2TaskDefinitionProps.getInferenceAccelerators()
- Parameters:
inferenceAccelerators
- The inference accelerators to use for the containers in the task. Not supported in Fargate.- Returns:
this
-
ipcMode
Sets the value ofEc2TaskDefinitionProps.getIpcMode()
- Parameters:
ipcMode
- The IPC resource namespace to use for the containers in the task. Not supported in Fargate and Windows containers.- Returns:
this
-
networkMode
Sets the value ofEc2TaskDefinitionProps.getNetworkMode()
- Parameters:
networkMode
- The Docker networking mode to use for the containers in the task. The valid values are NONE, BRIDGE, AWS_VPC, and HOST.- Returns:
this
-
pidMode
Sets the value ofEc2TaskDefinitionProps.getPidMode()
- Parameters:
pidMode
- The process namespace to use for the containers in the task. Not supported in Windows containers.- Returns:
this
-
placementConstraints
@Stability(Stable) public Ec2TaskDefinitionProps.Builder placementConstraints(List<? extends PlacementConstraint> placementConstraints) Sets the value ofEc2TaskDefinitionProps.getPlacementConstraints()
- Parameters:
placementConstraints
- An array of placement constraint objects to use for the task. You can specify a maximum of 10 constraints per task (this limit includes constraints in the task definition and those specified at run time).- Returns:
this
-
executionRole
Sets the value ofCommonTaskDefinitionProps.getExecutionRole()
- Parameters:
executionRole
- The name of the IAM task execution role that grants the ECS agent permission to call AWS APIs on your behalf. The role will be used to retrieve container images from ECR and create CloudWatch log groups.- Returns:
this
-
family
Sets the value ofCommonTaskDefinitionProps.getFamily()
- Parameters:
family
- The name of a family that this task definition is registered to. A family groups multiple versions of a task definition.- Returns:
this
-
proxyConfiguration
@Stability(Stable) public Ec2TaskDefinitionProps.Builder proxyConfiguration(ProxyConfiguration proxyConfiguration) Sets the value ofCommonTaskDefinitionProps.getProxyConfiguration()
- Parameters:
proxyConfiguration
- The configuration details for the App Mesh proxy.- Returns:
this
-
taskRole
Sets the value ofCommonTaskDefinitionProps.getTaskRole()
- Parameters:
taskRole
- The name of the IAM role that grants containers in the task permission to call AWS APIs on your behalf.- Returns:
this
-
volumes
Sets the value ofCommonTaskDefinitionProps.getVolumes()
- Parameters:
volumes
- The list of volume definitions for the task. For more information, see Task Definition Parameter Volumes.- Returns:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<Ec2TaskDefinitionProps>
- Returns:
- a new instance of
Ec2TaskDefinitionProps
- Throws:
NullPointerException
- if any required attribute was not provided
-