v1

latestOpenAPI 3.0.0Apache 2.0 License2026-07-1456373564.1 KB

Starts a new task from the specified task definition on the specified container instance or instances.

Starting April 15, 2023, Amazon Web Services will not onboard new customers to Amazon Elastic Inference (EI), and will help current customers migrate their workloads to options that offer better price and performance. After April 15, 2023, new customers will not be able to launch instances with Amazon EI accelerators in Amazon SageMaker, Amazon ECS, or Amazon EC2. However, customers who have used Amazon EI at least once during the past 30-day period are considered current customers and will be able to continue using the service.

Alternatively, you can use RunTask to place tasks for you. For more information, see Scheduling Tasks in the Amazon Elastic Container Service Developer Guide.

post/#X-Amz-Target=AmazonEC2ContainerServiceV20141113.StartTask

Headers

X-Amz-Target'AmazonEC2ContainerServiceV20141113.StartTask' required

Request body

clusterstring

The short name or full Amazon Resource Name (ARN) of the cluster where to start your task. If you do not specify a cluster, the default cluster is assumed.

containerInstancesString[] required

The container instance IDs or full ARN entries for the container instances where you would like to place your task. You can specify up to 10 container instances.

enableECSManagedTagsboolean

Specifies whether to use Amazon ECS managed tags for the task. For more information, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-using-tags.html">Tagging Your Amazon ECS Resources</a> in the <i>Amazon Elastic Container Service Developer Guide</i>.

enableExecuteCommandboolean

Whether or not the execute command functionality is turned on for the task. If <code>true</code>, this turns on the execute command functionality on all containers in the task.

groupstring

The name of the task group to associate with the task. The default value is the family name of the task definition (for example, family:my-family-name).

propagateTags'TASK_DEFINITION' | 'SERVICE' | 'NONE'

Specifies whether to propagate the tags from the task definition or the service to the task. If no value is specified, the tags aren't propagated.

referenceIdstring

The reference ID to use for the task.

startedBystring
<p>An optional tag specified when a task is started. For example, if you automatically trigger a task to run a batch process job, you could apply a unique identifier for that job to your task with the <code>startedBy</code> parameter. You can then identify which tasks belong to that job by filtering the results of a <a>ListTasks</a> call with the <code>startedBy</code> value. Up to 36 letters (uppercase and lowercase), numbers, hyphens (-), and underscores (_) are allowed.</p> <p>If a task is started by an Amazon ECS service, the <code>startedBy</code> parameter contains the deployment ID of the service that starts it.</p>
taskDefinitionstring required

The <code>family</code> and <code>revision</code> (<code>family:revision</code>) or full ARN of the task definition to start. If a <code>revision</code> isn't specified, the latest <code>ACTIVE</code> revision is used.

Response

Success