TaskDefinition
ecs.services.k8s.aws/v1alpha1
Type | Link |
---|---|
GoDoc | ecs-controller/apis/v1alpha1#TaskDefinition |
Metadata
Property | Value |
---|---|
Scope | Namespaced |
Kind | TaskDefinition |
ListKind | TaskDefinitionList |
Plural | taskdefinitions |
Singular | taskdefinition |
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.
Spec
containerDefinitions:
command:
- string
cpu: integer
credentialSpecs:
- string
dependsOn:
- condition: string
containerName: string
disableNetworking: boolean
dnsSearchDomains:
- string
dnsServers:
- string
dockerLabels: {}
dockerSecurityOptions:
- string
entryPoint:
- string
environment:
- name: string
value: string
environmentFiles:
- type: string
value: string
essential: boolean
extraHosts:
- hostname: string
ipAddress: string
firelensConfiguration:
options: {}
type: string
healthCheck:
command:
- string
interval: integer
retries: integer
startPeriod: integer
timeout: integer
hostname: string
image: string
interactive: boolean
links:
- string
linuxParameters:
capabilities:
add:
- string
drop:
- string
devices:
- containerPath: string
hostPath: string
permissions:
- string
initProcessEnabled: boolean
maxSwap: integer
sharedMemorySize: integer
swappiness: integer
tmpfs:
- containerPath: string
mountOptions:
- string
size: integer
logConfiguration:
logDriver: string
options: {}
secretOptions:
- name: string
valueFrom: string
memory: integer
memoryReservation: integer
mountPoints:
- containerPath: string
readOnly: boolean
sourceVolume: string
name: string
portMappings:
- appProtocol: string
containerPort: integer
containerPortRange: string
hostPort: integer
name: string
protocol: string
privileged: boolean
pseudoTerminal: boolean
readonlyRootFilesystem: boolean
repositoryCredentials:
credentialsParameter: string
resourceRequirements:
- type: string
value: string
secrets:
- name: string
valueFrom: string
startTimeout: integer
stopTimeout: integer
systemControls:
- namespace: string
value: string
ulimits:
- hardLimit: integer
name: string
softLimit: integer
user: string
volumesFrom:
- readOnly: boolean
sourceContainer: string
workingDirectory: string
cpu: string
ephemeralStorage:
sizeInGiB: integer
executionRoleARN: string
family: string
inferenceAccelerators:
- deviceName: string
deviceType: string
ipcMode: string
memory: string
networkMode: string
pidMode: string
placementConstraints:
- expression: string
type: string
proxyConfiguration:
containerName: string
properties:
- name: string
value: string
type: string
requiresCompatibilities:
- string
runtimePlatform:
cpuArchitecture: string
operatingSystemFamily: string
tags:
- key: string
value: string
taskRoleARN: string
taskRoleRef:
from:
name: string
namespace: string
volumes:
- configuredAtLaunch: boolean
dockerVolumeConfiguration:
autoprovision: boolean
driver: string
driverOpts: {}
labels: {}
scope: string
efsVolumeConfiguration:
authorizationConfig:
accessPointID: string
iam: string
fileSystemID: string
rootDirectory: string
transitEncryption: string
transitEncryptionPort: integer
fsxWindowsFileServerVolumeConfiguration:
authorizationConfig:
credentialsParameter: string
domain: string
fileSystemID: string
rootDirectory: string
host:
sourcePath: string
name: string
Field | Description |
---|---|
containerDefinitions Required | array A list of container definitions in JSON format that describe the different containers that make up your task. |
containerDefinitions.[] Required | object Container definitions are used in task definitions to describe the different |
containers that are launched as part of a task. | |
containerDefinitions.[].command.[] Required | string |
containerDefinitions.[].credentialSpecs Optional | array |
containerDefinitions.[].credentialSpecs.[] Required | string |
containerDefinitions.[].dependsOn.[] Required | object The dependencies defined for container startup and shutdown. A container |
can contain multiple dependencies. When a dependency is defined for container | |
startup, for container shutdown it is reversed. |
Your Amazon ECS container instances require at least version 1.26.0 of the container agent to use container dependencies. However, we recommend using the latest container agent version. For information about checking your agent version and updating to the latest version, see Updating the Amazon ECS Container Agent (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-agent-update.html) in the Amazon Elastic Container Service Developer Guide. If you’re using an Amazon ECS-optimized Linux AMI, your instance needs at least version 1.26.0-1 of the ecs-init package. If your container instances are launched from 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 (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-optimized_AMI.html) in the Amazon Elastic Container Service Developer Guide.
For tasks that use the Fargate launch type, the task or service requires the following platforms:
Linux platform version 1.3.0 or later.
Windows platform version 1.0.0 or later.
For more information about how to create a container dependency, see Container
dependency (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/example_task_definitions.html#example_task_definition-containerdependency)
in the Amazon Elastic Container Service Developer Guide. || containerDefinitions.[].dependsOn.[].condition
Optional | string
|
| containerDefinitions.[].dependsOn.[].containerName
Optional | string
|
| containerDefinitions.[].disableNetworking
Optional | boolean
|
| containerDefinitions.[].dnsSearchDomains
Optional | array
|
| containerDefinitions.[].dnsSearchDomains.[]
Required | string
|| containerDefinitions.[].dnsServers
Optional | array
|
| containerDefinitions.[].dnsServers.[]
Required | string
|| containerDefinitions.[].dockerLabels
Optional | object
|
| containerDefinitions.[].dockerSecurityOptions
Optional | array
|
| containerDefinitions.[].dockerSecurityOptions.[]
Required | string
|| containerDefinitions.[].entryPoint
Optional | array
|
| containerDefinitions.[].entryPoint.[]
Required | string
|| containerDefinitions.[].environment
Optional | array
|
| containerDefinitions.[].environment.[]
Required | object
A key-value pair object. || containerDefinitions.[].environment.[].name
Optional | string
|
| containerDefinitions.[].environment.[].value
Optional | string
|
| containerDefinitions.[].environmentFiles
Optional | array
|
| containerDefinitions.[].environmentFiles.[]
Required | object
A list of files containing the environment variables to pass to a container.
You can specify up to ten environment files. The file must have a .env file
extension. Each line in an environment file should contain an environment
variable in VARIABLE=VALUE format. Lines beginning with # are treated as
comments and are ignored.
If there are environment variables specified using the environment parameter in a container definition, they take precedence over the variables contained within an environment file. If multiple environment files are specified that contain the same variable, they’re processed from the top down. We recommend that you use unique variable names. For more information, see Specifying environment variables (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/taskdef-envfiles.html) in the Amazon Elastic Container Service Developer Guide.
You must use the following platforms for the Fargate launch type:
Linux platform version 1.4.0 or later.
Windows platform version 1.0.0 or later.
Consider the following when using the Fargate launch type:
The file is handled like a native Docker env-file.
There is no support for shell escape handling.
The container entry point interperts the VARIABLE values. || containerDefinitions.[].environmentFiles.[].type
Optional | string
| | containerDefinitions.[].environmentFiles.[].value
Optional | string
| | containerDefinitions.[].essential
Optional | boolean
| | containerDefinitions.[].extraHosts
Optional | array
| | containerDefinitions.[].extraHosts.[]
Required | object
Hostnames and IP address entries that are added to the /etc/hosts file of a container via the extraHosts parameter of its ContainerDefinition. || containerDefinitions.[].extraHosts.[].hostname
Optional | string
| | containerDefinitions.[].extraHosts.[].ipAddress
Optional | string
| | containerDefinitions.[].firelensConfiguration
Optional | object
The FireLens configuration for the container. This is used to specify and
configure a log router for container logs. For more information, see Custom
log routing (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/using_firelens.html)
in the Amazon Elastic Container Service Developer Guide. | | containerDefinitions.[].firelensConfiguration.options
Optional | object
| | containerDefinitions.[].firelensConfiguration.type
Optional | string
| | containerDefinitions.[].healthCheck
Optional | object
An object representing a container health check. Health check parameters
that are specified in a container definition override any Docker health checks
that exist in the container image (such as those specified in a parent image
or from the image’s Dockerfile). This configuration maps to the HEALTHCHECK
parameter of docker run (https://docs.docker.com/engine/reference/run/).
The Amazon ECS container agent only monitors and reports on the health checks
specified in the task definition. Amazon ECS does not monitor Docker health
checks that are embedded in a container image and not specified in the container
definition. Health check parameters that are specified in a container definition
override any Docker health checks that exist in the container image.
You can view the health status of both individual containers and a task with
the DescribeTasks API operation or when viewing the task details in the console.
The health check is designed to make sure that your containers survive agent
restarts, upgrades, or temporary unavailability.
The following describes the possible healthStatus values for a container:
* HEALTHY-The container health check has passed successfully.
* UNHEALTHY-The container health check has failed.
* UNKNOWN-The container health check is being evaluated, there’s no container
health check defined, or Amazon ECS doesn’t have the health status of
the container.
The following describes the possible healthStatus values based on the container
health checker status of essential containers in the task with the following
priority order (high to low):
* UNHEALTHY-One or more essential containers have failed their health
check.
* UNKNOWN-Any essential container running within the task is in an UNKNOWN
state and no other essential containers have an UNHEALTHY state.
* HEALTHY-All essential containers within the task have passed their health
checks.
Consider the following task health example with 2 containers.
* If Container1 is UNHEALTHY and Container2 is UNKNOWN, the task health
is UNHEALTHY.
* If Container1 is UNHEALTHY and Container2 is HEALTHY, the task health
is UNHEALTHY.
* If Container1 is HEALTHY and Container2 is UNKNOWN, the task health
is UNKNOWN.
* If Container1 is HEALTHY and Container2 is HEALTHY, the task health
is HEALTHY.
Consider the following task health example with 3 containers.
* If Container1 is UNHEALTHY and Container2 is UNKNOWN, and Container3
is UNKNOWN, the task health is UNHEALTHY.
* If Container1 is UNHEALTHY and Container2 is UNKNOWN, and Container3
is HEALTHY, the task health is UNHEALTHY.
* If Container1 is UNHEALTHY and Container2 is HEALTHY, and Container3
is HEALTHY, the task health is UNHEALTHY.
* If Container1 is HEALTHY and Container2 is UNKNOWN, and Container3 is
HEALTHY, the task health is UNKNOWN.
* If Container1 is HEALTHY and Container2 is UNKNOWN, and Container3 is
UNKNOWN, the task health is UNKNOWN.
* If Container1 is HEALTHY and Container2 is HEALTHY, and Container3 is
HEALTHY, the task health is HEALTHY.
If a task is run manually, and not as part of a service, the task will continue
its lifecycle regardless of its health status. For tasks that are part of
a service, if the task reports as unhealthy then the task will be stopped
and the service scheduler will replace it.
The following are notes about container health check support:
* When the Amazon ECS agent cannot connect to the Amazon ECS service,
the service reports the container as UNHEALTHY.
* The health check statuses are the “last heard from” response from the
Amazon ECS agent. There are no assumptions made about the status of the
container health checks.
* Container health checks require version 1.17.0 or greater of the Amazon
ECS container agent. For more information, see Updating the Amazon ECS
container agent (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-agent-update.html).
* Container health checks are supported for Fargate tasks if you’re using
platform version 1.1.0 or greater. For more information, see Fargate platform
versions (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/platform_versions.html).
* Container health checks aren’t supported for tasks that are part of
a service that’s configured to use a Classic Load Balancer. | | containerDefinitions.[].healthCheck.command
Optional | array
| | containerDefinitions.[].healthCheck.command.[]
Required | string
|| containerDefinitions.[].healthCheck.interval
Optional | integer
| | containerDefinitions.[].healthCheck.retries
Optional | integer
| | containerDefinitions.[].healthCheck.startPeriod
Optional | integer
| | containerDefinitions.[].healthCheck.timeout
Optional | integer
| | containerDefinitions.[].hostname
Optional | string
| | containerDefinitions.[].image
Optional | string
| | containerDefinitions.[].interactive
Optional | boolean
| | containerDefinitions.[].links
Optional | array
| | containerDefinitions.[].links.[]
Required | string
|| containerDefinitions.[].linuxParameters
Optional | object
The Linux-specific options that are applied to the container, such as Linux
KernelCapabilities (https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_KernelCapabilities.html). | | containerDefinitions.[].linuxParameters.capabilities
Optional | object
The Linux capabilities for the container that are added to or dropped from
the default configuration provided by Docker. For more information about
the default capabilities and the non-default available capabilities, see
Runtime privilege and Linux capabilities (https://docs.docker.com/engine/reference/run/#runtime-privilege-and-linux-capabilities)
in the Docker run reference. For more detailed information about these Linux
capabilities, see the capabilities(7) (http://man7.org/linux/man-pages/man7/capabilities.7.html)
Linux manual page. | | containerDefinitions.[].linuxParameters.capabilities.add
Optional | array
| | containerDefinitions.[].linuxParameters.capabilities.add.[]
Required | string
|| containerDefinitions.[].linuxParameters.capabilities.drop
Optional | array
| | containerDefinitions.[].linuxParameters.capabilities.drop.[]
Required | string
|| containerDefinitions.[].linuxParameters.devices
Optional | array
| | containerDefinitions.[].linuxParameters.devices.[]
Required | object
An object representing a container instance host device. || containerDefinitions.[].linuxParameters.devices.[].containerPath
Optional | string
| | containerDefinitions.[].linuxParameters.devices.[].hostPath
Optional | string
| | containerDefinitions.[].linuxParameters.devices.[].permissions
Optional | array
| | containerDefinitions.[].linuxParameters.devices.[].permissions.[]
Required | string
|| containerDefinitions.[].linuxParameters.initProcessEnabled
Optional | boolean
| | containerDefinitions.[].linuxParameters.maxSwap
Optional | integer
| | containerDefinitions.[].linuxParameters.sharedMemorySize
Optional | integer
| | containerDefinitions.[].linuxParameters.swappiness
Optional | integer
| | containerDefinitions.[].linuxParameters.tmpfs
Optional | array
| | containerDefinitions.[].linuxParameters.tmpfs.[]
Required | object
The container path, mount options, and size of the tmpfs mount. || containerDefinitions.[].linuxParameters.tmpfs.[].containerPath
Optional | string
| | containerDefinitions.[].linuxParameters.tmpfs.[].mountOptions
Optional | array
| | containerDefinitions.[].linuxParameters.tmpfs.[].mountOptions.[]
Required | string
|| containerDefinitions.[].linuxParameters.tmpfs.[].size
Optional | integer
| | containerDefinitions.[].logConfiguration
Optional | object
The log configuration for the container. This parameter maps to LogConfig
in the Create a container (https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate)
section of the Docker Remote API (https://docs.docker.com/engine/api/v1.35/)
and the –log-driver option to docker run (https://docs.docker.com/engine/reference/commandline/run/).
By default, containers use the same logging driver that the Docker daemon
uses. However, the container might use a different logging driver than the
Docker daemon by specifying a log driver configuration in the container definition.
For more information about the options for different supported log drivers,
see Configure logging drivers (https://docs.docker.com/engine/admin/logging/overview/)
in the Docker documentation.
Understand the following when specifying a log configuration for your containers.
* Amazon ECS currently supports a subset of the logging drivers available
to the Docker daemon. Additional log drivers may be available in future
releases of the Amazon ECS container agent. For tasks on Fargate, the
supported log drivers are awslogs, splunk, and awsfirelens. For tasks
hosted on Amazon EC2 instances, the supported log drivers are awslogs,
fluentd, gelf, json-file, journald, logentries,syslog, splunk, and awsfirelens.
* This parameter requires version 1.18 of the Docker Remote API or greater
on your container instance.
* For tasks that are hosted on Amazon EC2 instances, the Amazon ECS container
agent must register the available logging drivers with the ECS_AVAILABLE_LOGGING_DRIVERS
environment variable before containers placed on that instance can use
these log configuration options. For more information, see Amazon ECS
container agent configuration (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-agent-config.html)
in the Amazon Elastic Container Service Developer Guide.
* For tasks that are on Fargate, because you don’t have access to the
underlying infrastructure your tasks are hosted on, any additional software
needed must be installed outside of the task. For example, the Fluentd
output aggregators or a remote host running Logstash to send Gelf logs
to. | | containerDefinitions.[].logConfiguration.logDriver
Optional | string
| | containerDefinitions.[].logConfiguration.options
Optional | object
| | containerDefinitions.[].logConfiguration.secretOptions
Optional | array
| | containerDefinitions.[].logConfiguration.secretOptions.[]
Required | object
An object representing the secret to expose to your container. Secrets can be exposed to a container in the following ways:To inject sensitive data into your containers as environment variables, use the secrets container definition parameter.
To reference sensitive information in the log configuration of a container, use the secretOptions container definition parameter.
For more information, see Specifying sensitive data (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/specifying-sensitive-data.html)
in the Amazon Elastic Container Service Developer Guide. || containerDefinitions.[].logConfiguration.secretOptions.[].name
Optional | string
|
| containerDefinitions.[].logConfiguration.secretOptions.[].valueFrom
Optional | string
|
| containerDefinitions.[].memory
Optional | integer
|
| containerDefinitions.[].memoryReservation
Optional | integer
|
| containerDefinitions.[].mountPoints
Optional | array
|
| containerDefinitions.[].mountPoints.[]
Required | object
The details for a volume mount point that’s used in a container definition. || containerDefinitions.[].mountPoints.[].containerPath
Optional | string
|
| containerDefinitions.[].mountPoints.[].readOnly
Optional | boolean
|
| containerDefinitions.[].mountPoints.[].sourceVolume
Optional | string
|
| containerDefinitions.[].name
Optional | string
|
| containerDefinitions.[].portMappings
Optional | array
|
| containerDefinitions.[].portMappings.[]
Required | object
Port mappings allow containers to access ports on the host container instance
to send or receive traffic. Port mappings are specified as part of the container
definition.
If you use containers in a task with the awsvpc or host network mode, specify the exposed ports using containerPort. The hostPort can be left blank or it must be the same value as the containerPort.
Most fields of this parameter (containerPort, hostPort, protocol) maps to PortBindings in the Create a container (https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) section of the Docker Remote API (https://docs.docker.com/engine/api/v1.35/) and the –publish option to docker run (https://docs.docker.com/engine/reference/commandline/run/). If the network mode of a task definition is set to host, host ports must either be undefined or match the container port in the port mapping.
You can’t expose the same container port for multiple protocols. If you attempt this, an error is returned.
After a task reaches the RUNNING status, manual and automatic host and container
port assignments are visible in the networkBindings section of DescribeTasks
API responses. || containerDefinitions.[].portMappings.[].appProtocol
Optional | string
|
| containerDefinitions.[].portMappings.[].containerPort
Optional | integer
|
| containerDefinitions.[].portMappings.[].containerPortRange
Optional | string
|
| containerDefinitions.[].portMappings.[].hostPort
Optional | integer
|
| containerDefinitions.[].portMappings.[].name
Optional | string
|
| containerDefinitions.[].portMappings.[].protocol
Optional | string
|
| containerDefinitions.[].privileged
Optional | boolean
|
| containerDefinitions.[].pseudoTerminal
Optional | boolean
|
| containerDefinitions.[].readonlyRootFilesystem
Optional | boolean
|
| containerDefinitions.[].repositoryCredentials
Optional | object
The repository credentials for private registry authentication. |
| containerDefinitions.[].repositoryCredentials.credentialsParameter
Optional | string
|
| containerDefinitions.[].resourceRequirements
Optional | array
|
| containerDefinitions.[].resourceRequirements.[]
Required | object
The type and amount of a resource to assign to a container. The supported
resource types are GPUs and Elastic Inference accelerators. For more information,
see Working with GPUs on Amazon ECS (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-gpu.html)
or Working with Amazon Elastic Inference on Amazon ECS (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-inference.html)
in the Amazon Elastic Container Service Developer Guide || containerDefinitions.[].resourceRequirements.[].type
Optional | string
|
| containerDefinitions.[].resourceRequirements.[].value
Optional | string
|
| containerDefinitions.[].secrets
Optional | array
|
| containerDefinitions.[].secrets.[]
Required | object
An object representing the secret to expose to your container. Secrets can
be exposed to a container in the following ways:
To inject sensitive data into your containers as environment variables, use the secrets container definition parameter.
To reference sensitive information in the log configuration of a container, use the secretOptions container definition parameter.
For more information, see Specifying sensitive data (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/specifying-sensitive-data.html)
in the Amazon Elastic Container Service Developer Guide. || containerDefinitions.[].secrets.[].name
Optional | string
|
| containerDefinitions.[].secrets.[].valueFrom
Optional | string
|
| containerDefinitions.[].startTimeout
Optional | integer
|
| containerDefinitions.[].stopTimeout
Optional | integer
|
| containerDefinitions.[].systemControls
Optional | array
|
| containerDefinitions.[].systemControls.[]
Required | object
A list of namespaced kernel parameters to set in the container. This parameter
maps to Sysctls in the Create a container (https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate)
section of the Docker Remote API (https://docs.docker.com/engine/api/v1.35/)
and the –sysctl option to docker run (https://docs.docker.com/engine/reference/run/#security-configuration).
For example, you can configure net.ipv4.tcp_keepalive_time setting to maintain
longer lived connections.
We don’t recommend that you specify network-related systemControls parameters for multiple containers in a single task that also uses either the awsvpc or host network mode. Doing this has the following disadvantages:
For tasks that use the awsvpc network mode including Fargate, if you set systemControls for any container, it applies to all containers in the task. If you set different systemControls for multiple containers in a single task, the container that’s started last determines which systemControls take effect.
For tasks that use the host network mode, the network namespace systemControls aren’t supported.
If you’re setting an IPC resource namespace to use for the containers in the task, the following conditions apply to your system controls. For more information, see IPC mode (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html#task_definition_ipcmode).
For tasks that use the host IPC mode, IPC namespace systemControls aren’t supported.
For tasks that use the task IPC mode, IPC namespace systemControls values apply to all containers within a task.
This parameter is not supported for Windows containers.
This parameter is only supported for tasks that are hosted on Fargate if
the tasks are using platform version 1.4.0 or later (Linux). This isn’t supported
for Windows containers on Fargate. || containerDefinitions.[].systemControls.[].namespace
Optional | string
|
| containerDefinitions.[].systemControls.[].value
Optional | string
|
| containerDefinitions.[].ulimits
Optional | array
|
| containerDefinitions.[].ulimits.[]
Required | object
The ulimit settings to pass to the container.
Amazon ECS tasks hosted on Fargate use the default resource limit values set by the operating system with the exception of the nofile resource limit parameter which Fargate overrides. The nofile resource limit sets a restriction on the number of open files that a container can use. The default nofile soft limit is 1024 and the default hard limit is 65535.
You can specify the ulimit settings for a container in a task definition. || containerDefinitions.[].ulimits.[].hardLimit
Optional | integer
|
| containerDefinitions.[].ulimits.[].name
Optional | string
|
| containerDefinitions.[].ulimits.[].softLimit
Optional | integer
|
| containerDefinitions.[].user
Optional | string
|
| containerDefinitions.[].volumesFrom
Optional | array
|
| containerDefinitions.[].volumesFrom.[]
Required | object
Details on a data volume from another container in the same task definition. || containerDefinitions.[].volumesFrom.[].readOnly
Optional | boolean
|
| containerDefinitions.[].volumesFrom.[].sourceContainer
Optional | string
|
| containerDefinitions.[].workingDirectory
Optional | string
|
| cpu
Optional | string
The number of CPU units used by the task. It can be expressed as an integer
using CPU units (for example, 1024) or as a string using vCPUs (for example,
1 vCPU or 1 vcpu) in a task definition. String values are converted to an
integer indicating the CPU units when the task definition is registered.
Task-level CPU and memory parameters are ignored for Windows containers.
We recommend specifying container-level resources for Windows containers.
If you’re using the EC2 launch type, this field is optional. Supported values
are between 128 CPU units (0.125 vCPUs) and 10240 CPU units (10 vCPUs). If
you do not specify a value, the parameter is ignored.
If you’re using the Fargate launch type, this field is required and you must
use one of the following values, which determines your range of supported
values for the memory parameter:
The CPU units cannot be less than 1 vCPU when you use Windows containers
on Fargate.
* 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: 4096 (4 GB) and 16384 (16 GB)
in increments of 1024 (1 GB)
* 4096 (4 vCPU) - Available memory values: 8192 (8 GB) and 30720 (30 GB)
in increments of 1024 (1 GB)
* 8192 (8 vCPU) - Available memory values: 16 GB and 60 GB in 4 GB increments
This option requires Linux platform 1.4.0 or later.
* 16384 (16vCPU) - Available memory values: 32GB and 120 GB in 8 GB increments
This option requires Linux platform 1.4.0 or later. |
| ephemeralStorage
Optional | object
The amount of ephemeral storage to allocate for the task. This parameter
is used to expand the total amount of ephemeral storage available, beyond
the default amount, for tasks hosted on Fargate. For more information, see
Using data volumes in tasks (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/using_data_volumes.html)
in the Amazon ECS Developer Guide.
For tasks using the Fargate launch type, the task requires the following
platforms:
* Linux platform version 1.4.0 or later.
* Windows platform version 1.0.0 or later. |
| ephemeralStorage.sizeInGiB
Optional | integer
|
| executionRoleARN
Optional | string
The Amazon Resource Name (ARN) of the task execution role that grants the
Amazon ECS container agent permission to make Amazon Web Services 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 (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_execution_IAM_role.html)
in the Amazon Elastic Container Service Developer Guide. |
| family
Required | string
You must specify a family for a task definition. You can use it track multiple
versions of the same task definition. The family is used as a name for your
task definition. Up to 255 letters (uppercase and lowercase), numbers, underscores,
and hyphens are allowed. |
| inferenceAccelerators
Optional | array
The Elastic Inference accelerators to use for the containers in the task. |
| inferenceAccelerators.[]
Required | object
Details on an Elastic Inference accelerator. For more information, see Working
with Amazon Elastic Inference on Amazon ECS (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-inference.html)
in the Amazon Elastic Container Service Developer Guide. || inferenceAccelerators.[].deviceName
Optional | string
|
| inferenceAccelerators.[].deviceType
Optional | string
|
| ipcMode
Optional | string
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 (https://docs.docker.com/engine/reference/run/#ipc-settings—ipc)
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
(https://docs.docker.com/engine/security/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 (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html)
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 run on Fargate. |
| memory
Optional | string
The amount of memory (in MiB) used by the task. It can be expressed as an
integer using MiB (for example ,1024) or as a string using GB (for example,
1GB or 1 GB) in a task definition. String values are converted to an integer
indicating the MiB when the task definition is registered.
Task-level CPU and memory parameters are ignored for Windows containers.
We recommend specifying container-level resources for Windows containers.
If using the EC2 launch type, this field is optional.
If using the Fargate launch type, this field is required and you must use
one of the following values. This determines your range of supported values
for the cpu parameter.
The CPU units cannot be less than 1 vCPU when you use Windows containers
on Fargate.
* 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)
* Between 16 GB and 60 GB in 4 GB increments - Available cpu values: 8192
(8 vCPU) This option requires Linux platform 1.4.0 or later.
* Between 32GB and 120 GB in 8 GB increments - Available cpu values: 16384
(16 vCPU) This option requires Linux platform 1.4.0 or later. |
| networkMode
Optional | string
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 Linux instances, any network mode can be used.
For Amazon ECS tasks on Amazon EC2 Windows instances,
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
(https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-networking.html)
in the Amazon Elastic Container Service Developer Guide.
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.
For more information, see Network settings (https://docs.docker.com/engine/reference/run/#network-settings)
in the Docker run reference. |
| pidMode
Optional | string
The process namespace to use for the containers in the task. The valid values
are host or task. On Fargate for Linux containers, the only valid value is
task. For example, monitoring sidecars might need pidMode to access information
about other containers running in the same task.
If host is specified, 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 each container.
For more information, see PID settings (https://docs.docker.com/engine/reference/run/#pid-settings—pid)
in the Docker run reference.
If the host PID mode is used, there’s a heightened risk of undesired process
namespace exposure. For more information, see Docker security (https://docs.docker.com/engine/security/security/).
This parameter is not supported for Windows containers.
This parameter is only supported for tasks that are hosted on Fargate if
the tasks are using platform version 1.4.0 or later (Linux). This isn’t supported
for Windows containers on Fargate. |
| placementConstraints
Optional | array
An array of placement constraint objects to use for the task. You can specify
a maximum of 10 constraints for each task. This limit includes constraints
in the task definition and those specified at runtime. |
| placementConstraints.[]
Required | object
The constraint on task placement in the task definition. For more information,
see Task placement constraints (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-placement-constraints.html)
in the Amazon Elastic Container Service Developer Guide.
Task placement constraints aren’t supported for tasks run on Fargate. || placementConstraints.[].expression
Optional | string
|
| placementConstraints.[].type
Optional | string
|
| proxyConfiguration
Optional | object
The configuration details for the App Mesh proxy.
For tasks hosted on Amazon EC2 instances, the 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 use 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 AMI versions (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-ami-versions.html)
in the Amazon Elastic Container Service Developer Guide. |
| proxyConfiguration.containerName
Optional | string
|
| proxyConfiguration.properties
Optional | array
|
| proxyConfiguration.properties.[]
Required | object
A key-value pair object. || proxyConfiguration.properties.[].name
Optional | string
|
| proxyConfiguration.properties.[].value
Optional | string
|
| proxyConfiguration.type
Optional | string
|
| requiresCompatibilities
Optional | array
The task launch type that Amazon ECS validates the task definition against.
A client exception is returned if the task definition doesn’t validate against
the compatibilities specified. If no value is specified, the parameter is
omitted from the response. |
| requiresCompatibilities.[]
Required | string
|| runtimePlatform
Optional | object
The operating system that your tasks definitions run on. A platform family
is specified only for tasks using the Fargate launch type.
When you specify a task definition in a service, this value must match the
runtimePlatform value of the service. |
| runtimePlatform.cpuArchitecture
Optional | string
|
| runtimePlatform.operatingSystemFamily
Optional | string
|
| tags
Optional | array
The metadata that you apply to the task definition to help you categorize
and organize them. Each tag consists of a key and an optional value. You
define both of them.
The following basic restrictions apply to tags:
* Maximum number of tags per resource - 50
* For each resource, each tag key must be unique, and each tag key can
have only one value.
* Maximum key length - 128 Unicode characters in UTF-8
* Maximum value length - 256 Unicode characters in UTF-8
* If your tagging schema is used across multiple services and resources,
remember that other services may have restrictions on allowed characters.
Generally allowed characters are: letters, numbers, and spaces representable
in UTF-8, and the following characters: + - = . _ : / @.
* Tag keys and values are case-sensitive.
* Do not use aws:, AWS:, or any upper or lowercase combination of such
as a prefix for either keys or values as it is reserved for Amazon Web
Services use. You cannot edit or delete tag keys or values with this prefix.
Tags with this prefix do not count against your tags per resource limit. |
| tags.[]
Required | object
The metadata that you apply to a resource to help you categorize and organize
them. Each tag consists of a key and an optional value. You define them.
The following basic restrictions apply to tags:
Maximum number of tags per resource - 50
For each resource, each tag key must be unique, and each tag key can have only one value.
Maximum key length - 128 Unicode characters in UTF-8
Maximum value length - 256 Unicode characters in UTF-8
If your tagging schema is used across multiple services and resources, remember that other services may have restrictions on allowed characters. Generally allowed characters are: letters, numbers, and spaces representable in UTF-8, and the following characters: + - = . _ : / @.
Tag keys and values are case-sensitive.
Do not use aws:, AWS:, or any upper or lowercase combination of such as a prefix for either keys or values as it is reserved for Amazon Web Services use. You cannot edit or delete tag keys or values with this prefix. Tags with this prefix do not count against your tags per resource limit. || tags.[].key
Optional | string
| | tags.[].value
Optional | string
| | taskRoleARN
Optional | string
The short name or full Amazon Resource Name (ARN) of the IAM role that containers
in this task can assume. All containers in this task are granted the permissions
that are specified in this role. For more information, see IAM Roles for
Tasks (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-iam-roles.html)
in the Amazon Elastic Container Service Developer Guide. | | taskRoleRef
Optional | object
AWSResourceReferenceWrapper provides a wrapper around *AWSResourceReference
type to provide more user friendly syntax for references using ‘from’ field
Ex:
APIIDRef:
from:
name: my-api | | taskRoleRef.from
Optional | object
AWSResourceReference provides all the values necessary to reference another
k8s resource for finding the identifier(Id/ARN/Name) | | taskRoleRef.from.name
Optional | string
| | taskRoleRef.from.namespace
Optional | string
| | volumes
Optional | array
A list of volume definitions in JSON format that containers in your task
might use. | | volumes.[]
Required | object
The data volume configuration for tasks launched using this task definition. Specifying a volume configuration in a task definition is optional. The volume configuration may contain multiple volumes but only one volume configured at launch is supported. Each volume defined in the volume configuration may only specify a name and one of either configuredAtLaunch, dockerVolumeConfiguration, efsVolumeConfiguration, fsxWindowsFileServerVolumeConfiguration, or host. If an empty volume configuration is specified, by default Amazon ECS uses a host volume. For more information, see Using data volumes in tasks (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/using_data_volumes.html). || volumes.[].configuredAtLaunch
Optional | boolean
| | volumes.[].dockerVolumeConfiguration
Optional | object
This parameter is specified when you’re using Docker volumes. Docker volumes
are only supported when you’re using the EC2 launch type. Windows containers
only support the use of the local driver. To use bind mounts, specify a host
instead. | | volumes.[].dockerVolumeConfiguration.autoprovision
Optional | boolean
| | volumes.[].dockerVolumeConfiguration.driver
Optional | string
| | volumes.[].dockerVolumeConfiguration.driverOpts
Optional | object
| | volumes.[].dockerVolumeConfiguration.labels
Optional | object
| | volumes.[].dockerVolumeConfiguration.scope
Optional | string
| | volumes.[].efsVolumeConfiguration
Optional | object
This parameter is specified when you’re using an Amazon Elastic File System
file system for task storage. For more information, see Amazon EFS volumes
(https://docs.aws.amazon.com/AmazonECS/latest/developerguide/efs-volumes.html)
in the Amazon Elastic Container Service Developer Guide. | | volumes.[].efsVolumeConfiguration.authorizationConfig
Optional | object
The authorization configuration details for the Amazon EFS file system. | | volumes.[].efsVolumeConfiguration.authorizationConfig.accessPointID
Optional | string
| | volumes.[].efsVolumeConfiguration.authorizationConfig.iam
Optional | string
| | volumes.[].efsVolumeConfiguration.fileSystemID
Optional | string
| | volumes.[].efsVolumeConfiguration.rootDirectory
Optional | string
| | volumes.[].efsVolumeConfiguration.transitEncryption
Optional | string
| | volumes.[].efsVolumeConfiguration.transitEncryptionPort
Optional | integer
| | volumes.[].fsxWindowsFileServerVolumeConfiguration
Optional | object
This parameter is specified when you’re using Amazon FSx for Windows File
Server (https://docs.aws.amazon.com/fsx/latest/WindowsGuide/what-is.html)
file system for task storage.
For more information and the input format, see Amazon FSx for Windows File
Server volumes (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/wfsx-volumes.html)
in the Amazon Elastic Container Service Developer Guide. | | volumes.[].fsxWindowsFileServerVolumeConfiguration.authorizationConfig
Optional | object
The authorization configuration details for Amazon FSx for Windows File Server
file system. See FSxWindowsFileServerVolumeConfiguration (https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_FSxWindowsFileServerVolumeConfiguration.html)
in the Amazon ECS API Reference.
For more information and the input format, see Amazon FSx for Windows File
Server Volumes (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/wfsx-volumes.html)
in the Amazon Elastic Container Service Developer Guide. | | volumes.[].fsxWindowsFileServerVolumeConfiguration.authorizationConfig.credentialsParameter
Optional | string
| | volumes.[].fsxWindowsFileServerVolumeConfiguration.authorizationConfig.domain
Optional | string
| | volumes.[].fsxWindowsFileServerVolumeConfiguration.fileSystemID
Optional | string
| | volumes.[].fsxWindowsFileServerVolumeConfiguration.rootDirectory
Optional | string
| | volumes.[].host
Optional | object
Details on a container instance bind mount host volume. | | volumes.[].host.sourcePath
Optional | string
| | volumes.[].name
Optional | string
|
Status
ackResourceMetadata:
arn: string
ownerAccountID: string
region: string
compatibilities:
- string
conditions:
- lastTransitionTime: string
message: string
reason: string
status: string
type: string
deregisteredAt: string
registeredAt: string
registeredBy: string
requiresAttributes:
- name: string
targetID: string
targetType: string
value: string
revision: integer
status: string
Field | Description |
---|---|
ackResourceMetadata Optional | object All CRs managed by ACK have a common Status.ACKResourceMetadata memberthat is used to contain resource sync state, account ownership, constructed ARN for the resource |
ackResourceMetadata.arn Optional | string ARN is the Amazon Resource Name for the resource. This is a globally-unique identifier and is set only by the ACK service controller once the controller has orchestrated the creation of the resource OR when it has verified that an “adopted” resource (a resource where the ARN annotation was set by the Kubernetes user on the CR) exists and matches the supplied CR’s Spec field values. https://github.com/aws/aws-controllers-k8s/issues/270 |
ackResourceMetadata.ownerAccountID Required | string OwnerAccountID is the AWS Account ID of the account that owns the backend AWS service API resource. |
ackResourceMetadata.region Required | string Region is the AWS region in which the resource exists or will exist. |
compatibilities Optional | array The task launch types the task definition validated against during task definition registration. For more information, see Amazon ECS launch types (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html) in the Amazon Elastic Container Service Developer Guide. |
compatibilities.[] Required | string |
conditions.[] Required | object Condition is the common struct used by all CRDs managed by ACK service |
controllers to indicate terminal states of the CR and its backend AWS | |
service API resource | |
conditions.[].message Optional | string A human readable message indicating details about the transition. |
conditions.[].reason Optional | string The reason for the condition’s last transition. |
conditions.[].status Optional | string Status of the condition, one of True, False, Unknown. |
conditions.[].type Optional | string Type is the type of the Condition |
deregisteredAt Optional | string The Unix timestamp for the time when the task definition was deregistered. |
registeredAt Optional | string The Unix timestamp for the time when the task definition was registered. |
registeredBy Optional | string The principal that registered the task definition. |
requiresAttributes Optional | array The container instance attributes required by your task. When an Amazon EC2 instance is registered to your cluster, the Amazon ECS container agent assigns some standard attributes to the instance. You can apply custom attributes. These are specified as key-value pairs using the Amazon ECS console or the PutAttributes API. These attributes are used when determining task placement for tasks hosted on Amazon EC2 instances. For more information, see Attributes (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-placement-constraints.html#attributes) in the Amazon Elastic Container Service Developer Guide. This parameter isn’t supported for tasks run on Fargate. |
requiresAttributes.[] Required | object An attribute is a name-value pair that’s associated with an Amazon ECS object. |
Use attributes to extend the Amazon ECS data model by adding custom metadata | |
to your resources. For more information, see Attributes (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-placement-constraints.html#attributes) | |
in the Amazon Elastic Container Service Developer Guide. | |
requiresAttributes.[].targetID Optional | string |
requiresAttributes.[].targetType Optional | string |
requiresAttributes.[].value Optional | string |
revision Optional | integer 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. This is even if you deregistered previous revisions in this family. |
status Optional | string The status of the task definition. |