AWS SDK for C++  1.8.95
AWS SDK for C++
Public Member Functions | List of all members
Aws::ECS::Model::TaskDefinition Class Reference

#include <TaskDefinition.h>

Public Member Functions

 TaskDefinition ()
 
 TaskDefinition (Aws::Utils::Json::JsonView jsonValue)
 
TaskDefinitionoperator= (Aws::Utils::Json::JsonView jsonValue)
 
Aws::Utils::Json::JsonValue Jsonize () const
 
const Aws::StringGetTaskDefinitionArn () const
 
bool TaskDefinitionArnHasBeenSet () const
 
void SetTaskDefinitionArn (const Aws::String &value)
 
void SetTaskDefinitionArn (Aws::String &&value)
 
void SetTaskDefinitionArn (const char *value)
 
TaskDefinitionWithTaskDefinitionArn (const Aws::String &value)
 
TaskDefinitionWithTaskDefinitionArn (Aws::String &&value)
 
TaskDefinitionWithTaskDefinitionArn (const char *value)
 
const Aws::Vector< ContainerDefinition > & GetContainerDefinitions () const
 
bool ContainerDefinitionsHasBeenSet () const
 
void SetContainerDefinitions (const Aws::Vector< ContainerDefinition > &value)
 
void SetContainerDefinitions (Aws::Vector< ContainerDefinition > &&value)
 
TaskDefinitionWithContainerDefinitions (const Aws::Vector< ContainerDefinition > &value)
 
TaskDefinitionWithContainerDefinitions (Aws::Vector< ContainerDefinition > &&value)
 
TaskDefinitionAddContainerDefinitions (const ContainerDefinition &value)
 
TaskDefinitionAddContainerDefinitions (ContainerDefinition &&value)
 
const Aws::StringGetFamily () const
 
bool FamilyHasBeenSet () const
 
void SetFamily (const Aws::String &value)
 
void SetFamily (Aws::String &&value)
 
void SetFamily (const char *value)
 
TaskDefinitionWithFamily (const Aws::String &value)
 
TaskDefinitionWithFamily (Aws::String &&value)
 
TaskDefinitionWithFamily (const char *value)
 
const Aws::StringGetTaskRoleArn () const
 
bool TaskRoleArnHasBeenSet () const
 
void SetTaskRoleArn (const Aws::String &value)
 
void SetTaskRoleArn (Aws::String &&value)
 
void SetTaskRoleArn (const char *value)
 
TaskDefinitionWithTaskRoleArn (const Aws::String &value)
 
TaskDefinitionWithTaskRoleArn (Aws::String &&value)
 
TaskDefinitionWithTaskRoleArn (const char *value)
 
const Aws::StringGetExecutionRoleArn () const
 
bool ExecutionRoleArnHasBeenSet () const
 
void SetExecutionRoleArn (const Aws::String &value)
 
void SetExecutionRoleArn (Aws::String &&value)
 
void SetExecutionRoleArn (const char *value)
 
TaskDefinitionWithExecutionRoleArn (const Aws::String &value)
 
TaskDefinitionWithExecutionRoleArn (Aws::String &&value)
 
TaskDefinitionWithExecutionRoleArn (const char *value)
 
const NetworkModeGetNetworkMode () const
 
bool NetworkModeHasBeenSet () const
 
void SetNetworkMode (const NetworkMode &value)
 
void SetNetworkMode (NetworkMode &&value)
 
TaskDefinitionWithNetworkMode (const NetworkMode &value)
 
TaskDefinitionWithNetworkMode (NetworkMode &&value)
 
int GetRevision () const
 
bool RevisionHasBeenSet () const
 
void SetRevision (int value)
 
TaskDefinitionWithRevision (int value)
 
const Aws::Vector< Volume > & GetVolumes () const
 
bool VolumesHasBeenSet () const
 
void SetVolumes (const Aws::Vector< Volume > &value)
 
void SetVolumes (Aws::Vector< Volume > &&value)
 
TaskDefinitionWithVolumes (const Aws::Vector< Volume > &value)
 
TaskDefinitionWithVolumes (Aws::Vector< Volume > &&value)
 
TaskDefinitionAddVolumes (const Volume &value)
 
TaskDefinitionAddVolumes (Volume &&value)
 
const TaskDefinitionStatusGetStatus () const
 
bool StatusHasBeenSet () const
 
void SetStatus (const TaskDefinitionStatus &value)
 
void SetStatus (TaskDefinitionStatus &&value)
 
TaskDefinitionWithStatus (const TaskDefinitionStatus &value)
 
TaskDefinitionWithStatus (TaskDefinitionStatus &&value)
 
const Aws::Vector< Attribute > & GetRequiresAttributes () const
 
bool RequiresAttributesHasBeenSet () const
 
void SetRequiresAttributes (const Aws::Vector< Attribute > &value)
 
void SetRequiresAttributes (Aws::Vector< Attribute > &&value)
 
TaskDefinitionWithRequiresAttributes (const Aws::Vector< Attribute > &value)
 
TaskDefinitionWithRequiresAttributes (Aws::Vector< Attribute > &&value)
 
TaskDefinitionAddRequiresAttributes (const Attribute &value)
 
TaskDefinitionAddRequiresAttributes (Attribute &&value)
 
const Aws::Vector< TaskDefinitionPlacementConstraint > & GetPlacementConstraints () const
 
bool PlacementConstraintsHasBeenSet () const
 
void SetPlacementConstraints (const Aws::Vector< TaskDefinitionPlacementConstraint > &value)
 
void SetPlacementConstraints (Aws::Vector< TaskDefinitionPlacementConstraint > &&value)
 
TaskDefinitionWithPlacementConstraints (const Aws::Vector< TaskDefinitionPlacementConstraint > &value)
 
TaskDefinitionWithPlacementConstraints (Aws::Vector< TaskDefinitionPlacementConstraint > &&value)
 
TaskDefinitionAddPlacementConstraints (const TaskDefinitionPlacementConstraint &value)
 
TaskDefinitionAddPlacementConstraints (TaskDefinitionPlacementConstraint &&value)
 
const Aws::Vector< Compatibility > & GetCompatibilities () const
 
bool CompatibilitiesHasBeenSet () const
 
void SetCompatibilities (const Aws::Vector< Compatibility > &value)
 
void SetCompatibilities (Aws::Vector< Compatibility > &&value)
 
TaskDefinitionWithCompatibilities (const Aws::Vector< Compatibility > &value)
 
TaskDefinitionWithCompatibilities (Aws::Vector< Compatibility > &&value)
 
TaskDefinitionAddCompatibilities (const Compatibility &value)
 
TaskDefinitionAddCompatibilities (Compatibility &&value)
 
const Aws::Vector< Compatibility > & GetRequiresCompatibilities () const
 
bool RequiresCompatibilitiesHasBeenSet () const
 
void SetRequiresCompatibilities (const Aws::Vector< Compatibility > &value)
 
void SetRequiresCompatibilities (Aws::Vector< Compatibility > &&value)
 
TaskDefinitionWithRequiresCompatibilities (const Aws::Vector< Compatibility > &value)
 
TaskDefinitionWithRequiresCompatibilities (Aws::Vector< Compatibility > &&value)
 
TaskDefinitionAddRequiresCompatibilities (const Compatibility &value)
 
TaskDefinitionAddRequiresCompatibilities (Compatibility &&value)
 
const Aws::StringGetCpu () const
 
bool CpuHasBeenSet () const
 
void SetCpu (const Aws::String &value)
 
void SetCpu (Aws::String &&value)
 
void SetCpu (const char *value)
 
TaskDefinitionWithCpu (const Aws::String &value)
 
TaskDefinitionWithCpu (Aws::String &&value)
 
TaskDefinitionWithCpu (const char *value)
 
const Aws::StringGetMemory () const
 
bool MemoryHasBeenSet () const
 
void SetMemory (const Aws::String &value)
 
void SetMemory (Aws::String &&value)
 
void SetMemory (const char *value)
 
TaskDefinitionWithMemory (const Aws::String &value)
 
TaskDefinitionWithMemory (Aws::String &&value)
 
TaskDefinitionWithMemory (const char *value)
 
const Aws::Vector< InferenceAccelerator > & GetInferenceAccelerators () const
 
bool InferenceAcceleratorsHasBeenSet () const
 
void SetInferenceAccelerators (const Aws::Vector< InferenceAccelerator > &value)
 
void SetInferenceAccelerators (Aws::Vector< InferenceAccelerator > &&value)
 
TaskDefinitionWithInferenceAccelerators (const Aws::Vector< InferenceAccelerator > &value)
 
TaskDefinitionWithInferenceAccelerators (Aws::Vector< InferenceAccelerator > &&value)
 
TaskDefinitionAddInferenceAccelerators (const InferenceAccelerator &value)
 
TaskDefinitionAddInferenceAccelerators (InferenceAccelerator &&value)
 
const PidModeGetPidMode () const
 
bool PidModeHasBeenSet () const
 
void SetPidMode (const PidMode &value)
 
void SetPidMode (PidMode &&value)
 
TaskDefinitionWithPidMode (const PidMode &value)
 
TaskDefinitionWithPidMode (PidMode &&value)
 
const IpcModeGetIpcMode () const
 
bool IpcModeHasBeenSet () const
 
void SetIpcMode (const IpcMode &value)
 
void SetIpcMode (IpcMode &&value)
 
TaskDefinitionWithIpcMode (const IpcMode &value)
 
TaskDefinitionWithIpcMode (IpcMode &&value)
 
const ProxyConfigurationGetProxyConfiguration () const
 
bool ProxyConfigurationHasBeenSet () const
 
void SetProxyConfiguration (const ProxyConfiguration &value)
 
void SetProxyConfiguration (ProxyConfiguration &&value)
 
TaskDefinitionWithProxyConfiguration (const ProxyConfiguration &value)
 
TaskDefinitionWithProxyConfiguration (ProxyConfiguration &&value)
 

Detailed Description

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.

See Also:

AWS API Reference

Definition at line 47 of file TaskDefinition.h.

Constructor & Destructor Documentation

◆ TaskDefinition() [1/2]

Aws::ECS::Model::TaskDefinition::TaskDefinition ( )

◆ TaskDefinition() [2/2]

Aws::ECS::Model::TaskDefinition::TaskDefinition ( Aws::Utils::Json::JsonView  jsonValue)

Member Function Documentation

◆ AddCompatibilities() [1/2]

TaskDefinition& Aws::ECS::Model::TaskDefinition::AddCompatibilities ( const Compatibility value)
inline

The launch type to use with your task. For more information, see Amazon ECS Launch Types in the Amazon Elastic Container Service Developer Guide.

Definition at line 1031 of file TaskDefinition.h.

◆ AddCompatibilities() [2/2]

TaskDefinition& Aws::ECS::Model::TaskDefinition::AddCompatibilities ( Compatibility &&  value)
inline

The launch type to use with your task. For more information, see Amazon ECS Launch Types in the Amazon Elastic Container Service Developer Guide.

Definition at line 1039 of file TaskDefinition.h.

◆ AddContainerDefinitions() [1/2]

TaskDefinition& Aws::ECS::Model::TaskDefinition::AddContainerDefinitions ( const ContainerDefinition value)
inline

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.

Definition at line 165 of file TaskDefinition.h.

◆ AddContainerDefinitions() [2/2]

TaskDefinition& Aws::ECS::Model::TaskDefinition::AddContainerDefinitions ( ContainerDefinition &&  value)
inline

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.

Definition at line 175 of file TaskDefinition.h.

◆ AddInferenceAccelerators() [1/2]

TaskDefinition& Aws::ECS::Model::TaskDefinition::AddInferenceAccelerators ( const InferenceAccelerator value)
inline

The Elastic Inference accelerator associated with the task.

Definition at line 1454 of file TaskDefinition.h.

◆ AddInferenceAccelerators() [2/2]

TaskDefinition& Aws::ECS::Model::TaskDefinition::AddInferenceAccelerators ( InferenceAccelerator &&  value)
inline

The Elastic Inference accelerator associated with the task.

Definition at line 1459 of file TaskDefinition.h.

◆ AddPlacementConstraints() [1/2]

TaskDefinition& Aws::ECS::Model::TaskDefinition::AddPlacementConstraints ( const TaskDefinitionPlacementConstraint value)
inline

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.

Definition at line 968 of file TaskDefinition.h.

◆ AddPlacementConstraints() [2/2]

TaskDefinition& Aws::ECS::Model::TaskDefinition::AddPlacementConstraints ( TaskDefinitionPlacementConstraint &&  value)
inline

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.

Definition at line 974 of file TaskDefinition.h.

◆ AddRequiresAttributes() [1/2]

TaskDefinition& Aws::ECS::Model::TaskDefinition::AddRequiresAttributes ( const Attribute value)
inline

The container instance attributes required by your task. This field is not valid if you are using the Fargate launch type for your task.

Definition at line 919 of file TaskDefinition.h.

◆ AddRequiresAttributes() [2/2]

TaskDefinition& Aws::ECS::Model::TaskDefinition::AddRequiresAttributes ( Attribute &&  value)
inline

The container instance attributes required by your task. This field is not valid if you are using the Fargate launch type for your task.

Definition at line 925 of file TaskDefinition.h.

◆ AddRequiresCompatibilities() [1/2]

TaskDefinition& Aws::ECS::Model::TaskDefinition::AddRequiresCompatibilities ( const Compatibility value)
inline

The launch type the task requires. If no value is specified, it will default to EC2. Valid values include EC2 and FARGATE.

Definition at line 1089 of file TaskDefinition.h.

◆ AddRequiresCompatibilities() [2/2]

TaskDefinition& Aws::ECS::Model::TaskDefinition::AddRequiresCompatibilities ( Compatibility &&  value)
inline

The launch type the task requires. If no value is specified, it will default to EC2. Valid values include EC2 and FARGATE.

Definition at line 1096 of file TaskDefinition.h.

◆ AddVolumes() [1/2]

TaskDefinition& Aws::ECS::Model::TaskDefinition::AddVolumes ( const Volume value)
inline

The list of volume definitions for the task.

If your tasks are using the Fargate launch type, the host and sourcePath parameters are not supported.

For more information about volume definition parameters and defaults, see Amazon ECS Task Definitions in the Amazon Elastic Container Service Developer Guide.

Definition at line 834 of file TaskDefinition.h.

◆ AddVolumes() [2/2]

TaskDefinition& Aws::ECS::Model::TaskDefinition::AddVolumes ( Volume &&  value)
inline

The list of volume definitions for the task.

If your tasks are using the Fargate launch type, the host and sourcePath parameters are not supported.

For more information about volume definition parameters and defaults, see Amazon ECS Task Definitions in the Amazon Elastic Container Service Developer Guide.

Definition at line 845 of file TaskDefinition.h.

◆ CompatibilitiesHasBeenSet()

bool Aws::ECS::Model::TaskDefinition::CompatibilitiesHasBeenSet ( ) const
inline

The launch type to use with your task. For more information, see Amazon ECS Launch Types in the Amazon Elastic Container Service Developer Guide.

Definition at line 991 of file TaskDefinition.h.

◆ ContainerDefinitionsHasBeenSet()

bool Aws::ECS::Model::TaskDefinition::ContainerDefinitionsHasBeenSet ( ) const
inline

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.

Definition at line 115 of file TaskDefinition.h.

◆ CpuHasBeenSet()

bool Aws::ECS::Model::TaskDefinition::CpuHasBeenSet ( ) const
inline

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 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)

Definition at line 1133 of file TaskDefinition.h.

◆ ExecutionRoleArnHasBeenSet()

bool Aws::ECS::Model::TaskDefinition::ExecutionRoleArnHasBeenSet ( ) const
inline

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.

Definition at line 408 of file TaskDefinition.h.

◆ FamilyHasBeenSet()

bool Aws::ECS::Model::TaskDefinition::FamilyHasBeenSet ( ) const
inline

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.

A family groups multiple versions of a task definition. Amazon ECS gives the first task definition that you registered to a family a revision number of 1. Amazon ECS gives sequential revision numbers to each task definition that you add.

Definition at line 196 of file TaskDefinition.h.

◆ GetCompatibilities()

const Aws::Vector<Compatibility>& Aws::ECS::Model::TaskDefinition::GetCompatibilities ( ) const
inline

The launch type to use with your task. For more information, see Amazon ECS Launch Types in the Amazon Elastic Container Service Developer Guide.

Definition at line 983 of file TaskDefinition.h.

◆ GetContainerDefinitions()

const Aws::Vector<ContainerDefinition>& Aws::ECS::Model::TaskDefinition::GetContainerDefinitions ( ) const
inline

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.

Definition at line 105 of file TaskDefinition.h.

◆ GetCpu()

const Aws::String& Aws::ECS::Model::TaskDefinition::GetCpu ( ) const
inline

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 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)

Definition at line 1115 of file TaskDefinition.h.

◆ GetExecutionRoleArn()

const Aws::String& Aws::ECS::Model::TaskDefinition::GetExecutionRoleArn ( ) const
inline

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.

Definition at line 397 of file TaskDefinition.h.

◆ GetFamily()

const Aws::String& Aws::ECS::Model::TaskDefinition::GetFamily ( ) const
inline

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.

A family groups multiple versions of a task definition. Amazon ECS gives the first task definition that you registered to a family a revision number of 1. Amazon ECS gives sequential revision numbers to each task definition that you add.

Definition at line 186 of file TaskDefinition.h.

◆ GetInferenceAccelerators()

const Aws::Vector<InferenceAccelerator>& Aws::ECS::Model::TaskDefinition::GetInferenceAccelerators ( ) const
inline

The Elastic Inference accelerator associated with the task.

Definition at line 1424 of file TaskDefinition.h.

◆ GetIpcMode()

const IpcMode& Aws::ECS::Model::TaskDefinition::GetIpcMode ( ) const
inline

The IPC resource namespace to use for the containers in the task. The valid values are host, task, or none. If host is specified, then all containers within the tasks that specified the host IPC mode on the same container instance share the same IPC resources with the host Amazon EC2 instance. If task is specified, all containers within the specified task share the same IPC resources. If none 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.

If the host IPC mode is used, be aware that there is a heightened risk of undesired IPC namespace expose. For more information, see Docker security.

If you are setting namespaced kernel parameters using systemControls for the containers in the task, the following will apply to your IPC resource namespace. For more information, see System Controls in the Amazon Elastic Container Service Developer Guide.

  • For tasks that use the host IPC mode, IPC namespace related systemControls are not supported.

  • For tasks that use the task IPC mode, IPC namespace related systemControls will apply to all containers within a task.

This parameter is not supported for Windows containers or tasks using the Fargate launch type.

Definition at line 1600 of file TaskDefinition.h.

◆ GetMemory()

const Aws::String& Aws::ECS::Model::TaskDefinition::GetMemory ( ) const
inline

The amount (in MiB) of memory used by the task.

If using the EC2 launch type, you must specify either a task-level memory value or a container-level memory value. This field is optional and any value can be used. If a task-level memory value is specified then the container-level memory value is optional. For more information regarding container-level memory and memory reservation, see ContainerDefinition.

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)

Definition at line 1264 of file TaskDefinition.h.

◆ GetNetworkMode()

const NetworkMode& Aws::ECS::Model::TaskDefinition::GetNetworkMode ( ) const
inline

The Docker networking mode to use for the containers in the task. The valid values are none, bridge, awsvpc, and host. If no network mode is specified, the default is bridge.

For Amazon ECS tasks on Fargate, the awsvpc network mode is required. For Amazon ECS tasks on Amazon EC2 instances, any network mode can be used. If the network mode is set to none, you cannot specify port mappings in your container definitions, and the tasks containers do not have external connectivity. The host and awsvpc network modes offer the highest networking performance for containers because they use the EC2 network stack instead of the virtualized network stack provided by the bridge mode.

With the host and awsvpc network modes, exposed container ports are mapped directly to the corresponding host port (for the host network mode) or the attached elastic network interface port (for the awsvpc network mode), so you cannot take advantage of dynamic host port mappings.

When using the host network mode, you should not run containers using the root user (UID 0). It is considered best practice to use a non-root user.

If the network mode is awsvpc, the task is allocated an elastic network interface, and you must specify a NetworkConfiguration value when you create a service or run a task with the task definition. For more information, see Task Networking in the Amazon Elastic Container Service Developer Guide.

Currently, only Amazon ECS-optimized AMIs, other Amazon Linux variants with the ecs-init package, or AWS Fargate infrastructure support the awsvpc network mode.

If the network mode is host, you cannot run multiple instantiations of the same task on a single container instance when port mappings are used.

Docker for Windows uses different network modes than Docker for Linux. When you register a task definition with Windows containers, you must not specify a network mode. If you use the console to register a task definition with Windows containers, you must choose the <default> network mode object.

For more information, see Network settings in the Docker run reference.

Definition at line 515 of file TaskDefinition.h.

◆ GetPidMode()

const PidMode& Aws::ECS::Model::TaskDefinition::GetPidMode ( ) const
inline

The process namespace to use for the containers in the task. The valid values are host or task. If host is specified, then all containers within the tasks that specified the host PID mode on the same container instance share the same process namespace with the host Amazon EC2 instance. If task 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.

If the host PID mode is used, be aware that there is a heightened risk of undesired process namespace expose. For more information, see Docker security.

This parameter is not supported for Windows containers or tasks using the Fargate launch type.

Definition at line 1478 of file TaskDefinition.h.

◆ GetPlacementConstraints()

const Aws::Vector<TaskDefinitionPlacementConstraint>& Aws::ECS::Model::TaskDefinition::GetPlacementConstraints ( ) const
inline

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.

Definition at line 932 of file TaskDefinition.h.

◆ GetProxyConfiguration()

const ProxyConfiguration& Aws::ECS::Model::TaskDefinition::GetProxyConfiguration ( ) const
inline

The configuration details for the App Mesh proxy.

Your Amazon ECS container instances require at least version 1.26.0 of the container agent and at least version 1.26.0-1 of the ecs-init package to enable a proxy configuration. If your container instances are launched from the Amazon ECS-optimized AMI version 20190301 or later, then they contain the required versions of the container agent and ecs-init. For more information, see Amazon ECS-optimized Linux AMI in the Amazon Elastic Container Service Developer Guide.

Definition at line 1770 of file TaskDefinition.h.

◆ GetRequiresAttributes()

const Aws::Vector<Attribute>& Aws::ECS::Model::TaskDefinition::GetRequiresAttributes ( ) const
inline

The container instance attributes required by your task. This field is not valid if you are using the Fargate launch type for your task.

Definition at line 883 of file TaskDefinition.h.

◆ GetRequiresCompatibilities()

const Aws::Vector<Compatibility>& Aws::ECS::Model::TaskDefinition::GetRequiresCompatibilities ( ) const
inline

The launch type the task requires. If no value is specified, it will default to EC2. Valid values include EC2 and FARGATE.

Definition at line 1047 of file TaskDefinition.h.

◆ GetRevision()

int Aws::ECS::Model::TaskDefinition::GetRevision ( ) const
inline

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.

Definition at line 726 of file TaskDefinition.h.

◆ GetStatus()

const TaskDefinitionStatus& Aws::ECS::Model::TaskDefinition::GetStatus ( ) const
inline

The status of the task definition.

Definition at line 851 of file TaskDefinition.h.

◆ GetTaskDefinitionArn()

const Aws::String& Aws::ECS::Model::TaskDefinition::GetTaskDefinitionArn ( ) const
inline

The full Amazon Resource Name (ARN) of the task definition.

Definition at line 59 of file TaskDefinition.h.

◆ GetTaskRoleArn()

const Aws::String& Aws::ECS::Model::TaskDefinition::GetTaskRoleArn ( ) const
inline

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.

IAM roles for tasks on Windows require that the -EnableTaskIAMRole option is set when you launch the Amazon ECS-optimized Windows AMI. Your containers must also run some configuration code in order to take advantage of the feature. For more information, see Windows IAM Roles for Tasks in the Amazon Elastic Container Service Developer Guide.

Definition at line 273 of file TaskDefinition.h.

◆ GetVolumes()

const Aws::Vector<Volume>& Aws::ECS::Model::TaskDefinition::GetVolumes ( ) const
inline

The list of volume definitions for the task.

If your tasks are using the Fargate launch type, the host and sourcePath parameters are not supported.

For more information about volume definition parameters and defaults, see Amazon ECS Task Definitions in the Amazon Elastic Container Service Developer Guide.

Definition at line 768 of file TaskDefinition.h.

◆ InferenceAcceleratorsHasBeenSet()

bool Aws::ECS::Model::TaskDefinition::InferenceAcceleratorsHasBeenSet ( ) const
inline

The Elastic Inference accelerator associated with the task.

Definition at line 1429 of file TaskDefinition.h.

◆ IpcModeHasBeenSet()

bool Aws::ECS::Model::TaskDefinition::IpcModeHasBeenSet ( ) const
inline

The IPC resource namespace to use for the containers in the task. The valid values are host, task, or none. If host is specified, then all containers within the tasks that specified the host IPC mode on the same container instance share the same IPC resources with the host Amazon EC2 instance. If task is specified, all containers within the specified task share the same IPC resources. If none 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.

If the host IPC mode is used, be aware that there is a heightened risk of undesired IPC namespace expose. For more information, see Docker security.

If you are setting namespaced kernel parameters using systemControls for the containers in the task, the following will apply to your IPC resource namespace. For more information, see System Controls in the Amazon Elastic Container Service Developer Guide.

  • For tasks that use the host IPC mode, IPC namespace related systemControls are not supported.

  • For tasks that use the task IPC mode, IPC namespace related systemControls will apply to all containers within a task.

This parameter is not supported for Windows containers or tasks using the Fargate launch type.

Definition at line 1631 of file TaskDefinition.h.

◆ Jsonize()

Aws::Utils::Json::JsonValue Aws::ECS::Model::TaskDefinition::Jsonize ( ) const

◆ MemoryHasBeenSet()

bool Aws::ECS::Model::TaskDefinition::MemoryHasBeenSet ( ) const
inline

The amount (in MiB) of memory used by the task.

If using the EC2 launch type, you must specify either a task-level memory value or a container-level memory value. This field is optional and any value can be used. If a task-level memory value is specified then the container-level memory value is optional. For more information regarding container-level memory and memory reservation, see ContainerDefinition.

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)

Definition at line 1286 of file TaskDefinition.h.

◆ NetworkModeHasBeenSet()

bool Aws::ECS::Model::TaskDefinition::NetworkModeHasBeenSet ( ) const
inline

The Docker networking mode to use for the containers in the task. The valid values are none, bridge, awsvpc, and host. If no network mode is specified, the default is bridge.

For Amazon ECS tasks on Fargate, the awsvpc network mode is required. For Amazon ECS tasks on Amazon EC2 instances, any network mode can be used. If the network mode is set to none, you cannot specify port mappings in your container definitions, and the tasks containers do not have external connectivity. The host and awsvpc network modes offer the highest networking performance for containers because they use the EC2 network stack instead of the virtualized network stack provided by the bridge mode.

With the host and awsvpc network modes, exposed container ports are mapped directly to the corresponding host port (for the host network mode) or the attached elastic network interface port (for the awsvpc network mode), so you cannot take advantage of dynamic host port mappings.

When using the host network mode, you should not run containers using the root user (UID 0). It is considered best practice to use a non-root user.

If the network mode is awsvpc, the task is allocated an elastic network interface, and you must specify a NetworkConfiguration value when you create a service or run a task with the task definition. For more information, see Task Networking in the Amazon Elastic Container Service Developer Guide.

Currently, only Amazon ECS-optimized AMIs, other Amazon Linux variants with the ecs-init package, or AWS Fargate infrastructure support the awsvpc network mode.

If the network mode is host, you cannot run multiple instantiations of the same task on a single container instance when port mappings are used.

Docker for Windows uses different network modes than Docker for Linux. When you register a task definition with Windows containers, you must not specify a network mode. If you use the console to register a task definition with Windows containers, you must choose the <default> network mode object.

For more information, see Network settings in the Docker run reference.

Definition at line 555 of file TaskDefinition.h.

◆ operator=()

TaskDefinition& Aws::ECS::Model::TaskDefinition::operator= ( Aws::Utils::Json::JsonView  jsonValue)

◆ PidModeHasBeenSet()

bool Aws::ECS::Model::TaskDefinition::PidModeHasBeenSet ( ) const
inline

The process namespace to use for the containers in the task. The valid values are host or task. If host is specified, then all containers within the tasks that specified the host PID mode on the same container instance share the same process namespace with the host Amazon EC2 instance. If task 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.

If the host PID mode is used, be aware that there is a heightened risk of undesired process namespace expose. For more information, see Docker security.

This parameter is not supported for Windows containers or tasks using the Fargate launch type.

Definition at line 1496 of file TaskDefinition.h.

◆ PlacementConstraintsHasBeenSet()

bool Aws::ECS::Model::TaskDefinition::PlacementConstraintsHasBeenSet ( ) const
inline

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.

Definition at line 938 of file TaskDefinition.h.

◆ ProxyConfigurationHasBeenSet()

bool Aws::ECS::Model::TaskDefinition::ProxyConfigurationHasBeenSet ( ) const
inline

The configuration details for the App Mesh proxy.

Your Amazon ECS container instances require at least version 1.26.0 of the container agent and at least version 1.26.0-1 of the ecs-init package to enable a proxy configuration. If your container instances are launched from the Amazon ECS-optimized AMI version 20190301 or later, then they contain the required versions of the container agent and ecs-init. For more information, see Amazon ECS-optimized Linux AMI in the Amazon Elastic Container Service Developer Guide.

Definition at line 1784 of file TaskDefinition.h.

◆ RequiresAttributesHasBeenSet()

bool Aws::ECS::Model::TaskDefinition::RequiresAttributesHasBeenSet ( ) const
inline

The container instance attributes required by your task. This field is not valid if you are using the Fargate launch type for your task.

Definition at line 889 of file TaskDefinition.h.

◆ RequiresCompatibilitiesHasBeenSet()

bool Aws::ECS::Model::TaskDefinition::RequiresCompatibilitiesHasBeenSet ( ) const
inline

The launch type the task requires. If no value is specified, it will default to EC2. Valid values include EC2 and FARGATE.

Definition at line 1054 of file TaskDefinition.h.

◆ RevisionHasBeenSet()

bool Aws::ECS::Model::TaskDefinition::RevisionHasBeenSet ( ) const
inline

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.

Definition at line 736 of file TaskDefinition.h.

◆ SetCompatibilities() [1/2]

void Aws::ECS::Model::TaskDefinition::SetCompatibilities ( const Aws::Vector< Compatibility > &  value)
inline

The launch type to use with your task. For more information, see Amazon ECS Launch Types in the Amazon Elastic Container Service Developer Guide.

Definition at line 999 of file TaskDefinition.h.

◆ SetCompatibilities() [2/2]

void Aws::ECS::Model::TaskDefinition::SetCompatibilities ( Aws::Vector< Compatibility > &&  value)
inline

The launch type to use with your task. For more information, see Amazon ECS Launch Types in the Amazon Elastic Container Service Developer Guide.

Definition at line 1007 of file TaskDefinition.h.

◆ SetContainerDefinitions() [1/2]

void Aws::ECS::Model::TaskDefinition::SetContainerDefinitions ( const Aws::Vector< ContainerDefinition > &  value)
inline

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.

Definition at line 125 of file TaskDefinition.h.

◆ SetContainerDefinitions() [2/2]

void Aws::ECS::Model::TaskDefinition::SetContainerDefinitions ( Aws::Vector< ContainerDefinition > &&  value)
inline

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.

Definition at line 135 of file TaskDefinition.h.

◆ SetCpu() [1/3]

void Aws::ECS::Model::TaskDefinition::SetCpu ( const Aws::String value)
inline

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 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)

Definition at line 1151 of file TaskDefinition.h.

◆ SetCpu() [2/3]

void Aws::ECS::Model::TaskDefinition::SetCpu ( Aws::String &&  value)
inline

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 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)

Definition at line 1169 of file TaskDefinition.h.

◆ SetCpu() [3/3]

void Aws::ECS::Model::TaskDefinition::SetCpu ( const char *  value)
inline

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 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)

Definition at line 1187 of file TaskDefinition.h.

◆ SetExecutionRoleArn() [1/3]

void Aws::ECS::Model::TaskDefinition::SetExecutionRoleArn ( const Aws::String value)
inline

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.

Definition at line 419 of file TaskDefinition.h.

◆ SetExecutionRoleArn() [2/3]

void Aws::ECS::Model::TaskDefinition::SetExecutionRoleArn ( Aws::String &&  value)
inline

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.

Definition at line 430 of file TaskDefinition.h.

◆ SetExecutionRoleArn() [3/3]

void Aws::ECS::Model::TaskDefinition::SetExecutionRoleArn ( const char *  value)
inline

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.

Definition at line 441 of file TaskDefinition.h.

◆ SetFamily() [1/3]

void Aws::ECS::Model::TaskDefinition::SetFamily ( const Aws::String value)
inline

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.

A family groups multiple versions of a task definition. Amazon ECS gives the first task definition that you registered to a family a revision number of 1. Amazon ECS gives sequential revision numbers to each task definition that you add.

Definition at line 206 of file TaskDefinition.h.

◆ SetFamily() [2/3]

void Aws::ECS::Model::TaskDefinition::SetFamily ( Aws::String &&  value)
inline

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.

A family groups multiple versions of a task definition. Amazon ECS gives the first task definition that you registered to a family a revision number of 1. Amazon ECS gives sequential revision numbers to each task definition that you add.

Definition at line 216 of file TaskDefinition.h.

◆ SetFamily() [3/3]

void Aws::ECS::Model::TaskDefinition::SetFamily ( const char *  value)
inline

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.

A family groups multiple versions of a task definition. Amazon ECS gives the first task definition that you registered to a family a revision number of 1. Amazon ECS gives sequential revision numbers to each task definition that you add.

Definition at line 226 of file TaskDefinition.h.

◆ SetInferenceAccelerators() [1/2]

void Aws::ECS::Model::TaskDefinition::SetInferenceAccelerators ( const Aws::Vector< InferenceAccelerator > &  value)
inline

The Elastic Inference accelerator associated with the task.

Definition at line 1434 of file TaskDefinition.h.

◆ SetInferenceAccelerators() [2/2]

void Aws::ECS::Model::TaskDefinition::SetInferenceAccelerators ( Aws::Vector< InferenceAccelerator > &&  value)
inline

The Elastic Inference accelerator associated with the task.

Definition at line 1439 of file TaskDefinition.h.

◆ SetIpcMode() [1/2]

void Aws::ECS::Model::TaskDefinition::SetIpcMode ( const IpcMode value)
inline

The IPC resource namespace to use for the containers in the task. The valid values are host, task, or none. If host is specified, then all containers within the tasks that specified the host IPC mode on the same container instance share the same IPC resources with the host Amazon EC2 instance. If task is specified, all containers within the specified task share the same IPC resources. If none 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.

If the host IPC mode is used, be aware that there is a heightened risk of undesired IPC namespace expose. For more information, see Docker security.

If you are setting namespaced kernel parameters using systemControls for the containers in the task, the following will apply to your IPC resource namespace. For more information, see System Controls in the Amazon Elastic Container Service Developer Guide.

  • For tasks that use the host IPC mode, IPC namespace related systemControls are not supported.

  • For tasks that use the task IPC mode, IPC namespace related systemControls will apply to all containers within a task.

