

This is the new *CloudFormation Template Reference Guide*. Please update your bookmarks and links. For help getting started with CloudFormation, see the [AWS CloudFormation User Guide](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/Welcome.html).

# AWS::ECS::TaskSet
<a name="aws-resource-ecs-taskset"></a>

Create a task set in the specified cluster and service. This is used when a service uses the `EXTERNAL` deployment controller type. For more information, see [Amazon ECS deployment types](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/deployment-types.html) in the *Amazon Elastic Container Service Developer Guide*.

**Note**  
On March 21, 2024, a change was made to resolve the task definition revision before authorization. When a task definition revision is not specified, authorization will occur using the latest revision of a task definition.

For information about the maximum number of task sets and other quotas, see [Amazon ECS service quotas](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-quotas.html) in the *Amazon Elastic Container Service Developer Guide*.

## Syntax
<a name="aws-resource-ecs-taskset-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-resource-ecs-taskset-syntax.json"></a>

```
{
  "Type" : "AWS::ECS::TaskSet",
  "Properties" : {
      "[CapacityProviderStrategy](#cfn-ecs-taskset-capacityproviderstrategy)" : [ CapacityProviderStrategyItem, ... ],
      "[Cluster](#cfn-ecs-taskset-cluster)" : String,
      "[ExternalId](#cfn-ecs-taskset-externalid)" : String,
      "[LaunchType](#cfn-ecs-taskset-launchtype)" : String,
      "[LoadBalancers](#cfn-ecs-taskset-loadbalancers)" : [ LoadBalancer, ... ],
      "[NetworkConfiguration](#cfn-ecs-taskset-networkconfiguration)" : NetworkConfiguration,
      "[PlatformVersion](#cfn-ecs-taskset-platformversion)" : String,
      "[Scale](#cfn-ecs-taskset-scale)" : Scale,
      "[Service](#cfn-ecs-taskset-service)" : String,
      "[ServiceRegistries](#cfn-ecs-taskset-serviceregistries)" : [ ServiceRegistry, ... ],
      "[Tags](#cfn-ecs-taskset-tags)" : [ Tag, ... ],
      "[TaskDefinition](#cfn-ecs-taskset-taskdefinition)" : String
    }
}
```

### YAML
<a name="aws-resource-ecs-taskset-syntax.yaml"></a>

```
Type: AWS::ECS::TaskSet
Properties:
  [CapacityProviderStrategy](#cfn-ecs-taskset-capacityproviderstrategy): 
    - CapacityProviderStrategyItem
  [Cluster](#cfn-ecs-taskset-cluster): String
  [ExternalId](#cfn-ecs-taskset-externalid): String
  [LaunchType](#cfn-ecs-taskset-launchtype): String
  [LoadBalancers](#cfn-ecs-taskset-loadbalancers): 
    - LoadBalancer
  [NetworkConfiguration](#cfn-ecs-taskset-networkconfiguration): 
    NetworkConfiguration
  [PlatformVersion](#cfn-ecs-taskset-platformversion): String
  [Scale](#cfn-ecs-taskset-scale): 
    Scale
  [Service](#cfn-ecs-taskset-service): String
  [ServiceRegistries](#cfn-ecs-taskset-serviceregistries): 
    - ServiceRegistry
  [Tags](#cfn-ecs-taskset-tags): 
    - Tag
  [TaskDefinition](#cfn-ecs-taskset-taskdefinition): String
```

## Properties
<a name="aws-resource-ecs-taskset-properties"></a>

`CapacityProviderStrategy`  <a name="cfn-ecs-taskset-capacityproviderstrategy"></a>
The capacity provider strategy that are associated with the task set.  
*Required*: No  
*Type*: Array of [CapacityProviderStrategyItem](aws-properties-ecs-taskset-capacityproviderstrategyitem.md)  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`Cluster`  <a name="cfn-ecs-taskset-cluster"></a>
The short name or full Amazon Resource Name (ARN) of the cluster that hosts the service to create the task set in.  
*Required*: Yes  
*Type*: String  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`ExternalId`  <a name="cfn-ecs-taskset-externalid"></a>
An optional non-unique tag that identifies this task set in external systems. If the task set is associated with a service discovery registry, the tasks in this task set will have the `ECS_TASK_SET_EXTERNAL_ID`AWS Cloud Map attribute set to the provided value.  
*Required*: No  
*Type*: String  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`LaunchType`  <a name="cfn-ecs-taskset-launchtype"></a>
The launch type that new tasks in the task set uses. 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*.  
If a `launchType` is specified, the `capacityProviderStrategy` parameter must be omitted.  
*Required*: No  
*Type*: String  
*Allowed values*: `EC2 | FARGATE`  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`LoadBalancers`  <a name="cfn-ecs-taskset-loadbalancers"></a>
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.  
*Required*: No  
*Type*: Array of [LoadBalancer](aws-properties-ecs-taskset-loadbalancer.md)  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`NetworkConfiguration`  <a name="cfn-ecs-taskset-networkconfiguration"></a>
The network configuration for the task set.  
*Required*: No  
*Type*: [NetworkConfiguration](aws-properties-ecs-taskset-networkconfiguration.md)  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`PlatformVersion`  <a name="cfn-ecs-taskset-platformversion"></a>
The platform version that the tasks in the task set uses. A platform version is specified only for tasks using the Fargate launch type. If one isn't specified, the `LATEST` platform version is used.  
*Required*: No  
*Type*: String  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`Scale`  <a name="cfn-ecs-taskset-scale"></a>
A floating-point percentage of your desired number of tasks to place and keep running in the task set.  
*Required*: No  
*Type*: [Scale](aws-properties-ecs-taskset-scale.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Service`  <a name="cfn-ecs-taskset-service"></a>
The short name or full Amazon Resource Name (ARN) of the service to create the task set in.  
*Required*: Yes  
*Type*: String  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`ServiceRegistries`  <a name="cfn-ecs-taskset-serviceregistries"></a>
The details of the service discovery registries to assign to this task set. For more information, see [Service discovery](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-discovery.html).  
*Required*: No  
*Type*: Array of [ServiceRegistry](aws-properties-ecs-taskset-serviceregistry.md)  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`Tags`  <a name="cfn-ecs-taskset-tags"></a>
The metadata that you apply to the task set to help you categorize and organize them. Each tag consists of a key and an optional value. You define both.  
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: \$1 - = . \$1 : / @.
+ 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 AWS 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.
*Required*: No  
*Type*: Array of [Tag](aws-properties-ecs-taskset-tag.md)  
*Minimum*: `0`  
*Maximum*: `50`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`TaskDefinition`  <a name="cfn-ecs-taskset-taskdefinition"></a>
The task definition for the tasks in the task set to use. If a revision isn't specified, the latest `ACTIVE` revision is used.  
*Required*: Yes  
*Type*: String  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

## Return values
<a name="aws-resource-ecs-taskset-return-values"></a>

### Ref
<a name="aws-resource-ecs-taskset-return-values-ref"></a>

When you pass the logical ID of this resource to the intrinsic `Ref` function, `Ref` returns the resource name.

For more information about using the `Ref` function, see [https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-ref.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-ref.html).

### Fn::GetAtt
<a name="aws-resource-ecs-taskset-return-values-fn--getatt"></a>

The `Fn::GetAtt` intrinsic function returns a value for a specified attribute of this type. The following are the available attributes and sample return values.

For more information about using the `Fn::GetAtt` intrinsic function, see [https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-getatt.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-getatt.html).

#### 
<a name="aws-resource-ecs-taskset-return-values-fn--getatt-fn--getatt"></a>

`Id`  <a name="Id-fn::getatt"></a>
The ID of the task set.

## Examples
<a name="aws-resource-ecs-taskset--examples"></a>



### Create an Amazon ECS task set
<a name="aws-resource-ecs-taskset--examples--Create_an_task_set"></a>

This template defines a task definition, a cluster, a service, and a task set. The task set uses the specified task definition and is created in the specified cluster and service. Replace the `ExecutionRoleArn`, `SecurityGroups`, and `Subnets` with your own information.

#### JSON
<a name="aws-resource-ecs-taskset--examples--Create_an_task_set--json"></a>

```
{
  "AWSTemplateFormatVersion": "2010-09-09",
  "Resources": {
    "ECSCluster": {
      "Type": "AWS::ECS::Cluster",
      "Properties": {
        "ClusterName": "deployment-cluster"
      }
    },
    "ECSService": {
      "Type": "AWS::ECS::Service",
      "Properties": {
        "ServiceName": "deployment-service",
        "Cluster": {
          "Ref": "ECSCluster"
        },
        "DesiredCount": 2,
        "DeploymentController": {
          "Type": "EXTERNAL"
        }
      }
    },
    "ECSTaskDefinition": {
      "Type": "AWS::ECS::TaskDefinition",
      "Properties": {
        "ContainerDefinitions": [
          {
            "Command": [
             "/bin/sh -c \"echo '<html> <head> <title>Amazon
              ECS Sample App</title> <style>body {margin-top: 40px;
              background-color: #333;} </style> </head><body>
              <div style=color:white;text-align:center> <h1>Amazon
              ECS Sample App</h1> <h2>Congratulations!</h2>
              <p>Your application is now running on a container in Amazon
              ECS.</p> </div></body></html>'
              >  /usr/local/apache2/htdocs/index.html &&
              httpd-foreground\""
            ],
            "EntryPoint": ["sh", "-c"],
            "Essential": true,
            "Image": "public.ecr.aws/docker/library/httpd:2.4",
            "LogConfiguration": {
              "LogDriver": "awslogs",
              "Options": {
                "awslogs-group": "/ecs/deployment",
                "awslogs-region": "us-east-1",
                "awslogs-stream-prefix": "ecs"
              }
            },
            "Name": "sample-fargate-app",
            "PortMappings": [
              {
                "ContainerPort": 80,
                "HostPort": 80,
                "Protocol": "tcp"
              }
            ]
          }
        ],
        "Cpu": 256,
        "ExecutionRoleArn": "arn:aws:iam::111122223333:role/ecsTaskExecutionRole",
        "Family": "deployment-task",
        "Memory": 512,
        "NetworkMode": "awsvpc",
        "RequiresCompatibilities": ["FARGATE"],
        "RuntimePlatform": {
          "OperatingSystemFamily": "LINUX"
        }
      }
    },
    "ECSTaskSet": {
      "Type": "AWS::ECS::TaskSet",
      "Properties": {
        "Cluster": {
          "Ref": "ECSCluster"
        },
        "LaunchType": "FARGATE",
        "NetworkConfiguration": {
          "AwsVpcConfiguration": {
            "AssignPublicIp": "ENABLED",
            "SecurityGroups": ["sg-abcdef01234567890"],
            "Subnets": ["subnet-021345abcdef67890"]
          }
        },
        "PlatformVersion": "1.4.0",
        "Scale": {
          "Unit": "PERCENT",
          "Value": 100
        },
        "Service": {
          "Ref": "ECSService"
        },
        "TaskDefinition": {
          "Ref": "ECSTaskDefinition"
        }
      }
    }
  }
}
```

#### YAML
<a name="aws-resource-ecs-taskset--examples--Create_an_task_set--yaml"></a>

```
AWSTemplateFormatVersion: 2010-09-09
Resources:
  ECSCluster:
    Type: AWS::ECS::Cluster
    Properties:
      ClusterName: deployment-cluster
  ECSService:
    Type: AWS::ECS::Service
    Properties:
      ServiceName: deployment-service
      Cluster:
        Ref: ECSCluster
      DesiredCount: 2
      DeploymentController:
        Type: EXTERNAL
  ECSTaskDefinition:
    Type: AWS::ECS::TaskDefinition
    Properties:
      ContainerDefinitions:
        - Command:
            - "/bin/sh -c \"echo '<html> <head> <title>Amazon
              ECS Sample App</title> <style>body {margin-top: 40px;
              background-color: #333;} </style> </head><body>
              <div style=color:white;text-align:center> <h1>Amazon
              ECS Sample App</h1> <h2>Congratulations!</h2>
              <p>Your application is now running on a container in Amazon
              ECS.</p> </div></body></html>'
              >  /usr/local/apache2/htdocs/index.html &&
              httpd-foreground\""
          EntryPoint:
            - sh
            - -c
          Essential: true
          Image: 'public.ecr.aws/docker/library/httpd:2.4'
          LogConfiguration:
            LogDriver: awslogs
            Options:
              awslogs-group: /ecs/deployment
              awslogs-region: us-east-1
              awslogs-stream-prefix: ecs
          Name: sample-fargate-app
          PortMappings:
            - ContainerPort: 80
              HostPort: 80
              Protocol: tcp
      Cpu: 256
      ExecutionRoleArn: arn:aws:iam::111122223333:role/ecsTaskExecutionRole
      Family: deployment-task
      Memory: 512
      NetworkMode: awsvpc
      RequiresCompatibilities:
        - FARGATE
      RuntimePlatform:
        OperatingSystemFamily: LINUX
  ECSTaskSet:
    Type: AWS::ECS::TaskSet
    Properties:
      Cluster:
        Ref: ECSCluster
      LaunchType: FARGATE
      NetworkConfiguration:
        AwsVpcConfiguration:
          AssignPublicIp: ENABLED
          SecurityGroups:
            - sg-abcdef01234567890
          Subnets:
            - subnet-abcdef01234567890
      PlatformVersion: 1.4.0
      Scale:
        Unit: PERCENT
        Value: 50
      Service:
        Ref: ECSService
      TaskDefinition:
        Ref: ECSTaskDefinition
```

# AWS::ECS::TaskSet AwsVpcConfiguration
<a name="aws-properties-ecs-taskset-awsvpcconfiguration"></a>

An object representing the networking details for a task or service. For example `awsVpcConfiguration={subnets=["subnet-12344321"],securityGroups=["sg-12344321"]}`.

## Syntax
<a name="aws-properties-ecs-taskset-awsvpcconfiguration-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-ecs-taskset-awsvpcconfiguration-syntax.json"></a>

```
{
  "[AssignPublicIp](#cfn-ecs-taskset-awsvpcconfiguration-assignpublicip)" : String,
  "[SecurityGroups](#cfn-ecs-taskset-awsvpcconfiguration-securitygroups)" : [ String, ... ],
  "[Subnets](#cfn-ecs-taskset-awsvpcconfiguration-subnets)" : [ String, ... ]
}
```

### YAML
<a name="aws-properties-ecs-taskset-awsvpcconfiguration-syntax.yaml"></a>

```
  [AssignPublicIp](#cfn-ecs-taskset-awsvpcconfiguration-assignpublicip): String
  [SecurityGroups](#cfn-ecs-taskset-awsvpcconfiguration-securitygroups): 
    - String
  [Subnets](#cfn-ecs-taskset-awsvpcconfiguration-subnets): 
    - String
```

## Properties
<a name="aws-properties-ecs-taskset-awsvpcconfiguration-properties"></a>

`AssignPublicIp`  <a name="cfn-ecs-taskset-awsvpcconfiguration-assignpublicip"></a>
Whether the task's elastic network interface receives a public IP address.   
Consider the following when you set this value:  
+ When you use `create-service` or `update-service`, the default is `DISABLED`. 
+ When the service `deploymentController` is `ECS`, the value must be `DISABLED`. 
*Required*: No  
*Type*: String  
*Allowed values*: `DISABLED | ENABLED`  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`SecurityGroups`  <a name="cfn-ecs-taskset-awsvpcconfiguration-securitygroups"></a>
The IDs of the security groups associated with the task or service. If you don't specify a security group, the default security group for the VPC is used. There's a limit of 5 security groups that can be specified.  
All specified security groups must be from the same VPC.
*Required*: No  
*Type*: Array of String  
*Maximum*: `5`  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`Subnets`  <a name="cfn-ecs-taskset-awsvpcconfiguration-subnets"></a>
The IDs of the subnets associated with the task or service. There's a limit of 16 subnets that can be specified.  
All specified subnets must be from the same VPC.
*Required*: Yes  
*Type*: Array of String  
*Maximum*: `16`  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

# AWS::ECS::TaskSet CapacityProviderStrategyItem
<a name="aws-properties-ecs-taskset-capacityproviderstrategyitem"></a>

The details of a capacity provider strategy. A capacity provider strategy can be set when using the [RunTask](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_RunTask.html)or [CreateCluster](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_CreateCluster.html) 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](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_PutClusterCapacityProviders.html) 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 [CreateClusterCapacityProvider](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_CreateClusterCapacityProvider.html) API operation.

To use a AWS Fargate capacity provider, specify either the `FARGATE` or `FARGATE_SPOT` capacity providers. The AWS Fargate capacity providers are available to all accounts and only need to be associated with a cluster to be used in a capacity provider strategy.

With `FARGATE_SPOT`, you can run interruption tolerant tasks at a rate that's discounted compared to the `FARGATE` price. `FARGATE_SPOT` runs tasks on spare compute capacity. When AWS needs the capacity back, your tasks are interrupted with a two-minute warning. `FARGATE_SPOT` supports Linux tasks with the X86\$164 architecture on platform version 1.3.0 or later. `FARGATE_SPOT` supports Linux tasks with the ARM64 architecture on platform version 1.4.0 or later.

A capacity provider strategy can contain a maximum of 20 capacity providers.

## Syntax
<a name="aws-properties-ecs-taskset-capacityproviderstrategyitem-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-ecs-taskset-capacityproviderstrategyitem-syntax.json"></a>

```
{
  "[Base](#cfn-ecs-taskset-capacityproviderstrategyitem-base)" : Integer,
  "[CapacityProvider](#cfn-ecs-taskset-capacityproviderstrategyitem-capacityprovider)" : String,
  "[Weight](#cfn-ecs-taskset-capacityproviderstrategyitem-weight)" : Integer
}
```

### YAML
<a name="aws-properties-ecs-taskset-capacityproviderstrategyitem-syntax.yaml"></a>

```
  [Base](#cfn-ecs-taskset-capacityproviderstrategyitem-base): Integer
  [CapacityProvider](#cfn-ecs-taskset-capacityproviderstrategyitem-capacityprovider): String
  [Weight](#cfn-ecs-taskset-capacityproviderstrategyitem-weight): Integer
```

## Properties
<a name="aws-properties-ecs-taskset-capacityproviderstrategyitem-properties"></a>

`Base`  <a name="cfn-ecs-taskset-capacityproviderstrategyitem-base"></a>
The *base* value designates how many tasks, at a minimum, to run on the specified capacity provider for each service. Only one capacity provider in a capacity provider strategy can have a *base* defined. If no value is specified, the default value of `0` is used.  
Base value characteristics:  
+ Only one capacity provider in a strategy can have a base defined
+ The default value is `0` if not specified
+ The valid range is 0 to 100,000
+ Base requirements are satisfied first before weight distribution
*Required*: No  
*Type*: Integer  
*Minimum*: `0`  
*Maximum*: `100000`  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`CapacityProvider`  <a name="cfn-ecs-taskset-capacityproviderstrategyitem-capacityprovider"></a>
The short name of the capacity provider. This can be either an AWS managed capacity provider (`FARGATE` or `FARGATE_SPOT`) or the name of a custom capacity provider that you created.  
*Required*: No  
*Type*: String  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`Weight`  <a name="cfn-ecs-taskset-capacityproviderstrategyitem-weight"></a>
The *weight* value designates the relative percentage of the total number of tasks launched that should use the specified capacity provider. The `weight` value is taken into consideration after the `base` value, if defined, is satisfied.  
If no `weight` value is specified, the default value of `0` is used. When multiple capacity providers are specified within a capacity provider strategy, at least one of the capacity providers must have a weight value greater than zero and any capacity providers with a weight of `0` can't be used to place tasks. If you specify multiple capacity providers in a strategy that all have a weight of `0`, any `RunTask` or `CreateService` actions using the capacity provider strategy will fail.  
Weight value characteristics:  
+ Weight is considered after the base value is satisfied
+ The default value is `0` if not specified
+ The valid range is 0 to 1,000
+ At least one capacity provider must have a weight greater than zero
+ Capacity providers with weight of `0` cannot place tasks
Task distribution logic:  

1. Base satisfaction: The minimum number of tasks specified by the base value are placed on that capacity provider

1. Weight distribution: After base requirements are met, additional tasks are distributed according to weight ratios
Examples:  
Equal Distribution: Two capacity providers both with weight `1` will split tasks evenly after base requirements are met.  
Weighted Distribution: If capacityProviderA has weight `1` and capacityProviderB has weight `4`, then for every 1 task on A, 4 tasks will run on B.  
*Required*: No  
*Type*: Integer  
*Minimum*: `0`  
*Maximum*: `1000`  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

# AWS::ECS::TaskSet LoadBalancer
<a name="aws-properties-ecs-taskset-loadbalancer"></a>

The load balancer configuration to use with a service or task set.

When you add, update, or remove a load balancer configuration, Amazon ECS starts a new deployment with the updated Elastic Load Balancing configuration. This causes tasks to register to and deregister from load balancers.

We recommend that you verify this on a test environment before you update the Elastic Load Balancing configuration. 

A service-linked role is required for services that use multiple target groups. For more information, see [Using service-linked roles](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/using-service-linked-roles.html) in the *Amazon Elastic Container Service Developer Guide*.

## Syntax
<a name="aws-properties-ecs-taskset-loadbalancer-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-ecs-taskset-loadbalancer-syntax.json"></a>

```
{
  "[ContainerName](#cfn-ecs-taskset-loadbalancer-containername)" : String,
  "[ContainerPort](#cfn-ecs-taskset-loadbalancer-containerport)" : Integer,
  "[TargetGroupArn](#cfn-ecs-taskset-loadbalancer-targetgrouparn)" : String
}
```

### YAML
<a name="aws-properties-ecs-taskset-loadbalancer-syntax.yaml"></a>

```
  [ContainerName](#cfn-ecs-taskset-loadbalancer-containername): String
  [ContainerPort](#cfn-ecs-taskset-loadbalancer-containerport): Integer
  [TargetGroupArn](#cfn-ecs-taskset-loadbalancer-targetgrouparn): String
```

## Properties
<a name="aws-properties-ecs-taskset-loadbalancer-properties"></a>

`ContainerName`  <a name="cfn-ecs-taskset-loadbalancer-containername"></a>
The name of the container (as it appears in a container definition) to associate with the load balancer.  
You need to specify the container name when configuring the target group for an Amazon ECS load balancer.  
*Required*: No  
*Type*: String  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`ContainerPort`  <a name="cfn-ecs-taskset-loadbalancer-containerport"></a>
The port on the container to associate with the load balancer. This port must correspond to a `containerPort` in the task definition the tasks in the service are using. For tasks that use the EC2 launch type, the container instance they're launched on must allow ingress traffic on the `hostPort` of the port mapping.  
*Required*: No  
*Type*: Integer  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`TargetGroupArn`  <a name="cfn-ecs-taskset-loadbalancer-targetgrouparn"></a>
The full Amazon Resource Name (ARN) of the Elastic Load Balancing target group or groups associated with a service or task set.  
A target group ARN is only specified when using an Application Load Balancer or Network Load Balancer.   
For services using the `ECS` deployment controller, you can specify one or multiple target groups. For more information, see [Registering multiple target groups with a service](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/register-multiple-targetgroups.html) in the *Amazon Elastic Container Service Developer Guide*.  
For services using the `CODE_DEPLOY` deployment controller, you're required to define two target groups for the load balancer. For more information, see [Blue/green deployment with CodeDeploy](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/deployment-type-bluegreen.html) in the *Amazon Elastic Container Service Developer Guide*.  
If your service's task definition uses the `awsvpc` network mode, you must choose `ip` as the target type, not `instance`. Do this when creating your target groups because tasks that use the `awsvpc` network mode are associated with an elastic network interface, not an Amazon EC2 instance. This network mode is required for the Fargate launch type.
*Required*: No  
*Type*: String  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

# AWS::ECS::TaskSet NetworkConfiguration
<a name="aws-properties-ecs-taskset-networkconfiguration"></a>

The network configuration for a task or service.

## Syntax
<a name="aws-properties-ecs-taskset-networkconfiguration-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-ecs-taskset-networkconfiguration-syntax.json"></a>

```
{
  "[AwsVpcConfiguration](#cfn-ecs-taskset-networkconfiguration-awsvpcconfiguration)" : AwsVpcConfiguration
}
```

### YAML
<a name="aws-properties-ecs-taskset-networkconfiguration-syntax.yaml"></a>

```
  [AwsVpcConfiguration](#cfn-ecs-taskset-networkconfiguration-awsvpcconfiguration): 
    AwsVpcConfiguration
```

## Properties
<a name="aws-properties-ecs-taskset-networkconfiguration-properties"></a>

`AwsVpcConfiguration`  <a name="cfn-ecs-taskset-networkconfiguration-awsvpcconfiguration"></a>
The VPC subnets and security groups that are associated with a task.  
All specified subnets and security groups must be from the same VPC.
*Required*: No  
*Type*: [AwsVpcConfiguration](aws-properties-ecs-taskset-awsvpcconfiguration.md)  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

# AWS::ECS::TaskSet Scale
<a name="aws-properties-ecs-taskset-scale"></a>

A floating-point percentage of the desired number of tasks to place and keep running in the task set.

## Syntax
<a name="aws-properties-ecs-taskset-scale-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-ecs-taskset-scale-syntax.json"></a>

```
{
  "[Unit](#cfn-ecs-taskset-scale-unit)" : String,
  "[Value](#cfn-ecs-taskset-scale-value)" : Number
}
```

### YAML
<a name="aws-properties-ecs-taskset-scale-syntax.yaml"></a>

```
  [Unit](#cfn-ecs-taskset-scale-unit): String
  [Value](#cfn-ecs-taskset-scale-value): Number
```

## Properties
<a name="aws-properties-ecs-taskset-scale-properties"></a>

`Unit`  <a name="cfn-ecs-taskset-scale-unit"></a>
The unit of measure for the scale value.  
*Required*: No  
*Type*: String  
*Allowed values*: `PERCENT`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Value`  <a name="cfn-ecs-taskset-scale-value"></a>
The value, specified as a percent total of a service's `desiredCount`, to scale the task set. Accepted values are numbers between 0 and 100.  
*Required*: No  
*Type*: Number  
*Minimum*: `0`  
*Maximum*: `100`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::ECS::TaskSet ServiceRegistry
<a name="aws-properties-ecs-taskset-serviceregistry"></a>

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.

## Syntax
<a name="aws-properties-ecs-taskset-serviceregistry-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-ecs-taskset-serviceregistry-syntax.json"></a>

```
{
  "[ContainerName](#cfn-ecs-taskset-serviceregistry-containername)" : String,
  "[ContainerPort](#cfn-ecs-taskset-serviceregistry-containerport)" : Integer,
  "[Port](#cfn-ecs-taskset-serviceregistry-port)" : Integer,
  "[RegistryArn](#cfn-ecs-taskset-serviceregistry-registryarn)" : String
}
```

### YAML
<a name="aws-properties-ecs-taskset-serviceregistry-syntax.yaml"></a>

```
  [ContainerName](#cfn-ecs-taskset-serviceregistry-containername): String
  [ContainerPort](#cfn-ecs-taskset-serviceregistry-containerport): Integer
  [Port](#cfn-ecs-taskset-serviceregistry-port): Integer
  [RegistryArn](#cfn-ecs-taskset-serviceregistry-registryarn): String
```

## Properties
<a name="aws-properties-ecs-taskset-serviceregistry-properties"></a>

`ContainerName`  <a name="cfn-ecs-taskset-serviceregistry-containername"></a>
The container name value to be used for your service discovery service. It's already specified in the task definition. If the task definition that your service task specifies uses the `bridge` or `host` network mode, you must specify a `containerName` and `containerPort` combination from the task definition. If the task definition that your service task specifies uses the `awsvpc` network mode and a type SRV DNS record is used, you must specify either a `containerName` and `containerPort` combination or a `port` value. However, you can't specify both.  
*Required*: No  
*Type*: String  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`ContainerPort`  <a name="cfn-ecs-taskset-serviceregistry-containerport"></a>
The port value to be used for your service discovery service. It's already specified in the task definition. If the task definition your service task specifies uses the `bridge` or `host` network mode, you must specify a `containerName` and `containerPort` combination from the task definition. If the task definition your service task specifies uses the `awsvpc` network mode and a type SRV DNS record is used, you must specify either a `containerName` and `containerPort` combination or a `port` value. However, you can't specify both.  
*Required*: No  
*Type*: Integer  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`Port`  <a name="cfn-ecs-taskset-serviceregistry-port"></a>
The port value used if your service discovery service specified an SRV record. This field might be used if both the `awsvpc` network mode and SRV records are used.  
*Required*: No  
*Type*: Integer  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`RegistryArn`  <a name="cfn-ecs-taskset-serviceregistry-registryarn"></a>
The Amazon Resource Name (ARN) of the service registry. The currently supported service registry is AWS Cloud Map. For more information, see [CreateService](https://docs.aws.amazon.com/cloud-map/latest/api/API_CreateService.html).  
*Required*: No  
*Type*: String  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

# AWS::ECS::TaskSet Tag
<a name="aws-properties-ecs-taskset-tag"></a>

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: \$1 - = . \$1 : / @.
+ 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 AWS 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.

## Syntax
<a name="aws-properties-ecs-taskset-tag-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-ecs-taskset-tag-syntax.json"></a>

```
{
  "[Key](#cfn-ecs-taskset-tag-key)" : String,
  "[Value](#cfn-ecs-taskset-tag-value)" : String
}
```

### YAML
<a name="aws-properties-ecs-taskset-tag-syntax.yaml"></a>

```
  [Key](#cfn-ecs-taskset-tag-key): String
  [Value](#cfn-ecs-taskset-tag-value): String
```

## Properties
<a name="aws-properties-ecs-taskset-tag-properties"></a>

`Key`  <a name="cfn-ecs-taskset-tag-key"></a>
One part of a key-value pair that make up a tag. A `key` is a general label that acts like a category for more specific tag values.  
*Required*: No  
*Type*: String  
*Pattern*: `([\p{L}\p{Z}\p{N}_.:/=+\-@]*)`  
*Minimum*: `1`  
*Maximum*: `128`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Value`  <a name="cfn-ecs-taskset-tag-value"></a>
The optional part of a key-value pair that make up a tag. A `value` acts as a descriptor within a tag category (key).  
*Required*: No  
*Type*: String  
*Pattern*: `([\p{L}\p{Z}\p{N}_.:/=+\-@]*)`  
*Minimum*: `0`  
*Maximum*: `256`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)