Amazon Elastic Container Service
API Reference (API Version 2014-11-13)

The AWS Documentation website is getting a new look!
Try it now and let us know what you think. Switch to the new look >>

You can return to the original look by selecting English in the language selector above.

CreateTaskSet

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 in the Amazon Elastic Container Service Developer Guide.

Request Syntax

{ "clientToken": "string", "cluster": "string", "externalId": "string", "launchType": "string", "loadBalancers": [ { "containerName": "string", "containerPort": number, "loadBalancerName": "string", "targetGroupArn": "string" } ], "networkConfiguration": { "awsvpcConfiguration": { "assignPublicIp": "string", "securityGroups": [ "string" ], "subnets": [ "string" ] } }, "platformVersion": "string", "scale": { "unit": "string", "value": number }, "service": "string", "serviceRegistries": [ { "containerName": "string", "containerPort": number, "port": number, "registryArn": "string" } ], "taskDefinition": "string" }

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

The request accepts the following data in JSON format.

clientToken

Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Up to 32 ASCII characters are allowed.

Type: String

Required: No

cluster

The short name or full Amazon Resource Name (ARN) of the cluster that hosts the service to create the task set in.

Type: String

Required: Yes

externalId

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.

Type: String

Required: No

launchType

The launch type that new tasks in the task set will use. For more information, see Amazon ECS Launch Types in the Amazon Elastic Container Service Developer Guide.

Type: String

Valid Values: EC2 | FARGATE

Required: No

loadBalancers

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.

Type: Array of LoadBalancer objects

Required: No

networkConfiguration

An object representing the network configuration for a task or service.

Type: NetworkConfiguration object

Required: No

platformVersion

The platform version that the tasks in the task set should use. A platform version is specified only for tasks using the Fargate launch type. If one isn't specified, the LATEST platform version is used by default.

Type: String

Required: No

scale

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

Type: Scale object

Required: No

service

The short name or full Amazon Resource Name (ARN) of the service to create the task set in.

Type: String

Required: Yes

serviceRegistries

The details of the service discovery registries to assign to this task set. For more information, see Service Discovery.

Type: Array of ServiceRegistry objects

Required: No

taskDefinition

The task definition for the tasks in the task set to use.

Type: String

Required: Yes

Response Syntax

{ "taskSet": { "clusterArn": "string", "computedDesiredCount": number, "createdAt": number, "externalId": "string", "id": "string", "launchType": "string", "loadBalancers": [ { "containerName": "string", "containerPort": number, "loadBalancerName": "string", "targetGroupArn": "string" } ], "networkConfiguration": { "awsvpcConfiguration": { "assignPublicIp": "string", "securityGroups": [ "string" ], "subnets": [ "string" ] } }, "pendingCount": number, "platformVersion": "string", "runningCount": number, "scale": { "unit": "string", "value": number }, "serviceArn": "string", "serviceRegistries": [ { "containerName": "string", "containerPort": number, "port": number, "registryArn": "string" } ], "stabilityStatus": "string", "stabilityStatusAt": number, "startedBy": "string", "status": "string", "taskDefinition": "string", "taskSetArn": "string", "updatedAt": number } }

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

taskSet

Information about a set of Amazon ECS tasks in either an AWS CodeDeploy or an EXTERNAL deployment. An Amazon ECS task set includes details such as the desired number of tasks, how many tasks are running, and whether the task set serves production traffic.

Type: TaskSet object

Errors

For information about the errors that are common to all actions, see Common Errors.

AccessDeniedException

You do not have authorization to perform the requested action.

HTTP Status Code: 400

ClientException

These errors are usually caused by a client action, such as using an action or resource on behalf of a user that doesn't have permissions to use the action or resource, or specifying an identifier that is not valid.

HTTP Status Code: 400

ClusterNotFoundException

The specified cluster could not be found. You can view your available clusters with ListClusters. Amazon ECS clusters are Region-specific.

HTTP Status Code: 400

InvalidParameterException

The specified parameter is invalid. Review the available parameters for the API request.

HTTP Status Code: 400

PlatformTaskDefinitionIncompatibilityException

The specified platform version does not satisfy the task definition's required capabilities.

HTTP Status Code: 400

PlatformUnknownException

The specified platform version does not exist.

HTTP Status Code: 400

ServerException

These errors are usually caused by a server issue.

HTTP Status Code: 500

ServiceNotActiveException

The specified service is not active. You can't update a service that is inactive. If you have previously deleted a service, you can re-create it with CreateService.

HTTP Status Code: 400

ServiceNotFoundException

The specified service could not be found. You can view your available services with ListServices. Amazon ECS services are cluster-specific and Region-specific.

HTTP Status Code: 400

UnsupportedFeatureException

The specified task is not supported in this Region.

HTTP Status Code: 400

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: