Interface Ec2TaskDefinitionProps
- All Superinterfaces:
CommonTaskDefinitionProps
,software.amazon.jsii.JsiiSerializable
- All Known Implementing Classes:
Ec2TaskDefinitionProps.Jsii$Proxy
@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)",
date="2023-06-19T16:30:47.296Z")
@Stability(Stable)
public interface Ec2TaskDefinitionProps
extends software.amazon.jsii.JsiiSerializable, CommonTaskDefinitionProps
The properties for a task definition run on an EC2 cluster.
Example:
Ec2TaskDefinition ec2TaskDefinition = Ec2TaskDefinition.Builder.create(this, "TaskDef") .networkMode(NetworkMode.BRIDGE) .build(); ContainerDefinition container = ec2TaskDefinition.addContainer("WebContainer", ContainerDefinitionOptions.builder() // Use an image from DockerHub .image(ContainerImage.fromRegistry("amazon/amazon-ecs-sample")) .memoryLimitMiB(1024) .build());
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic final class
A builder forEc2TaskDefinitionProps
static final class
An implementation forEc2TaskDefinitionProps
-
Method Summary
Modifier and TypeMethodDescriptionbuilder()
default List<InferenceAccelerator>
The inference accelerators to use for the containers in the task.default IpcMode
The IPC resource namespace to use for the containers in the task.default NetworkMode
The Docker networking mode to use for the containers in the task.default PidMode
The process namespace to use for the containers in the task.default List<PlacementConstraint>
An array of placement constraint objects to use for the task.Methods inherited from interface software.amazon.awscdk.services.ecs.CommonTaskDefinitionProps
getExecutionRole, getFamily, getProxyConfiguration, getTaskRole, getVolumes
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Method Details
-
getInferenceAccelerators
The inference accelerators to use for the containers in the task.Not supported in Fargate.
Default: - No inference accelerators.
-
getIpcMode
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
-
getNetworkMode
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.
-
getPidMode
The process namespace to use for the containers in the task.Not supported in Fargate and Windows containers.
Default: - PidMode used by the task is not specified
-
getPlacementConstraints
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.
-
builder
- Returns:
- a
Ec2TaskDefinitionProps.Builder
ofEc2TaskDefinitionProps
-