The details of a task definition run on an EC2 cluster.
import { Ec2TaskDefinition } from 'aws-cdk-lib/aws-ecs';Or use the module namespace:
import * as ecs from 'aws-cdk-lib/aws-ecs';
// ecs.Ec2TaskDefinitionConfiguration passed to the constructor as Ec2TaskDefinitionProps.
inferenceAcceleratorsOptionalInferenceAccelerator[]The inference accelerators to use for the containers in the task. Not supported in Fargate.
Default: - No inference accelerators.
ipcModeOptionalIpcModeThe 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
networkModeOptionalNetworkModeThe 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.
pidModeOptionalPidModeThe process namespace to use for the containers in the task. Not supported in Windows containers.
Default: - PidMode used by the task is not specified
placementConstraintsOptionalPlacementConstraint[]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.
CommonTaskDefinitionPropsenableFaultInjectionOptionalinherited from CommonTaskDefinitionPropsbooleanEnables fault injection and allows for fault injection requests to be accepted from the task's containers. Fault injection only works with tasks using the {@link NetworkMode.AWS_VPC} or {@link NetworkMode.HOST} network modes.
Default: undefined - ECS default setting is false
executionRoleOptionalinherited from CommonTaskDefinitionPropsIRoleThe 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.
familyOptionalinherited from CommonTaskDefinitionPropsstringThe name of a family that this task definition is registered to. A family groups multiple versions of a task definition.
Default: - Automatically generated name.
proxyConfigurationOptionalinherited from CommonTaskDefinitionPropsProxyConfigurationThe configuration details for the App Mesh proxy.
Default: - No proxy configuration.
taskRoleOptionalinherited from CommonTaskDefinitionPropsIRoleThe 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.
volumesOptionalinherited from CommonTaskDefinitionPropsVolume[]The list of volume definitions for the task. For more information, see [Task Definition Parameter Volumes](https://docs.aws.amazon.com/AmazonECS/latest/developerguide//task_definition_parameters.html#volumes).
Default: - No volumes are passed to the Docker daemon on a container instance.
Everything you need to know about Amazon ECS on one page. HD quality, print-friendly.
Download Free Infographicaws-ecs