Package-level declarations
Types
The managed scaling settings for the Auto Scaling group capacity provider.
The `CapacityProviderStrategyItem`
property specifies the details of the default capacity provider strategy for the cluster. When services or tasks are run in the cluster with no launch type or capacity provider strategy specified, the default capacity provider strategy is used.
The execute command and managed storage configuration for the cluster.
The details of the execute command configuration.
The log configuration for the results of the execute command actions. The logs can be sent to CloudWatch Logs or an Amazon S3 bucket.
The managed storage configuration for the cluster.
Use this parameter to set a default Service Connect namespace. After you set a default Service Connect namespace, any new services with Service Connect turned on that are created in the cluster are added as client services in the namespace. This setting only applies to new services that set the `enabled`
parameter to `true`
in the `ServiceConnectConfiguration`
. You can set the namespace of each service individually in the `ServiceConnectConfiguration`
to override this default parameter. Tasks that run in a namespace can use short names to connect to services in the namespace. Tasks can connect to services across all of the clusters in the namespace. Tasks connect through a managed proxy container that collects logs and metrics for increased visibility. Only the tasks that Amazon ECS services create are supported with Service Connect. For more information, see Service Connect in the Amazon Elastic Container Service Developer Guide.
The settings to use when creating a cluster. This parameter is used to turn on CloudWatch Container Insights with enhanced observability or CloudWatch Container Insights for a cluster. Container Insights with enhanced observability provides all the Container Insights metrics, plus additional task and container metrics. This version supports enhanced observability for Amazon ECS clusters using the Amazon EC2 and Fargate launch types. After you configure Container Insights with enhanced observability on Amazon ECS, Container Insights auto-collects detailed infrastructure telemetry from the cluster level down to the container level in your environment and displays these critical performance data in curated dashboards removing the heavy lifting in observability set-up. For more information, see Monitor Amazon ECS containers using Container Insights with enhanced observability in the Amazon Elastic Container Service Developer Guide.
An object representing the networking details for a task or service. For example `awsVpcConfiguration={subnets=["subnet-12344321"],securityGroups=["sg-12344321"]}`
.
The details of a capacity provider strategy. A capacity provider strategy can be set when using the `RunTask`
or `CreateService`
APIs or as the default capacity provider strategy for a cluster with the `CreateCluster`
API. Only capacity providers that are already associated with a cluster and have an `ACTIVE`
or `UPDATING`
status can be used in a capacity provider strategy. The `PutClusterCapacityProviders`
API is used to associate a capacity provider with a cluster. If specifying a capacity provider that uses an Auto Scaling group, the capacity provider must already be created. New Auto Scaling group capacity providers can be created with the `CreateCapacityProvider`
API operation. To use an FARGATElong capacity provider, specify either the `FARGATE`
or `FARGATE_SPOT`
capacity providers. The FARGATElong capacity providers are available to all accounts and only need to be associated with a cluster to be used in a capacity provider strategy.
Each alias ("endpoint") is a fully-qualified name and port number that other tasks ("clients") can use to connect to this service. Each name and port mapping must be unique within the namespace. Tasks that run in a namespace can use short names to connect to services in the namespace. Tasks can connect to services across all of the clusters in the namespace. Tasks connect through a managed proxy container that collects logs and metrics for increased visibility. Only the tasks that Amazon ECS services create are supported with Service Connect. For more information, see Service Connect in the Amazon Elastic Container Service Developer Guide.
The Service Connect configuration of your Amazon ECS service. The configuration for this service to discover and connect to services, and be discovered by, and connected from, other services within a namespace. Tasks that run in a namespace can use short names to connect to services in the namespace. Tasks can connect to services across all of the clusters in the namespace. Tasks connect through a managed proxy container that collects logs and metrics for increased visibility. Only the tasks that Amazon ECS services create are supported with Service Connect. For more information, see Service Connect in the Amazon Elastic Container Service Developer Guide.
The Service Connect service object configuration. For more information, see Service Connect in the Amazon Elastic Container Service Developer Guide.
The certificate root authority that secures your service.
The key that encrypts and decrypts your resources for Service Connect TLS.
One of the methods which provide a way for you to quickly identify when a deployment has failed, and then to optionally roll back the failure to the last working deployment. When the alarms are generated, Amazon ECS sets the service deployment to failed. Set the rollback parameter to have Amazon ECS to roll back your service to the last completed deployment after a failure. You can only use the `DeploymentAlarms`
method to detect failures when the `DeploymentController`
is set to `ECS`
(rolling update). For more information, see Rolling update in the Amazon Elastic Container Service Developer Guide.
The deployment circuit breaker can only be used for services using the rolling update (`ECS`
) deployment type. The deployment circuit breaker determines whether a service deployment will fail if the service can't reach a steady state. If it is turned on, a service deployment will transition to a failed state and stop launching new tasks. You can also configure Amazon ECS to roll back your service to the last completed deployment after a failure. For more information, see Rolling update in the Amazon Elastic Container Service Developer Guide. For more information about API failure reasons, see API failure reasons in the Amazon Elastic Container Service Developer Guide.
Optional deployment parameters that control how many tasks run during a deployment and the ordering of stopping and starting tasks.
The deployment controller to use for the service.
The tag specifications of an Amazon EBS volume.
The `LoadBalancer`
property specifies details on a load balancer that is used with a service. If the service is using the `CODE_DEPLOY`
deployment controller, the service is required to use either an Application Load Balancer or Network Load Balancer. When you are creating an ACDlong deployment group, you specify two target groups (referred to as a `targetGroupPair`
). Each target group binds to a separate task set in the deployment. The load balancer can also have up to two listeners, a required listener for production traffic and an optional listener that allows you to test new revisions of the service before routing production traffic to it. Services with tasks that use the `awsvpc`
network mode (for example, those with the Fargate launch type) only support Application Load Balancers and Network Load Balancers. Classic Load Balancers are not supported. Also, when you create any target groups for these services, you must choose `ip`
as the target type, not `instance`
. Tasks that use the `awsvpc`
network mode are associated with an elastic network interface, not an Amazon EC2 instance.
The log configuration for the container. This parameter maps to `LogConfig`
in the docker container create command and the `--log-driver`
option to docker 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. Understand the following when specifying a log configuration for your containers.
The configuration for the Amazon EBS volume that Amazon ECS creates and manages on your behalf. These settings are used to create each Amazon EBS volume, with one volume created for each task in the service. For information about the supported launch types and operating systems, see Supported operating systems and launch types in theAmazon Elastic Container Service Developer Guide. Many of these parameters map 1:1 with the Amazon EBS `CreateVolume`
API request parameters.
The network configuration for a task or service.
An object representing a constraint on task placement. For more information, see Task placement constraints in the Amazon Elastic Container Service Developer Guide. If you're using the Fargate launch type, task placement constraints aren't supported.
The task placement strategy for a task or service. For more information, see Task placement strategies in the Amazon Elastic Container Service Developer Guide.
The details for the service registry. Each service may be associated with one service registry. Multiple service registries for each service are not supported. When you add, update, or remove the service registries configuration, Amazon ECS starts a new deployment. New tasks are registered and deregistered to the updated service registry configuration.
An object representing the secret to expose to your container. Secrets can be exposed to a container in the following ways:
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:
An object that represents the timeout configurations for Service Connect. If `idleTimeout`
is set to a time that is less than `perRequestTimeout`
, the connection will close when the `idleTimeout`
is reached and not the `perRequestTimeout`
.
The configuration for a volume specified in the task definition as a volume that is configured at launch time. Currently, the only supported volume type is an Amazon EBS volume.
The VPC Lattice configuration for your service that holds the information for the target group(s) Amazon ECS tasks will be registered to.
The authorization configuration details for the Amazon EFS file system.
The `ContainerDefinition`
property specifies a container definition. Container definitions are used in task definitions to describe the different containers that are launched as part of a task.
The `ContainerDependency`
property specifies 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 enable 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 in the Amazon Elastic Container Service Developer Guide. If you are 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 in the Amazon Elastic Container Service Developer Guide. For tasks using the Fargate launch type, this parameter requires that the task or service uses platform version 1.3.0 or later.
The `Device`
property specifies an object representing a container instance host device.
The `DockerVolumeConfiguration`
property specifies a Docker volume configuration and is used when you use Docker volumes. Docker volumes are only supported when you are using the EC2 launch type. Windows containers only support the use of the `local`
driver. To use bind mounts, specify a `host`
instead.
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 in the Amazon Elastic Container Service Developer Guide.
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 Use a file to pass environment variables to a container in the Amazon Elastic Container Service Developer Guide. Environment variable files are objects in Amazon S3 and all Amazon S3 security considerations apply. You must use the following platforms for the Fargate launch type:
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 FARGATElong. For more information, see Using data volumes in tasks in the Amazon ECS Developer Guide;. For tasks using the Fargate launch type, the task requires the following platforms:
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 in the Amazon Elastic Container Service Developer Guide.
The authorization configuration details for Amazon FSx for Windows File Server file system. See FSxWindowsFileServerVolumeConfiguration in the Amazon ECS API Reference. For more information and the input format, see Amazon FSx for Windows File Server Volumes in the Amazon Elastic Container Service Developer Guide.
This parameter is specified when you're using Amazon FSx for Windows File Server file system for task storage. For more information and the input format, see Amazon FSx for Windows File Server volumes in the Amazon Elastic Container Service Developer Guide.
The `HealthCheck`
property specifies 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. 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. 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:
The `HostEntry`
property specifies a hostname and an IP address that are added to the `/etc/hosts`
file of a container through the `extraHosts`
parameter of its `ContainerDefinition`
resource.
The `HostVolumeProperties`
property specifies details on a container instance bind mount host volume.
Details on an Elastic Inference accelerator. For more information, see Working with Amazon Elastic Inference on Amazon ECS in the Amazon Elastic Container Service Developer Guide.
The Linux capabilities to add or remove from the default Docker configuration for a container defined in the task definition. For more detailed information about these Linux capabilities, see the capabilities(7) Linux manual page. The following describes how Docker processes the Linux capabilities specified in the `add`
and `drop`
request parameters. For information about the latest behavior, see Docker Compose: order of cap_drop and cap_add in the Docker Community Forum.
A key-value pair object.
The Linux-specific options that are applied to the container, such as Linux KernelCapabilities.
The `LogConfiguration`
property specifies log configuration options to send to a custom log driver for the container.
The details for a volume mount point that's used in a container definition.
The constraint on task placement in the task definition. For more information, see Task placement constraints in the Amazon Elastic Container Service Developer Guide. Task placement constraints aren't supported for tasks run on FARGATElong.
The `PortMapping`
property specifies a port mapping. 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 are using containers in a task with the `awsvpc`
or `host`
network mode, exposed ports should be specified using `containerPort`
. The `hostPort`
can be left blank or it must be the same value as the `containerPort`
. 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.
The configuration details for the App Mesh proxy. For tasks that use the EC2 launch type, 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 Linux AMI
The repository credentials for private registry authentication.
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 or Working with Amazon Elastic Inference on Amazon ECS in the Amazon Elastic Container Service Developer Guide
You can enable a restart policy for each container defined in your task definition, to overcome transient failures faster and maintain task availability. When you enable a restart policy for a container, Amazon ECS can restart the container if it exits, without needing to replace the task. For more information, see Restart individual containers in Amazon ECS tasks with container restart policies in the Amazon Elastic Container Service Developer Guide.
Information about the platform for the Amazon ECS service or task. For more information about `RuntimePlatform`
, see RuntimePlatform in the Amazon Elastic Container Service Developer Guide.
An object representing the secret to expose to your container. Secrets can be exposed to a container in the following ways:
A list of namespaced kernel parameters to set in the container. This parameter maps to `Sysctls`
in the docker container create command and the `--sysctl`
option to docker run. 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:
The container path, mount options, and size of the tmpfs mount.
The `ulimit`
settings to pass to the container. Amazon ECS tasks hosted on FARGATElong use the default resource limit values set by the operating system with the exception of the `nofile`
resource limit parameter which FARGATElong 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 `65535`
and the default hard limit is `65535`
. You can specify the `ulimit`
settings for a container in a task definition.
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.
Details on a data volume from another container in the same task definition.
The VPC subnets and security groups associated with a task. All specified subnets and security groups must be from the same VPC.
A load balancer object representing the load balancer to use with the task set. The supported load balancer types are either an Application Load Balancer or a Network Load Balancer.
An object representing the network configuration for a task or service.