This parameter is not supported for Windows containers or tasks using the Fargate launch type.

Definition at line 1662 of file TaskDefinition.h.

◆ SetIpcMode() [2/2]

void Aws::ECS::Model::TaskDefinition::SetIpcMode ( IpcMode &&  value)
inline

The IPC resource namespace to use for the containers in the task. The valid values are host, task, or none. If host is specified, then all containers within the tasks that specified the host IPC mode on the same container instance share the same IPC resources with the host Amazon EC2 instance. If task is specified, all containers within the specified task share the same IPC resources. If none 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.

If the host IPC mode is used, be aware that there is a heightened risk of undesired IPC namespace expose. For more information, see Docker security.

If you are setting namespaced kernel parameters using systemControls for the containers in the task, the following will apply to your IPC resource namespace. For more information, see System Controls in the Amazon Elastic Container Service Developer Guide.

  • For tasks that use the host IPC mode, IPC namespace related systemControls are not supported.

  • For tasks that use the task IPC mode, IPC namespace related systemControls will apply to all containers within a task.

This parameter is not supported for Windows containers or tasks using the Fargate launch type.

Definition at line 1693 of file TaskDefinition.h.

◆ SetMemory() [1/3]

void Aws::ECS::Model::TaskDefinition::SetMemory ( const Aws::String value)
inline

The amount (in MiB) of memory used by the task.

If using the EC2 launch type, you must specify either a task-level memory value or a container-level memory value. This field is optional and any value can be used. If a task-level memory value is specified then the container-level memory value is optional. For more information regarding container-level memory and memory reservation, see ContainerDefinition.

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)

Definition at line 1308 of file TaskDefinition.h.

◆ SetMemory() [2/3]

void Aws::ECS::Model::TaskDefinition::SetMemory ( Aws::String &&  value)
inline

The amount (in MiB) of memory used by the task.

If using the EC2 launch type, you must specify either a task-level memory value or a container-level memory value. This field is optional and any value can be used. If a task-level memory value is specified then the container-level memory value is optional. For more information regarding container-level memory and memory reservation, see ContainerDefinition.

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)

Definition at line 1330 of file TaskDefinition.h.

◆ SetMemory() [3/3]

void Aws::ECS::Model::TaskDefinition::SetMemory ( const char *  value)
inline

The amount (in MiB) of memory used by the task.

If using the EC2 launch type, you must specify either a task-level memory value or a container-level memory value. This field is optional and any value can be used. If a task-level memory value is specified then the container-level memory value is optional. For more information regarding container-level memory and memory reservation, see ContainerDefinition.

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)

Definition at line 1352 of file TaskDefinition.h.

◆ SetNetworkMode() [1/2]

void Aws::ECS::Model::TaskDefinition::SetNetworkMode ( const NetworkMode value)
inline

The Docker networking mode to use for the containers in the task. The valid values are none, bridge, awsvpc, and host. If no network mode is specified, the default is bridge.

For Amazon ECS tasks on Fargate, the awsvpc network mode is required. For Amazon ECS tasks on Amazon EC2 instances, any network mode can be used. If the network mode is set to none, you cannot specify port mappings in your container definitions, and the tasks containers do not have external connectivity. The host and awsvpc network modes offer the highest networking performance for containers because they use the EC2 network stack instead of the virtualized network stack provided by the bridge mode.

With the host and awsvpc network modes, exposed container ports are mapped directly to the corresponding host port (for the host network mode) or the attached elastic network interface port (for the awsvpc network mode), so you cannot take advantage of dynamic host port mappings.

When using the host network mode, you should not run containers using the root user (UID 0). It is considered best practice to use a non-root user.

If the network mode is awsvpc, the task is allocated an elastic network interface, and you must specify a NetworkConfiguration value when you create a service or run a task with the task definition. For more information, see Task Networking in the Amazon Elastic Container Service Developer Guide.

Currently, only Amazon ECS-optimized AMIs, other Amazon Linux variants with the ecs-init package, or AWS Fargate infrastructure support the awsvpc network mode.

If the network mode is host, you cannot run multiple instantiations of the same task on a single container instance when port mappings are used.

Docker for Windows uses different network modes than Docker for Linux. When you register a task definition with Windows containers, you must not specify a network mode. If you use the console to register a task definition with Windows containers, you must choose the <default> network mode object.

For more information, see Network settings in the Docker run reference.

Definition at line 595 of file TaskDefinition.h.

◆ SetNetworkMode() [2/2]

void Aws::ECS::Model::TaskDefinition::SetNetworkMode ( NetworkMode &&  value)
inline

The Docker networking mode to use for the containers in the task. The valid values are none, bridge, awsvpc, and host. If no network mode is specified, the default is bridge.

For Amazon ECS tasks on Fargate, the awsvpc network mode is required. For Amazon ECS tasks on Amazon EC2 instances, any network mode can be used. If the network mode is set to none, you cannot specify port mappings in your container definitions, and the tasks containers do not have external connectivity. The host and awsvpc network modes offer the highest networking performance for containers because they use the EC2 network stack instead of the virtualized network stack provided by the bridge mode.

With the host and awsvpc network modes, exposed container ports are mapped directly to the corresponding host port (for the host network mode) or the attached elastic network interface port (for the awsvpc network mode), so you cannot take advantage of dynamic host port mappings.

When using the host network mode, you should not run containers using the root user (UID 0). It is considered best practice to use a non-root user.

If the network mode is awsvpc, the task is allocated an elastic network interface, and you must specify a NetworkConfiguration value when you create a service or run a task with the task definition. For more information, see Task Networking in the Amazon Elastic Container Service Developer Guide.

Currently, only Amazon ECS-optimized AMIs, other Amazon Linux variants with the ecs-init package, or AWS Fargate infrastructure support the awsvpc network mode.

If the network mode is host, you cannot run multiple instantiations of the same task on a single container instance when port mappings are used.

Docker for Windows uses different network modes than Docker for Linux. When you register a task definition with Windows containers, you must not specify a network mode. If you use the console to register a task definition with Windows containers, you must choose the <default> network mode object.

For more information, see Network settings in the Docker run reference.

Definition at line 635 of file TaskDefinition.h.

◆ SetPidMode() [1/2]

void Aws::ECS::Model::TaskDefinition::SetPidMode ( const PidMode value)
inline

The process namespace to use for the containers in the task. The valid values are host or task. If host is specified, then all containers within the tasks that specified the host PID mode on the same container instance share the same process namespace with the host Amazon EC2 instance. If task 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.

If the host PID mode is used, be aware that there is a heightened risk of undesired process namespace expose. For more information, see Docker security.

This parameter is not supported for Windows containers or tasks using the Fargate launch type.

Definition at line 1514 of file TaskDefinition.h.

◆ SetPidMode() [2/2]

void Aws::ECS::Model::TaskDefinition::SetPidMode ( PidMode &&  value)
inline

The process namespace to use for the containers in the task. The valid values are host or task. If host is specified, then all containers within the tasks that specified the host PID mode on the same container instance share the same process namespace with the host Amazon EC2 instance. If task 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.

If the host PID mode is used, be aware that there is a heightened risk of undesired process namespace expose. For more information, see Docker security.

This parameter is not supported for Windows containers or tasks using the Fargate launch type.

Definition at line 1532 of file TaskDefinition.h.

◆ SetPlacementConstraints() [1/2]

void Aws::ECS::Model::TaskDefinition::SetPlacementConstraints ( const Aws::Vector< TaskDefinitionPlacementConstraint > &  value)
inline

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.

Definition at line 944 of file TaskDefinition.h.

◆ SetPlacementConstraints() [2/2]

void Aws::ECS::Model::TaskDefinition::SetPlacementConstraints ( Aws::Vector< TaskDefinitionPlacementConstraint > &&  value)
inline

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.

Definition at line 950 of file TaskDefinition.h.

◆ SetProxyConfiguration() [1/2]

void Aws::ECS::Model::TaskDefinition::SetProxyConfiguration ( const ProxyConfiguration value)
inline

The configuration details for the App Mesh proxy.

Your Amazon ECS container instances require at least version 1.26.0 of the container agent and at least version 1.26.0-1 of the ecs-init package to enable a proxy configuration. If your container instances are launched from the Amazon ECS-optimized AMI version 20190301 or later, then they contain the required versions of the container agent and ecs-init. For more information, see Amazon ECS-optimized Linux AMI in the Amazon Elastic Container Service Developer Guide.

Definition at line 1798 of file TaskDefinition.h.

◆ SetProxyConfiguration() [2/2]

void Aws::ECS::Model::TaskDefinition::SetProxyConfiguration ( ProxyConfiguration &&  value)
inline

The configuration details for the App Mesh proxy.

Your Amazon ECS container instances require at least version 1.26.0 of the container agent and at least version 1.26.0-1 of the ecs-init package to enable a proxy configuration. If your container instances are launched from the Amazon ECS-optimized AMI version 20190301 or later, then they contain the required versions of the container agent and ecs-init. For more information, see Amazon ECS-optimized Linux AMI in the Amazon Elastic Container Service Developer Guide.

Definition at line 1812 of file TaskDefinition.h.

◆ SetRequiresAttributes() [1/2]

void Aws::ECS::Model::TaskDefinition::SetRequiresAttributes ( const Aws::Vector< Attribute > &  value)
inline

The container instance attributes required by your task. This field is not valid if you are using the Fargate launch type for your task.

Definition at line 895 of file TaskDefinition.h.

◆ SetRequiresAttributes() [2/2]

void Aws::ECS::Model::TaskDefinition::SetRequiresAttributes ( Aws::Vector< Attribute > &&  value)
inline

The container instance attributes required by your task. This field is not valid if you are using the Fargate launch type for your task.

Definition at line 901 of file TaskDefinition.h.

◆ SetRequiresCompatibilities() [1/2]

void Aws::ECS::Model::TaskDefinition::SetRequiresCompatibilities ( const Aws::Vector< Compatibility > &  value)
inline

The launch type the task requires. If no value is specified, it will default to EC2. Valid values include EC2 and FARGATE.

Definition at line 1061 of file TaskDefinition.h.

◆ SetRequiresCompatibilities() [2/2]

void Aws::ECS::Model::TaskDefinition::SetRequiresCompatibilities ( Aws::Vector< Compatibility > &&  value)
inline

The launch type the task requires. If no value is specified, it will default to EC2. Valid values include EC2 and FARGATE.

Definition at line 1068 of file TaskDefinition.h.

◆ SetRevision()

void Aws::ECS::Model::TaskDefinition::SetRevision ( int  value)
inline

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.

Definition at line 746 of file TaskDefinition.h.

◆ SetStatus() [1/2]

void Aws::ECS::Model::TaskDefinition::SetStatus ( const TaskDefinitionStatus value)
inline

The status of the task definition.

Definition at line 861 of file TaskDefinition.h.

◆ SetStatus() [2/2]

void Aws::ECS::Model::TaskDefinition::SetStatus ( TaskDefinitionStatus &&  value)
inline

The status of the task definition.

Definition at line 866 of file TaskDefinition.h.

◆ SetTaskDefinitionArn() [1/3]

void Aws::ECS::Model::TaskDefinition::SetTaskDefinitionArn ( const Aws::String value)
inline

The full Amazon Resource Name (ARN) of the task definition.

Definition at line 69 of file TaskDefinition.h.

◆ SetTaskDefinitionArn() [2/3]

void Aws::ECS::Model::TaskDefinition::SetTaskDefinitionArn ( Aws::String &&  value)
inline

The full Amazon Resource Name (ARN) of the task definition.

Definition at line 74 of file TaskDefinition.h.

◆ SetTaskDefinitionArn() [3/3]

void Aws::ECS::Model::TaskDefinition::SetTaskDefinitionArn ( const char *  value)
inline

The full Amazon Resource Name (ARN) of the task definition.

Definition at line 79 of file TaskDefinition.h.

◆ SetTaskRoleArn() [1/3]

void Aws::ECS::Model::TaskDefinition::SetTaskRoleArn ( const Aws::String value)
inline

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.

IAM roles for tasks on Windows require that the -EnableTaskIAMRole option is set when you launch the Amazon ECS-optimized Windows AMI. Your containers must also run some configuration code in order to take advantage of the feature. For more information, see Windows IAM Roles for Tasks in the Amazon Elastic Container Service Developer Guide.

Definition at line 305 of file TaskDefinition.h.

◆ SetTaskRoleArn() [2/3]

void Aws::ECS::Model::TaskDefinition::SetTaskRoleArn ( Aws::String &&  value)
inline

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.

IAM roles for tasks on Windows require that the -EnableTaskIAMRole option is set when you launch the Amazon ECS-optimized Windows AMI. Your containers must also run some configuration code in order to take advantage of the feature. For more information, see Windows IAM Roles for Tasks in the Amazon Elastic Container Service Developer Guide.

Definition at line 321 of file TaskDefinition.h.

◆ SetTaskRoleArn() [3/3]

void Aws::ECS::Model::TaskDefinition::SetTaskRoleArn ( const char *  value)
inline

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.

IAM roles for tasks on Windows require that the -EnableTaskIAMRole option is set when you launch the Amazon ECS-optimized Windows AMI. Your containers must also run some configuration code in order to take advantage of the feature. For more information, see Windows IAM Roles for Tasks in the Amazon Elastic Container Service Developer Guide.

Definition at line 337 of file TaskDefinition.h.

◆ SetVolumes() [1/2]

void Aws::ECS::Model::TaskDefinition::SetVolumes ( const Aws::Vector< Volume > &  value)
inline

The list of volume definitions for the task.

If your tasks are using the Fargate launch type, the host and sourcePath parameters are not supported.

For more information about volume definition parameters and defaults, see Amazon ECS Task Definitions in the Amazon Elastic Container Service Developer Guide.

Definition at line 790 of file TaskDefinition.h.

◆ SetVolumes() [2/2]

void Aws::ECS::Model::TaskDefinition::SetVolumes ( Aws::Vector< Volume > &&  value)
inline

The list of volume definitions for the task.

If your tasks are using the Fargate launch type, the host and sourcePath parameters are not supported.

For more information about volume definition parameters and defaults, see Amazon ECS Task Definitions in the Amazon Elastic Container Service Developer Guide.

Definition at line 801 of file TaskDefinition.h.

◆ StatusHasBeenSet()

bool Aws::ECS::Model::TaskDefinition::StatusHasBeenSet ( ) const
inline

The status of the task definition.

Definition at line 856 of file TaskDefinition.h.

◆ TaskDefinitionArnHasBeenSet()

bool Aws::ECS::Model::TaskDefinition::TaskDefinitionArnHasBeenSet ( ) const
inline

The full Amazon Resource Name (ARN) of the task definition.

Definition at line 64 of file TaskDefinition.h.

◆ TaskRoleArnHasBeenSet()

bool Aws::ECS::Model::TaskDefinition::TaskRoleArnHasBeenSet ( ) const
inline

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.

IAM roles for tasks on Windows require that the -EnableTaskIAMRole option is set when you launch the Amazon ECS-optimized Windows AMI. Your containers must also run some configuration code in order to take advantage of the feature. For more information, see Windows IAM Roles for Tasks in the Amazon Elastic Container Service Developer Guide.

Definition at line 289 of file TaskDefinition.h.

◆ VolumesHasBeenSet()

bool Aws::ECS::Model::TaskDefinition::VolumesHasBeenSet ( ) const
inline

The list of volume definitions for the task.

If your tasks are using the Fargate launch type, the host and sourcePath parameters are not supported.

For more information about volume definition parameters and defaults, see Amazon ECS Task Definitions in the Amazon Elastic Container Service Developer Guide.

Definition at line 779 of file TaskDefinition.h.

◆ WithCompatibilities() [1/2]

TaskDefinition& Aws::ECS::Model::TaskDefinition::WithCompatibilities ( const Aws::Vector< Compatibility > &  value)
inline

The launch type to use with your task. For more information, see Amazon ECS Launch Types in the Amazon Elastic Container Service Developer Guide.

Definition at line 1015 of file TaskDefinition.h.

◆ WithCompatibilities() [2/2]

TaskDefinition& Aws::ECS::Model::TaskDefinition::WithCompatibilities ( Aws::Vector< Compatibility > &&  value)
inline

The launch type to use with your task. For more information, see Amazon ECS Launch Types in the Amazon Elastic Container Service Developer Guide.

Definition at line 1023 of file TaskDefinition.h.

◆ WithContainerDefinitions() [1/2]

TaskDefinition& Aws::ECS::Model::TaskDefinition::WithContainerDefinitions ( const Aws::Vector< ContainerDefinition > &  value)
inline

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.

Definition at line 145 of file TaskDefinition.h.

◆ WithContainerDefinitions() [2/2]

TaskDefinition& Aws::ECS::Model::TaskDefinition::WithContainerDefinitions ( Aws::Vector< ContainerDefinition > &&  value)
inline

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.

Definition at line 155 of file TaskDefinition.h.

◆ WithCpu() [1/3]

TaskDefinition& Aws::ECS::Model::TaskDefinition::WithCpu ( const Aws::String value)
inline

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 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)

Definition at line 1205 of file TaskDefinition.h.

◆ WithCpu() [2/3]

TaskDefinition& Aws::ECS::Model::TaskDefinition::WithCpu ( Aws::String &&  value)
inline

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 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)

Definition at line 1223 of file TaskDefinition.h.

◆ WithCpu() [3/3]

TaskDefinition& Aws::ECS::Model::TaskDefinition::WithCpu ( const char *  value)
inline

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 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)

Definition at line 1241 of file TaskDefinition.h.

◆ WithExecutionRoleArn() [1/3]

TaskDefinition& Aws::ECS::Model::TaskDefinition::WithExecutionRoleArn ( const Aws::String value)
inline

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.

Definition at line 452 of file TaskDefinition.h.

◆ WithExecutionRoleArn() [2/3]

TaskDefinition& Aws::ECS::Model::TaskDefinition::WithExecutionRoleArn ( Aws::String &&  value)
inline

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.

Definition at line 463 of file TaskDefinition.h.

◆ WithExecutionRoleArn() [3/3]

TaskDefinition& Aws::ECS::Model::TaskDefinition::WithExecutionRoleArn ( const char *  value)
inline

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.

Definition at line 474 of file TaskDefinition.h.

◆ WithFamily() [1/3]

TaskDefinition& Aws::ECS::Model::TaskDefinition::WithFamily ( const Aws::String value)
inline

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.

A family groups multiple versions of a task definition. Amazon ECS gives the first task definition that you registered to a family a revision number of 1. Amazon ECS gives sequential revision numbers to each task definition that you add.

Definition at line 236 of file TaskDefinition.h.

◆ WithFamily() [2/3]

TaskDefinition& Aws::ECS::Model::TaskDefinition::WithFamily ( Aws::String &&  value)
inline

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.

A family groups multiple versions of a task definition. Amazon ECS gives the first task definition that you registered to a family a revision number of 1. Amazon ECS gives sequential revision numbers to each task definition that you add.

Definition at line 246 of file TaskDefinition.h.

◆ WithFamily() [3/3]

TaskDefinition& Aws::ECS::Model::TaskDefinition::WithFamily ( const char *  value)
inline

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.

A family groups multiple versions of a task definition. Amazon ECS gives the first task definition that you registered to a family a revision number of 1. Amazon ECS gives sequential revision numbers to each task definition that you add.

Definition at line 256 of file TaskDefinition.h.

◆ WithInferenceAccelerators() [1/2]

TaskDefinition& Aws::ECS::Model::TaskDefinition::WithInferenceAccelerators ( const Aws::Vector< InferenceAccelerator > &  value)
inline

The Elastic Inference accelerator associated with the task.

Definition at line 1444 of file TaskDefinition.h.

◆ WithInferenceAccelerators() [2/2]

TaskDefinition& Aws::ECS::Model::TaskDefinition::WithInferenceAccelerators ( Aws::Vector< InferenceAccelerator > &&  value)
inline

The Elastic Inference accelerator associated with the task.

Definition at line 1449 of file TaskDefinition.h.

◆ WithIpcMode() [1/2]

TaskDefinition& Aws::ECS::Model::TaskDefinition::WithIpcMode ( const IpcMode value)
inline

The IPC resource namespace to use for the containers in the task. The valid values are host, task, or none. If host is specified, then all containers within the tasks that specified the host IPC mode on the same container instance share the same IPC resources with the host Amazon EC2 instance. If task is specified, all containers within the specified task share the same IPC resources. If none 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.

If the host IPC mode is used, be aware that there is a heightened risk of undesired IPC namespace expose. For more information, see Docker security.

If you are setting namespaced kernel parameters using systemControls for the containers in the task, the following will apply to your IPC resource namespace. For more information, see System Controls in the Amazon Elastic Container Service Developer Guide.

  • For tasks that use the host IPC mode, IPC namespace related systemControls are not supported.

  • For tasks that use the task IPC mode, IPC namespace related systemControls will apply to all containers within a task.

This parameter is not supported for Windows containers or tasks using the Fargate launch type.

Definition at line 1724 of file TaskDefinition.h.

◆ WithIpcMode() [2/2]

TaskDefinition& Aws::ECS::Model::TaskDefinition::WithIpcMode ( IpcMode &&  value)
inline

The IPC resource namespace to use for the containers in the task. The valid values are host, task, or none. If host is specified, then all containers within the tasks that specified the host IPC mode on the same container instance share the same IPC resources with the host Amazon EC2 instance. If task is specified, all containers within the specified task share the same IPC resources. If none 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.

If the host IPC mode is used, be aware that there is a heightened risk of undesired IPC namespace expose. For more information, see Docker security.

If you are setting namespaced kernel parameters using systemControls for the containers in the task, the following will apply to your IPC resource namespace. For more information, see System Controls in the Amazon Elastic Container Service Developer Guide.

  • For tasks that use the host IPC mode, IPC namespace related systemControls are not supported.

  • For tasks that use the task IPC mode, IPC namespace related systemControls will apply to all containers within a task.

This parameter is not supported for Windows containers or tasks using the Fargate launch type.

Definition at line 1755 of file TaskDefinition.h.

◆ WithMemory() [1/3]

TaskDefinition& Aws::ECS::Model::TaskDefinition::WithMemory ( const Aws::String value)
inline

The amount (in MiB) of memory used by the task.

If using the EC2 launch type, you must specify either a task-level memory value or a container-level memory value. This field is optional and any value can be used. If a task-level memory value is specified then the container-level memory value is optional. For more information regarding container-level memory and memory reservation, see ContainerDefinition.

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)

Definition at line 1374 of file TaskDefinition.h.

◆ WithMemory() [2/3]

TaskDefinition& Aws::ECS::Model::TaskDefinition::WithMemory ( Aws::String &&  value)
inline

The amount (in MiB) of memory used by the task.

If using the EC2 launch type, you must specify either a task-level memory value or a container-level memory value. This field is optional and any value can be used. If a task-level memory value is specified then the container-level memory value is optional. For more information regarding container-level memory and memory reservation, see ContainerDefinition.

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)

Definition at line 1396 of file TaskDefinition.h.

◆ WithMemory() [3/3]

TaskDefinition& Aws::ECS::Model::TaskDefinition::WithMemory ( const char *  value)
inline

The amount (in MiB) of memory used by the task.

If using the EC2 launch type, you must specify either a task-level memory value or a container-level memory value. This field is optional and any value can be used. If a task-level memory value is specified then the container-level memory value is optional. For more information regarding container-level memory and memory reservation, see ContainerDefinition.

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)

Definition at line 1418 of file TaskDefinition.h.

◆ WithNetworkMode() [1/2]

TaskDefinition& Aws::ECS::Model::TaskDefinition::WithNetworkMode ( const NetworkMode value)
inline

The Docker networking mode to use for the containers in the task. The valid values are none, bridge, awsvpc, and host. If no network mode is specified, the default is bridge.

For Amazon ECS tasks on Fargate, the awsvpc network mode is required. For Amazon ECS tasks on Amazon EC2 instances, any network mode can be used. If the network mode is set to none, you cannot specify port mappings in your container definitions, and the tasks containers do not have external connectivity. The host and awsvpc network modes offer the highest networking performance for containers because they use the EC2 network stack instead of the virtualized network stack provided by the bridge mode.

With the host and awsvpc network modes, exposed container ports are mapped directly to the corresponding host port (for the host network mode) or the attached elastic network interface port (for the awsvpc network mode), so you cannot take advantage of dynamic host port mappings.

When using the host network mode, you should not run containers using the root user (UID 0). It is considered best practice to use a non-root user.

If the network mode is awsvpc, the task is allocated an elastic network interface, and you must specify a NetworkConfiguration value when you create a service or run a task with the task definition. For more information, see Task Networking in the Amazon Elastic Container Service Developer Guide.

Currently, only Amazon ECS-optimized AMIs, other Amazon Linux variants with the ecs-init package, or AWS Fargate infrastructure support the awsvpc network mode.

If the network mode is host, you cannot run multiple instantiations of the same task on a single container instance when port mappings are used.

Docker for Windows uses different network modes than Docker for Linux. When you register a task definition with Windows containers, you must not specify a network mode. If you use the console to register a task definition with Windows containers, you must choose the <default> network mode object.

For more information, see Network settings in the Docker run reference.

Definition at line 675 of file TaskDefinition.h.

◆ WithNetworkMode() [2/2]

TaskDefinition& Aws::ECS::Model::TaskDefinition::WithNetworkMode ( NetworkMode &&  value)
inline

The Docker networking mode to use for the containers in the task. The valid values are none, bridge, awsvpc, and host. If no network mode is specified, the default is bridge.

For Amazon ECS tasks on Fargate, the awsvpc network mode is required. For Amazon ECS tasks on Amazon EC2 instances, any network mode can be used. If the network mode is set to none, you cannot specify port mappings in your container definitions, and the tasks containers do not have external connectivity. The host and awsvpc network modes offer the highest networking performance for containers because they use the EC2 network stack instead of the virtualized network stack provided by the bridge mode.

With the host and awsvpc network modes, exposed container ports are mapped directly to the corresponding host port (for the host network mode) or the attached elastic network interface port (for the awsvpc network mode), so you cannot take advantage of dynamic host port mappings.

When using the host network mode, you should not run containers using the root user (UID 0). It is considered best practice to use a non-root user.

If the network mode is awsvpc, the task is allocated an elastic network interface, and you must specify a NetworkConfiguration value when you create a service or run a task with the task definition. For more information, see Task Networking in the Amazon Elastic Container Service Developer Guide.

Currently, only Amazon ECS-optimized AMIs, other Amazon Linux variants with the ecs-init package, or AWS Fargate infrastructure support the awsvpc network mode.

