TaskDefinition class
The details of a task definition which describes the container and volume definitions of an Amazon Elastic Container Service task. You can specify which Docker images to use, the required resources, and other configurations related to launching the task definition through an Amazon ECS service or task.
Constructors
-
TaskDefinition({List<
Compatibility> ? compatibilities, List<ContainerDefinition> ? containerDefinitions, String? cpu, String? executionRoleArn, String? family, List<InferenceAccelerator> ? inferenceAccelerators, IpcMode? ipcMode, String? memory, NetworkMode? networkMode, PidMode? pidMode, List<TaskDefinitionPlacementConstraint> ? placementConstraints, ProxyConfiguration? proxyConfiguration, List<Attribute> ? requiresAttributes, List<Compatibility> ? requiresCompatibilities, int? revision, TaskDefinitionStatus? status, String? taskDefinitionArn, String? taskRoleArn, List<Volume> ? volumes}) -
TaskDefinition.fromJson(Map<
String, dynamic> json) -
factory
Properties
-
compatibilities
→ List<
Compatibility> ? -
The launch type to use with your task. For more information, see Amazon
ECS Launch Types in the Amazon Elastic Container Service Developer
Guide.
final
-
containerDefinitions
→ List<
ContainerDefinition> ? -
A list of container definitions in JSON format that describe the different
containers that make up your task. For more information about container
definition parameters and defaults, see Amazon
ECS Task Definitions in the Amazon Elastic Container Service
Developer Guide.
final
- cpu → String?
-
The number of
cpu
units used by the task. 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 thememory
parameter:final - executionRoleArn → String?
-
The Amazon Resource Name (ARN) of the task execution role that grants the
Amazon ECS container agent permission to make AWS API calls on your behalf.
The task execution IAM role is required depending on the requirements of
your task. For more information, see Amazon
ECS task execution IAM role in the Amazon Elastic Container Service
Developer Guide.
final
- family → String?
-
The name of a family that this task definition is registered to. Up to 255
letters (uppercase and lowercase), numbers, hyphens, and underscores are
allowed.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
-
inferenceAccelerators
→ List<
InferenceAccelerator> ? -
The Elastic Inference accelerator associated with the task.
final
- ipcMode → IpcMode?
-
The IPC resource namespace to use for the containers in the task. The valid
values are
host
,task
, ornone
. Ifhost
is specified, then all containers within the tasks that specified thehost
IPC mode on the same container instance share the same IPC resources with the host Amazon EC2 instance. Iftask
is specified, all containers within the specified task share the same IPC resources. Ifnone
is specified, then IPC resources within the containers of a task are private and not shared with other containers in a task or on the container instance. If no value is specified, then the IPC resource namespace sharing depends on the Docker daemon setting on the container instance. For more information, see IPC settings in the Docker run reference.final - memory → String?
-
The amount (in MiB) of memory used by the task.
final
- networkMode → NetworkMode?
-
The Docker networking mode to use for the containers in the task. The valid
values are
none
,bridge
,awsvpc
, andhost
. If no network mode is specified, the default isbridge
.final - pidMode → PidMode?
-
The process namespace to use for the containers in the task. The valid
values are
host
ortask
. Ifhost
is specified, then all containers within the tasks that specified thehost
PID mode on the same container instance share the same process namespace with the host Amazon EC2 instance. Iftask
is specified, all containers within the specified task share the same process namespace. If no value is specified, the default is a private namespace. For more information, see PID settings in the Docker run reference.final -
placementConstraints
→ List<
TaskDefinitionPlacementConstraint> ? -
An array of placement constraint objects to use for tasks. This field is not
valid if you are using the Fargate launch type for your task.
final
- proxyConfiguration → ProxyConfiguration?
-
The configuration details for the App Mesh proxy.
final
-
requiresAttributes
→ List<
Attribute> ? -
The container instance attributes required by your task. This field is not
valid if you are using the Fargate launch type for your task.
final
-
requiresCompatibilities
→ List<
Compatibility> ? -
The launch type the task requires. If no value is specified, it will default
to
EC2
. Valid values includeEC2
andFARGATE
.final - revision → int?
-
The revision of the task in a particular family. The revision is a version
number of a task definition in a family. When you register a task definition
for the first time, the revision is
1
. Each time that you register a new revision of a task definition in the same family, the revision value always increases by one, even if you have deregistered previous revisions in this family.final - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- status → TaskDefinitionStatus?
-
The status of the task definition.
final
- taskDefinitionArn → String?
-
The full Amazon Resource Name (ARN) of the task definition.
final
- taskRoleArn → String?
-
The short name or full Amazon Resource Name (ARN) of the AWS Identity and
Access Management (IAM) role that grants containers in the task permission
to call AWS APIs on your behalf. For more information, see Amazon
ECS Task Role in the Amazon Elastic Container Service Developer
Guide.
final
-
volumes
→ List<
Volume> ? -
The list of volume definitions for the task.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited