Class Ec2TaskDefinition.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<Ec2TaskDefinition>
- Enclosing class:
Ec2TaskDefinition
Ec2TaskDefinition
.-
Method Summary
Modifier and TypeMethodDescriptionbuild()
static Ec2TaskDefinition.Builder
enableFaultInjection
(Boolean enableFaultInjection) Enables fault injection and allows for fault injection requests to be accepted from the task's containers.executionRole
(IRole executionRole) The name of the IAM task execution role that grants the ECS agent permission to call AWS APIs on your behalf.The name of a family that this task definition is registered to.inferenceAccelerators
(List<? extends InferenceAccelerator> inferenceAccelerators) The inference accelerators to use for the containers in the task.The IPC resource namespace to use for the containers in the task.networkMode
(NetworkMode networkMode) The Docker networking mode to use for the containers in the task.The process namespace to use for the containers in the task.placementConstraints
(List<? extends PlacementConstraint> placementConstraints) An array of placement constraint objects to use for the task.proxyConfiguration
(ProxyConfiguration proxyConfiguration) The configuration details for the App Mesh proxy.The name of the IAM role that grants containers in the task permission to call AWS APIs on your behalf.The list of volume definitions for the task.
-
Method Details
-
create
@Stability(Stable) public static Ec2TaskDefinition.Builder create(software.constructs.Construct scope, String id) - Parameters:
scope
- This parameter is required.id
- This parameter is required.- Returns:
- a new instance of
Ec2TaskDefinition.Builder
.
-
enableFaultInjection
@Stability(Stable) public Ec2TaskDefinition.Builder enableFaultInjection(Boolean enableFaultInjection) Enables fault injection and allows for fault injection requests to be accepted from the task's containers.Fault injection only works with tasks using the
invalid @link
NetworkMode.AWS_VPC
invalid @link
NetworkMode.HOST
Default: undefined - ECS default setting is false
- Parameters:
enableFaultInjection
- Enables fault injection and allows for fault injection requests to be accepted from the task's containers. This parameter is required.- Returns:
this
-
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.
Default: - An execution role will be automatically created if you use ECR images in your task definition.
- Parameters:
executionRole
- The name of the IAM task execution role that grants the ECS agent permission to call AWS APIs on your behalf. This parameter is required.- Returns:
this
-
family
The name of a family that this task definition is registered to.A family groups multiple versions of a task definition.
Default: - Automatically generated name.
- Parameters:
family
- The name of a family that this task definition is registered to. This parameter is required.- Returns:
this
-
proxyConfiguration
@Stability(Stable) public Ec2TaskDefinition.Builder proxyConfiguration(ProxyConfiguration proxyConfiguration) The configuration details for the App Mesh proxy.Default: - No proxy configuration.
- Parameters:
proxyConfiguration
- The configuration details for the App Mesh proxy. This parameter is required.- Returns:
this
-
taskRole
The name of the IAM role that grants containers in the task permission to call AWS APIs on your behalf.Default: - A task role is automatically created for you.
- Parameters:
taskRole
- The name of the IAM role that grants containers in the task permission to call AWS APIs on your behalf. This parameter is required.- Returns:
this
-
volumes
The list of volume definitions for the task.For more information, see Task Definition Parameter Volumes.
Default: - No volumes are passed to the Docker daemon on a container instance.
- Parameters:
volumes
- The list of volume definitions for the task. This parameter is required.- Returns:
this
-
inferenceAccelerators
@Stability(Stable) public Ec2TaskDefinition.Builder inferenceAccelerators(List<? extends InferenceAccelerator> inferenceAccelerators) The inference accelerators to use for the containers in the task.Not supported in Fargate.
Default: - No inference accelerators.
- Parameters:
inferenceAccelerators
- The inference accelerators to use for the containers in the task. This parameter is required.- Returns:
this
-
ipcMode
The IPC resource namespace to use for the containers in the task.Not supported in Fargate and Windows containers.
Default: - IpcMode used by the task is not specified
- Parameters:
ipcMode
- The IPC resource namespace to use for the containers in the task. This parameter is required.- Returns:
this
-
networkMode
The Docker networking mode to use for the containers in the task.The valid values are NONE, BRIDGE, AWS_VPC, and HOST.
Default: - NetworkMode.BRIDGE for EC2 tasks, AWS_VPC for Fargate tasks.
- Parameters:
networkMode
- The Docker networking mode to use for the containers in the task. This parameter is required.- Returns:
this
-
pidMode
The process namespace to use for the containers in the task.Not supported in Windows containers.
Default: - PidMode used by the task is not specified
- Parameters:
pidMode
- The process namespace to use for the containers in the task. This parameter is required.- Returns:
this
-
placementConstraints
@Stability(Stable) public Ec2TaskDefinition.Builder placementConstraints(List<? extends PlacementConstraint> 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).
Default: - No placement constraints.
- Parameters:
placementConstraints
- An array of placement constraint objects to use for the task. This parameter is required.- Returns:
this
-
build
- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<Ec2TaskDefinition>
- Returns:
- a newly built instance of
Ec2TaskDefinition
.
-