If the network mode is host, you cannot run multiple instantiations of the same task on a single container instance when port mappings are used.

Docker for Windows uses different network modes than Docker for Linux. When you register a task definition with Windows containers, you must not specify a network mode. If you use the console to register a task definition with Windows containers, you must choose the <default> network mode object.

For more information, see Network settings in the Docker run reference.

Definition at line 715 of file TaskDefinition.h.

◆ WithPidMode() [1/2]

TaskDefinition& Aws::ECS::Model::TaskDefinition::WithPidMode ( const PidMode value)
inline

The process namespace to use for the containers in the task. The valid values are host or task. If host is specified, then all containers within the tasks that specified the host PID mode on the same container instance share the same process namespace with the host Amazon EC2 instance. If task 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.

If the host PID mode is used, be aware that there is a heightened risk of undesired process namespace expose. For more information, see Docker security.

This parameter is not supported for Windows containers or tasks using the Fargate launch type.

Definition at line 1550 of file TaskDefinition.h.

◆ WithPidMode() [2/2]

TaskDefinition& Aws::ECS::Model::TaskDefinition::WithPidMode ( PidMode &&  value)
inline

The process namespace to use for the containers in the task. The valid values are host or task. If host is specified, then all containers within the tasks that specified the host PID mode on the same container instance share the same process namespace with the host Amazon EC2 instance. If task 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.

If the host PID mode is used, be aware that there is a heightened risk of undesired process namespace expose. For more information, see Docker security.

This parameter is not supported for Windows containers or tasks using the Fargate launch type.

Definition at line 1568 of file TaskDefinition.h.

◆ WithPlacementConstraints() [1/2]

TaskDefinition& Aws::ECS::Model::TaskDefinition::WithPlacementConstraints ( const Aws::Vector< TaskDefinitionPlacementConstraint > &  value)
inline

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.

Definition at line 956 of file TaskDefinition.h.

◆ WithPlacementConstraints() [2/2]

TaskDefinition& Aws::ECS::Model::TaskDefinition::WithPlacementConstraints ( Aws::Vector< TaskDefinitionPlacementConstraint > &&  value)
inline

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.

Definition at line 962 of file TaskDefinition.h.

◆ WithProxyConfiguration() [1/2]

TaskDefinition& Aws::ECS::Model::TaskDefinition::WithProxyConfiguration ( const ProxyConfiguration value)
inline

The configuration details for the App Mesh proxy.

Your Amazon ECS container instances require at least version 1.26.0 of the container agent and at least version 1.26.0-1 of the ecs-init package to enable a proxy configuration. If your container instances are launched from the Amazon ECS-optimized AMI version 20190301 or later, then they contain the required versions of the container agent and ecs-init. For more information, see Amazon ECS-optimized Linux AMI in the Amazon Elastic Container Service Developer Guide.

Definition at line 1826 of file TaskDefinition.h.

◆ WithProxyConfiguration() [2/2]

TaskDefinition& Aws::ECS::Model::TaskDefinition::WithProxyConfiguration ( ProxyConfiguration &&  value)
inline

The configuration details for the App Mesh proxy.

Your Amazon ECS container instances require at least version 1.26.0 of the container agent and at least version 1.26.0-1 of the ecs-init package to enable a proxy configuration. If your container instances are launched from the Amazon ECS-optimized AMI version 20190301 or later, then they contain the required versions of the container agent and ecs-init. For more information, see Amazon ECS-optimized Linux AMI in the Amazon Elastic Container Service Developer Guide.

Definition at line 1840 of file TaskDefinition.h.

◆ WithRequiresAttributes() [1/2]

TaskDefinition& Aws::ECS::Model::TaskDefinition::WithRequiresAttributes ( const Aws::Vector< Attribute > &  value)
inline

The container instance attributes required by your task. This field is not valid if you are using the Fargate launch type for your task.

Definition at line 907 of file TaskDefinition.h.

◆ WithRequiresAttributes() [2/2]

TaskDefinition& Aws::ECS::Model::TaskDefinition::WithRequiresAttributes ( Aws::Vector< Attribute > &&  value)
inline

The container instance attributes required by your task. This field is not valid if you are using the Fargate launch type for your task.

Definition at line 913 of file TaskDefinition.h.

◆ WithRequiresCompatibilities() [1/2]

TaskDefinition& Aws::ECS::Model::TaskDefinition::WithRequiresCompatibilities ( const Aws::Vector< Compatibility > &  value)
inline

The launch type the task requires. If no value is specified, it will default to EC2. Valid values include EC2 and FARGATE.

Definition at line 1075 of file TaskDefinition.h.

◆ WithRequiresCompatibilities() [2/2]

TaskDefinition& Aws::ECS::Model::TaskDefinition::WithRequiresCompatibilities ( Aws::Vector< Compatibility > &&  value)
inline

The launch type the task requires. If no value is specified, it will default to EC2. Valid values include EC2 and FARGATE.

Definition at line 1082 of file TaskDefinition.h.

◆ WithRevision()

TaskDefinition& Aws::ECS::Model::TaskDefinition::WithRevision ( int  value)
inline

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.

Definition at line 756 of file TaskDefinition.h.

◆ WithStatus() [1/2]

TaskDefinition& Aws::ECS::Model::TaskDefinition::WithStatus ( const TaskDefinitionStatus value)
inline

The status of the task definition.

Definition at line 871 of file TaskDefinition.h.

◆ WithStatus() [2/2]

TaskDefinition& Aws::ECS::Model::TaskDefinition::WithStatus ( TaskDefinitionStatus &&  value)
inline

The status of the task definition.

Definition at line 876 of file TaskDefinition.h.

◆ WithTaskDefinitionArn() [1/3]

TaskDefinition& Aws::ECS::Model::TaskDefinition::WithTaskDefinitionArn ( const Aws::String value)
inline

The full Amazon Resource Name (ARN) of the task definition.

Definition at line 84 of file TaskDefinition.h.

◆ WithTaskDefinitionArn() [2/3]

TaskDefinition& Aws::ECS::Model::TaskDefinition::WithTaskDefinitionArn ( Aws::String &&  value)
inline

The full Amazon Resource Name (ARN) of the task definition.

Definition at line 89 of file TaskDefinition.h.

◆ WithTaskDefinitionArn() [3/3]

TaskDefinition& Aws::ECS::Model::TaskDefinition::WithTaskDefinitionArn ( const char *  value)
inline

The full Amazon Resource Name (ARN) of the task definition.

Definition at line 94 of file TaskDefinition.h.

◆ WithTaskRoleArn() [1/3]

TaskDefinition& Aws::ECS::Model::TaskDefinition::WithTaskRoleArn ( const Aws::String value)
inline

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.

IAM roles for tasks on Windows require that the -EnableTaskIAMRole option is set when you launch the Amazon ECS-optimized Windows AMI. Your containers must also run some configuration code in order to take advantage of the feature. For more information, see Windows IAM Roles for Tasks in the Amazon Elastic Container Service Developer Guide.

Definition at line 353 of file TaskDefinition.h.

◆ WithTaskRoleArn() [2/3]

TaskDefinition& Aws::ECS::Model::TaskDefinition::WithTaskRoleArn ( Aws::String &&  value)
inline

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.

IAM roles for tasks on Windows require that the -EnableTaskIAMRole option is set when you launch the Amazon ECS-optimized Windows AMI. Your containers must also run some configuration code in order to take advantage of the feature. For more information, see Windows IAM Roles for Tasks in the Amazon Elastic Container Service Developer Guide.

Definition at line 369 of file TaskDefinition.h.

◆ WithTaskRoleArn() [3/3]

TaskDefinition& Aws::ECS::Model::TaskDefinition::WithTaskRoleArn ( const char *  value)
inline

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.

IAM roles for tasks on Windows require that the -EnableTaskIAMRole option is set when you launch the Amazon ECS-optimized Windows AMI. Your containers must also run some configuration code in order to take advantage of the feature. For more information, see Windows IAM Roles for Tasks in the Amazon Elastic Container Service Developer Guide.

Definition at line 385 of file TaskDefinition.h.

◆ WithVolumes() [1/2]

TaskDefinition& Aws::ECS::Model::TaskDefinition::WithVolumes ( const Aws::Vector< Volume > &  value)
inline

The list of volume definitions for the task.

If your tasks are using the Fargate launch type, the host and sourcePath parameters are not supported.

For more information about volume definition parameters and defaults, see Amazon ECS Task Definitions in the Amazon Elastic Container Service Developer Guide.

Definition at line 812 of file TaskDefinition.h.

◆ WithVolumes() [2/2]

TaskDefinition& Aws::ECS::Model::TaskDefinition::WithVolumes ( Aws::Vector< Volume > &&  value)
inline

The list of volume definitions for the task.

If your tasks are using the Fargate launch type, the host and sourcePath parameters are not supported.

For more information about volume definition parameters and defaults, see Amazon ECS Task Definitions in the Amazon Elastic Container Service Developer Guide.

Definition at line 823 of file TaskDefinition.h.


The documentation for this class was generated from the following file: