@Stability(value=Experimental) public static final class TaskDefinition.Builder extends Object implements software.amazon.jsii.Builder<TaskDefinition>
TaskDefinition
.Modifier and Type | Method and Description |
---|---|
TaskDefinition |
build() |
TaskDefinition.Builder |
compatibility(Compatibility compatibility)
(experimental) The task launch type compatiblity requirement.
|
TaskDefinition.Builder |
cpu(String cpu)
(experimental) The number of cpu units used by the task.
|
static TaskDefinition.Builder |
create(software.constructs.Construct scope,
String id) |
TaskDefinition.Builder |
executionRole(IRole executionRole)
(experimental) The name of the IAM task execution role that grants the ECS agent to call AWS APIs on your behalf.
|
TaskDefinition.Builder |
family(String family)
(experimental) The name of a family that this task definition is registered to.
|
TaskDefinition.Builder |
inferenceAccelerators(List<? extends InferenceAccelerator> inferenceAccelerators)
(experimental) The inference accelerators to use for the containers in the task.
|
TaskDefinition.Builder |
ipcMode(IpcMode ipcMode)
(experimental) The IPC resource namespace to use for the containers in the task.
|
TaskDefinition.Builder |
memoryMiB(String memoryMiB)
(experimental) The amount (in MiB) of memory used by the task.
|
TaskDefinition.Builder |
networkMode(NetworkMode networkMode)
(experimental) The networking mode to use for the containers in the task.
|
TaskDefinition.Builder |
pidMode(PidMode pidMode)
(experimental) The process namespace to use for the containers in the task.
|
TaskDefinition.Builder |
placementConstraints(List<? extends PlacementConstraint> placementConstraints)
(experimental) The placement constraints to use for tasks in the service.
|
TaskDefinition.Builder |
proxyConfiguration(ProxyConfiguration proxyConfiguration)
(experimental) The configuration details for the App Mesh proxy.
|
TaskDefinition.Builder |
taskRole(IRole taskRole)
(experimental) The name of the IAM role that grants containers in the task permission to call AWS APIs on your behalf.
|
TaskDefinition.Builder |
volumes(List<? extends Volume> volumes)
(experimental) The list of volume definitions for the task.
|
@Stability(value=Experimental) public static TaskDefinition.Builder create(software.constructs.Construct scope, String id)
scope
- This parameter is required.id
- This parameter is required.TaskDefinition.Builder
.@Stability(value=Experimental) public TaskDefinition.Builder executionRole(IRole executionRole)
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.
executionRole
- The name of the IAM task execution role that grants the ECS agent to call AWS APIs on your behalf. This parameter is required.this
@Stability(value=Experimental) public TaskDefinition.Builder family(String family)
A family groups multiple versions of a task definition.
Default: - Automatically generated name.
family
- The name of a family that this task definition is registered to. This parameter is required.this
@Stability(value=Experimental) public TaskDefinition.Builder proxyConfiguration(ProxyConfiguration proxyConfiguration)
Default: - No proxy configuration.
proxyConfiguration
- The configuration details for the App Mesh proxy. This parameter is required.this
@Stability(value=Experimental) public TaskDefinition.Builder taskRole(IRole taskRole)
Default: - A task role is automatically created for you.
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.this
@Stability(value=Experimental) public TaskDefinition.Builder volumes(List<? extends Volume> volumes)
For more information, see Task Definition Parameter Volumes.
Default: - No volumes are passed to the Docker daemon on a container instance.
volumes
- The list of volume definitions for the task. This parameter is required.this
@Stability(value=Experimental) public TaskDefinition.Builder compatibility(Compatibility compatibility)
compatibility
- The task launch type compatiblity requirement. This parameter is required.this
@Stability(value=Experimental) public TaskDefinition.Builder cpu(String cpu)
If you are using the EC2 launch type, this field is optional and any value can be used. If you are using the Fargate launch type, this field is required and you must use one of the following values, which determines your range of valid values for the memory parameter:
256 (.25 vCPU) - Available memory values: 512 (0.5 GB), 1024 (1 GB), 2048 (2 GB)
512 (.5 vCPU) - Available memory values: 1024 (1 GB), 2048 (2 GB), 3072 (3 GB), 4096 (4 GB)
1024 (1 vCPU) - Available memory values: 2048 (2 GB), 3072 (3 GB), 4096 (4 GB), 5120 (5 GB), 6144 (6 GB), 7168 (7 GB), 8192 (8 GB)
2048 (2 vCPU) - Available memory values: Between 4096 (4 GB) and 16384 (16 GB) in increments of 1024 (1 GB)
4096 (4 vCPU) - Available memory values: Between 8192 (8 GB) and 30720 (30 GB) in increments of 1024 (1 GB)
Default: - CPU units are not specified.
cpu
- The number of cpu units used by the task. This parameter is required.this
@Stability(value=Experimental) public TaskDefinition.Builder inferenceAccelerators(List<? extends InferenceAccelerator> inferenceAccelerators)
Not supported in Fargate.
Default: - No inference accelerators.
inferenceAccelerators
- The inference accelerators to use for the containers in the task. This parameter is required.this
@Stability(value=Experimental) public TaskDefinition.Builder ipcMode(IpcMode ipcMode)
Not supported in Fargate and Windows containers.
Default: - IpcMode used by the task is not specified
ipcMode
- The IPC resource namespace to use for the containers in the task. This parameter is required.this
@Stability(value=Experimental) public TaskDefinition.Builder memoryMiB(String memoryMiB)
If using the EC2 launch type, this field is optional and any value can be used. If using the Fargate launch type, this field is required and you must use one of the following values, which determines your range of valid values for the cpu parameter:
512 (0.5 GB), 1024 (1 GB), 2048 (2 GB) - Available cpu values: 256 (.25 vCPU)
1024 (1 GB), 2048 (2 GB), 3072 (3 GB), 4096 (4 GB) - Available cpu values: 512 (.5 vCPU)
2048 (2 GB), 3072 (3 GB), 4096 (4 GB), 5120 (5 GB), 6144 (6 GB), 7168 (7 GB), 8192 (8 GB) - Available cpu values: 1024 (1 vCPU)
Between 4096 (4 GB) and 16384 (16 GB) in increments of 1024 (1 GB) - Available cpu values: 2048 (2 vCPU)
Between 8192 (8 GB) and 30720 (30 GB) in increments of 1024 (1 GB) - Available cpu values: 4096 (4 vCPU)
Default: - Memory used by task is not specified.
memoryMiB
- The amount (in MiB) of memory used by the task. This parameter is required.this
@Stability(value=Experimental) public TaskDefinition.Builder networkMode(NetworkMode networkMode)
On Fargate, the only supported networking mode is AwsVpc.
Default: - NetworkMode.Bridge for EC2 & External tasks, AwsVpc for Fargate tasks.
networkMode
- The networking mode to use for the containers in the task. This parameter is required.this
@Stability(value=Experimental) public TaskDefinition.Builder pidMode(PidMode pidMode)
Not supported in Fargate and Windows containers.
Default: - PidMode used by the task is not specified
pidMode
- The process namespace to use for the containers in the task. This parameter is required.this
@Stability(value=Experimental) public TaskDefinition.Builder placementConstraints(List<? extends PlacementConstraint> placementConstraints)
You can specify a maximum of 10 constraints per task (this limit includes constraints in the task definition and those specified at run time).
Not supported in Fargate.
Default: - No placement constraints.
placementConstraints
- The placement constraints to use for tasks in the service. This parameter is required.this
@Stability(value=Experimental) public TaskDefinition build()
build
in interface software.amazon.jsii.Builder<TaskDefinition>
Copyright © 2021. All rights reserved.