

# Actions


The following actions are supported:
+  [CreateCapacityProvider](API_CreateCapacityProvider.md) 
+  [CreateCluster](API_CreateCluster.md) 
+  [CreateDaemon](API_CreateDaemon.md) 
+  [CreateExpressGatewayService](API_CreateExpressGatewayService.md) 
+  [CreateService](API_CreateService.md) 
+  [CreateTaskSet](API_CreateTaskSet.md) 
+  [DeleteAccountSetting](API_DeleteAccountSetting.md) 
+  [DeleteAttributes](API_DeleteAttributes.md) 
+  [DeleteCapacityProvider](API_DeleteCapacityProvider.md) 
+  [DeleteCluster](API_DeleteCluster.md) 
+  [DeleteDaemon](API_DeleteDaemon.md) 
+  [DeleteDaemonTaskDefinition](API_DeleteDaemonTaskDefinition.md) 
+  [DeleteExpressGatewayService](API_DeleteExpressGatewayService.md) 
+  [DeleteService](API_DeleteService.md) 
+  [DeleteTaskDefinitions](API_DeleteTaskDefinitions.md) 
+  [DeleteTaskSet](API_DeleteTaskSet.md) 
+  [DeregisterContainerInstance](API_DeregisterContainerInstance.md) 
+  [DeregisterTaskDefinition](API_DeregisterTaskDefinition.md) 
+  [DescribeCapacityProviders](API_DescribeCapacityProviders.md) 
+  [DescribeClusters](API_DescribeClusters.md) 
+  [DescribeContainerInstances](API_DescribeContainerInstances.md) 
+  [DescribeDaemon](API_DescribeDaemon.md) 
+  [DescribeDaemonDeployments](API_DescribeDaemonDeployments.md) 
+  [DescribeDaemonRevisions](API_DescribeDaemonRevisions.md) 
+  [DescribeDaemonTaskDefinition](API_DescribeDaemonTaskDefinition.md) 
+  [DescribeExpressGatewayService](API_DescribeExpressGatewayService.md) 
+  [DescribeServiceDeployments](API_DescribeServiceDeployments.md) 
+  [DescribeServiceRevisions](API_DescribeServiceRevisions.md) 
+  [DescribeServices](API_DescribeServices.md) 
+  [DescribeTaskDefinition](API_DescribeTaskDefinition.md) 
+  [DescribeTasks](API_DescribeTasks.md) 
+  [DescribeTaskSets](API_DescribeTaskSets.md) 
+  [DiscoverPollEndpoint](API_DiscoverPollEndpoint.md) 
+  [ExecuteCommand](API_ExecuteCommand.md) 
+  [GetTaskProtection](API_GetTaskProtection.md) 
+  [ListAccountSettings](API_ListAccountSettings.md) 
+  [ListAttributes](API_ListAttributes.md) 
+  [ListClusters](API_ListClusters.md) 
+  [ListContainerInstances](API_ListContainerInstances.md) 
+  [ListDaemonDeployments](API_ListDaemonDeployments.md) 
+  [ListDaemons](API_ListDaemons.md) 
+  [ListDaemonTaskDefinitions](API_ListDaemonTaskDefinitions.md) 
+  [ListServiceDeployments](API_ListServiceDeployments.md) 
+  [ListServices](API_ListServices.md) 
+  [ListServicesByNamespace](API_ListServicesByNamespace.md) 
+  [ListTagsForResource](API_ListTagsForResource.md) 
+  [ListTaskDefinitionFamilies](API_ListTaskDefinitionFamilies.md) 
+  [ListTaskDefinitions](API_ListTaskDefinitions.md) 
+  [ListTasks](API_ListTasks.md) 
+  [PutAccountSetting](API_PutAccountSetting.md) 
+  [PutAccountSettingDefault](API_PutAccountSettingDefault.md) 
+  [PutAttributes](API_PutAttributes.md) 
+  [PutClusterCapacityProviders](API_PutClusterCapacityProviders.md) 
+  [RegisterContainerInstance](API_RegisterContainerInstance.md) 
+  [RegisterDaemonTaskDefinition](API_RegisterDaemonTaskDefinition.md) 
+  [RegisterTaskDefinition](API_RegisterTaskDefinition.md) 
+  [RunTask](API_RunTask.md) 
+  [StartTask](API_StartTask.md) 
+  [StopServiceDeployment](API_StopServiceDeployment.md) 
+  [StopTask](API_StopTask.md) 
+  [SubmitAttachmentStateChanges](API_SubmitAttachmentStateChanges.md) 
+  [SubmitContainerStateChange](API_SubmitContainerStateChange.md) 
+  [SubmitTaskStateChange](API_SubmitTaskStateChange.md) 
+  [TagResource](API_TagResource.md) 
+  [UntagResource](API_UntagResource.md) 
+  [UpdateCapacityProvider](API_UpdateCapacityProvider.md) 
+  [UpdateCluster](API_UpdateCluster.md) 
+  [UpdateClusterSettings](API_UpdateClusterSettings.md) 
+  [UpdateContainerAgent](API_UpdateContainerAgent.md) 
+  [UpdateContainerInstancesState](API_UpdateContainerInstancesState.md) 
+  [UpdateDaemon](API_UpdateDaemon.md) 
+  [UpdateExpressGatewayService](API_UpdateExpressGatewayService.md) 
+  [UpdateService](API_UpdateService.md) 
+  [UpdateServicePrimaryTaskSet](API_UpdateServicePrimaryTaskSet.md) 
+  [UpdateTaskProtection](API_UpdateTaskProtection.md) 
+  [UpdateTaskSet](API_UpdateTaskSet.md) 

# CreateCapacityProvider


Creates a capacity provider. Capacity providers are associated with a cluster and are used in capacity provider strategies to facilitate cluster auto scaling. You can create capacity providers for Amazon ECS Managed Instances and EC2 instances. Amazon Fargate has the predefined `FARGATE` and `FARGATE_SPOT` capacity providers.

## Request Syntax


```
{
   "autoScalingGroupProvider": { 
      "autoScalingGroupArn": "string",
      "managedDraining": "string",
      "managedScaling": { 
         "instanceWarmupPeriod": number,
         "maximumScalingStepSize": number,
         "minimumScalingStepSize": number,
         "status": "string",
         "targetCapacity": number
      },
      "managedTerminationProtection": "string"
   },
   "cluster": "string",
   "managedInstancesProvider": { 
      "infrastructureOptimization": { 
         "scaleInAfter": number
      },
      "infrastructureRoleArn": "string",
      "instanceLaunchTemplate": { 
         "capacityOptionType": "string",
         "capacityReservations": { 
            "reservationGroupArn": "string",
            "reservationPreference": "string"
         },
         "ec2InstanceProfileArn": "string",
         "fipsEnabled": boolean,
         "instanceMetadataTagsPropagation": boolean,
         "instanceRequirements": { 
            "acceleratorCount": { 
               "max": number,
               "min": number
            },
            "acceleratorManufacturers": [ "string" ],
            "acceleratorNames": [ "string" ],
            "acceleratorTotalMemoryMiB": { 
               "max": number,
               "min": number
            },
            "acceleratorTypes": [ "string" ],
            "allowedInstanceTypes": [ "string" ],
            "bareMetal": "string",
            "baselineEbsBandwidthMbps": { 
               "max": number,
               "min": number
            },
            "burstablePerformance": "string",
            "cpuManufacturers": [ "string" ],
            "excludedInstanceTypes": [ "string" ],
            "instanceGenerations": [ "string" ],
            "localStorage": "string",
            "localStorageTypes": [ "string" ],
            "maxSpotPriceAsPercentageOfOptimalOnDemandPrice": number,
            "memoryGiBPerVCpu": { 
               "max": number,
               "min": number
            },
            "memoryMiB": { 
               "max": number,
               "min": number
            },
            "networkBandwidthGbps": { 
               "max": number,
               "min": number
            },
            "networkInterfaceCount": { 
               "max": number,
               "min": number
            },
            "onDemandMaxPricePercentageOverLowestPrice": number,
            "requireHibernateSupport": boolean,
            "spotMaxPricePercentageOverLowestPrice": number,
            "totalLocalStorageGB": { 
               "max": number,
               "min": number
            },
            "vCpuCount": { 
               "max": number,
               "min": number
            }
         },
         "localStorageConfiguration": { 
            "useLocalStorage": boolean
         },
         "monitoring": "string",
         "networkConfiguration": { 
            "securityGroups": [ "string" ],
            "subnets": [ "string" ]
         },
         "storageConfiguration": { 
            "storageSizeGiB": number
         }
      },
      "propagateTags": "string"
   },
   "name": "string",
   "tags": [ 
      { 
         "key": "string",
         "value": "string"
      }
   ]
}
```

## Request Parameters


For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [autoScalingGroupProvider](#API_CreateCapacityProvider_RequestSyntax) **   <a name="ECS-CreateCapacityProvider-request-autoScalingGroupProvider"></a>
The details of the Auto Scaling group for the capacity provider.  
Type: [AutoScalingGroupProvider](API_AutoScalingGroupProvider.md) object  
Required: No

 ** [cluster](#API_CreateCapacityProvider_RequestSyntax) **   <a name="ECS-CreateCapacityProvider-request-cluster"></a>
The name of the cluster to associate with the capacity provider. When you create a capacity provider with Amazon ECS Managed Instances, it becomes available only within the specified cluster.  
Type: String  
Required: No

 ** [managedInstancesProvider](#API_CreateCapacityProvider_RequestSyntax) **   <a name="ECS-CreateCapacityProvider-request-managedInstancesProvider"></a>
The configuration for the Amazon ECS Managed Instances provider. This configuration specifies how Amazon ECS manages Amazon EC2 instances on your behalf, including the infrastructure role, instance launch template, and tag propagation settings.  
Type: [CreateManagedInstancesProviderConfiguration](API_CreateManagedInstancesProviderConfiguration.md) object  
Required: No

 ** [name](#API_CreateCapacityProvider_RequestSyntax) **   <a name="ECS-CreateCapacityProvider-request-name"></a>
The name of the capacity provider. Up to 255 characters are allowed. They include letters (both upper and lowercase letters), numbers, underscores (\$1), and hyphens (-). The name can't be prefixed with "`aws`", "`ecs`", or "`fargate`".  
Type: String  
Required: Yes

 ** [tags](#API_CreateCapacityProvider_RequestSyntax) **   <a name="ECS-CreateCapacityProvider-request-tags"></a>
The metadata that you apply to the capacity provider to categorize and organize them more conveniently. 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: \$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 Amazon 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.
Type: Array of [Tag](API_Tag.md) objects  
Array Members: Minimum number of 0 items. Maximum number of 50 items.  
Required: No

## Response Syntax


```
{
   "capacityProvider": { 
      "autoScalingGroupProvider": { 
         "autoScalingGroupArn": "string",
         "managedDraining": "string",
         "managedScaling": { 
            "instanceWarmupPeriod": number,
            "maximumScalingStepSize": number,
            "minimumScalingStepSize": number,
            "status": "string",
            "targetCapacity": number
         },
         "managedTerminationProtection": "string"
      },
      "capacityProviderArn": "string",
      "cluster": "string",
      "managedInstancesProvider": { 
         "infrastructureOptimization": { 
            "scaleInAfter": number
         },
         "infrastructureRoleArn": "string",
         "instanceLaunchTemplate": { 
            "capacityOptionType": "string",
            "capacityReservations": { 
               "reservationGroupArn": "string",
               "reservationPreference": "string"
            },
            "ec2InstanceProfileArn": "string",
            "fipsEnabled": boolean,
            "instanceMetadataTagsPropagation": boolean,
            "instanceRequirements": { 
               "acceleratorCount": { 
                  "max": number,
                  "min": number
               },
               "acceleratorManufacturers": [ "string" ],
               "acceleratorNames": [ "string" ],
               "acceleratorTotalMemoryMiB": { 
                  "max": number,
                  "min": number
               },
               "acceleratorTypes": [ "string" ],
               "allowedInstanceTypes": [ "string" ],
               "bareMetal": "string",
               "baselineEbsBandwidthMbps": { 
                  "max": number,
                  "min": number
               },
               "burstablePerformance": "string",
               "cpuManufacturers": [ "string" ],
               "excludedInstanceTypes": [ "string" ],
               "instanceGenerations": [ "string" ],
               "localStorage": "string",
               "localStorageTypes": [ "string" ],
               "maxSpotPriceAsPercentageOfOptimalOnDemandPrice": number,
               "memoryGiBPerVCpu": { 
                  "max": number,
                  "min": number
               },
               "memoryMiB": { 
                  "max": number,
                  "min": number
               },
               "networkBandwidthGbps": { 
                  "max": number,
                  "min": number
               },
               "networkInterfaceCount": { 
                  "max": number,
                  "min": number
               },
               "onDemandMaxPricePercentageOverLowestPrice": number,
               "requireHibernateSupport": boolean,
               "spotMaxPricePercentageOverLowestPrice": number,
               "totalLocalStorageGB": { 
                  "max": number,
                  "min": number
               },
               "vCpuCount": { 
                  "max": number,
                  "min": number
               }
            },
            "localStorageConfiguration": { 
               "useLocalStorage": boolean
            },
            "monitoring": "string",
            "networkConfiguration": { 
               "securityGroups": [ "string" ],
               "subnets": [ "string" ]
            },
            "storageConfiguration": { 
               "storageSizeGiB": number
            }
         },
         "propagateTags": "string"
      },
      "name": "string",
      "status": "string",
      "tags": [ 
         { 
            "key": "string",
            "value": "string"
         }
      ],
      "type": "string",
      "updateStatus": "string",
      "updateStatusReason": "string"
   }
}
```

## 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.

 ** [capacityProvider](#API_CreateCapacityProvider_ResponseSyntax) **   <a name="ECS-CreateCapacityProvider-response-capacityProvider"></a>
The full description of the new capacity provider.  
Type: [CapacityProvider](API_CapacityProvider.md) object

## Errors


For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** ClientException **   
These errors are usually caused by a client action. This client action might be using an action or resource on behalf of a user that doesn't have permissions to use the action or resource. Or, it might be specifying an identifier that isn't valid.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ClusterNotFoundException **   
The specified cluster wasn't found. You can view your available clusters with [ListClusters](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_ListClusters.html). Amazon ECS clusters are Region specific.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** InvalidParameterException **   
The specified parameter isn't valid. Review the available parameters for the API request.  
For more information about service event errors, see [Amazon ECS service event messages](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/service-event-messages-list.html).     
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** LimitExceededException **   
The limit for the resource was exceeded.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ServerException **   
These errors are usually caused by a server issue.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 500

 ** UnsupportedFeatureException **   
The specified task isn't supported in this Region.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** UpdateInProgressException **   
There's already a current Amazon ECS container agent update in progress on the container instance that's specified. If the container agent becomes disconnected while it's in a transitional stage, such as `PENDING` or `STAGING`, the update process can get stuck in that state. However, when the agent reconnects, it resumes where it stopped previously.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

## See Also


For more information about using this API in one of the language-specific Amazon SDKs, see the following:
+  [Amazon Command Line Interface V2](https://docs.amazonaws.cn/goto/cli2/ecs-2014-11-13/CreateCapacityProvider) 
+  [Amazon SDK for .NET V4](https://docs.amazonaws.cn/goto/DotNetSDKV4/ecs-2014-11-13/CreateCapacityProvider) 
+  [Amazon SDK for C\$1\$1](https://docs.amazonaws.cn/goto/SdkForCpp/ecs-2014-11-13/CreateCapacityProvider) 
+  [Amazon SDK for Go v2](https://docs.amazonaws.cn/goto/SdkForGoV2/ecs-2014-11-13/CreateCapacityProvider) 
+  [Amazon SDK for Java V2](https://docs.amazonaws.cn/goto/SdkForJavaV2/ecs-2014-11-13/CreateCapacityProvider) 
+  [Amazon SDK for JavaScript V3](https://docs.amazonaws.cn/goto/SdkForJavaScriptV3/ecs-2014-11-13/CreateCapacityProvider) 
+  [Amazon SDK for Kotlin](https://docs.amazonaws.cn/goto/SdkForKotlin/ecs-2014-11-13/CreateCapacityProvider) 
+  [Amazon SDK for PHP V3](https://docs.amazonaws.cn/goto/SdkForPHPV3/ecs-2014-11-13/CreateCapacityProvider) 
+  [Amazon SDK for Python](https://docs.amazonaws.cn/goto/boto3/ecs-2014-11-13/CreateCapacityProvider) 
+  [Amazon SDK for Ruby V3](https://docs.amazonaws.cn/goto/SdkForRubyV3/ecs-2014-11-13/CreateCapacityProvider) 

# CreateCluster


Creates a new Amazon ECS cluster. By default, your account receives a `default` cluster when you launch your first container instance. However, you can create your own cluster with a unique name.

**Note**  
When you call the [CreateCluster](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_CreateCluster.html) API operation, Amazon ECS attempts to create the Amazon ECS service-linked role for your account. This is so that it can manage required resources in other Amazon services on your behalf. However, if the user that makes the call doesn't have permissions to create the service-linked role, it isn't created. For more information, see [Using service-linked roles for Amazon ECS](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/using-service-linked-roles.html) in the *Amazon Elastic Container Service Developer Guide*.

## Request Syntax


```
{
   "capacityProviders": [ "string" ],
   "clusterName": "string",
   "configuration": { 
      "executeCommandConfiguration": { 
         "kmsKeyId": "string",
         "logConfiguration": { 
            "cloudWatchEncryptionEnabled": boolean,
            "cloudWatchLogGroupName": "string",
            "s3BucketName": "string",
            "s3EncryptionEnabled": boolean,
            "s3KeyPrefix": "string"
         },
         "logging": "string"
      },
      "managedStorageConfiguration": { 
         "fargateEphemeralStorageKmsKeyId": "string",
         "kmsKeyId": "string"
      }
   },
   "defaultCapacityProviderStrategy": [ 
      { 
         "base": number,
         "capacityProvider": "string",
         "weight": number
      }
   ],
   "serviceConnectDefaults": { 
      "namespace": "string"
   },
   "settings": [ 
      { 
         "name": "string",
         "value": "string"
      }
   ],
   "tags": [ 
      { 
         "key": "string",
         "value": "string"
      }
   ]
}
```

## Request Parameters


For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [capacityProviders](#API_CreateCluster_RequestSyntax) **   <a name="ECS-CreateCluster-request-capacityProviders"></a>
The short name of one or more capacity providers to associate with the cluster. A capacity provider must be associated with a cluster before it can be included as part of the default capacity provider strategy of the cluster or used in a capacity provider strategy when calling the [CreateService](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_CreateService.html) or [RunTask](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_RunTask.html) actions.  
If specifying a capacity provider that uses an Auto Scaling group, the capacity provider must be created but not associated with another cluster. New Auto Scaling group capacity providers can be created with the [CreateCapacityProvider](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_CreateCapacityProvider.html) API operation.  
To use a Amazon Fargate capacity provider, specify either the `FARGATE` or `FARGATE_SPOT` capacity providers. The Amazon Fargate capacity providers are available to all accounts and only need to be associated with a cluster to be used.  
The [PutCapacityProvider](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_PutCapacityProvider.html) API operation is used to update the list of available capacity providers for a cluster after the cluster is created.  
Type: Array of strings  
Required: No

 ** [clusterName](#API_CreateCluster_RequestSyntax) **   <a name="ECS-CreateCluster-request-clusterName"></a>
The name of your cluster. If you don't specify a name for your cluster, you create a cluster that's named `default`. Up to 255 letters (uppercase and lowercase), numbers, underscores, and hyphens are allowed.   
Type: String  
Required: No

 ** [configuration](#API_CreateCluster_RequestSyntax) **   <a name="ECS-CreateCluster-request-configuration"></a>
The `execute` command configuration for the cluster.  
Type: [ClusterConfiguration](API_ClusterConfiguration.md) object  
Required: No

 ** [defaultCapacityProviderStrategy](#API_CreateCluster_RequestSyntax) **   <a name="ECS-CreateCluster-request-defaultCapacityProviderStrategy"></a>
The capacity provider strategy to set as the default for the cluster. After a default capacity provider strategy is set for a cluster, when you call the [CreateService](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_CreateService.html) or [RunTask](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_RunTask.html) APIs with no capacity provider strategy or launch type specified, the default capacity provider strategy for the cluster is used.  
If a default capacity provider strategy isn't defined for a cluster when it was created, it can be defined later with the [PutClusterCapacityProviders](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_PutClusterCapacityProviders.html) API operation.  
Type: Array of [CapacityProviderStrategyItem](API_CapacityProviderStrategyItem.md) objects  
Required: No

 ** [serviceConnectDefaults](#API_CreateCluster_RequestSyntax) **   <a name="ECS-CreateCluster-request-serviceConnectDefaults"></a>
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](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/service-connect.html) in the *Amazon Elastic Container Service Developer Guide*.  
Type: [ClusterServiceConnectDefaultsRequest](API_ClusterServiceConnectDefaultsRequest.md) object  
Required: No

 ** [settings](#API_CreateCluster_RequestSyntax) **   <a name="ECS-CreateCluster-request-settings"></a>
The setting to use when creating a cluster. This parameter is used to turn on CloudWatch Container Insights for a cluster. If this value is specified, it overrides the `containerInsights` value set with [PutAccountSetting](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_PutAccountSetting.html) or [PutAccountSettingDefault](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_PutAccountSettingDefault.html).  
Type: Array of [ClusterSetting](API_ClusterSetting.md) objects  
Required: No

 ** [tags](#API_CreateCluster_RequestSyntax) **   <a name="ECS-CreateCluster-request-tags"></a>
The metadata that you apply to the cluster 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 Amazon 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.
Type: Array of [Tag](API_Tag.md) objects  
Array Members: Minimum number of 0 items. Maximum number of 50 items.  
Required: No

## Response Syntax


```
{
   "cluster": { 
      "activeServicesCount": number,
      "attachments": [ 
         { 
            "details": [ 
               { 
                  "name": "string",
                  "value": "string"
               }
            ],
            "id": "string",
            "status": "string",
            "type": "string"
         }
      ],
      "attachmentsStatus": "string",
      "capacityProviders": [ "string" ],
      "clusterArn": "string",
      "clusterName": "string",
      "configuration": { 
         "executeCommandConfiguration": { 
            "kmsKeyId": "string",
            "logConfiguration": { 
               "cloudWatchEncryptionEnabled": boolean,
               "cloudWatchLogGroupName": "string",
               "s3BucketName": "string",
               "s3EncryptionEnabled": boolean,
               "s3KeyPrefix": "string"
            },
            "logging": "string"
         },
         "managedStorageConfiguration": { 
            "fargateEphemeralStorageKmsKeyId": "string",
            "kmsKeyId": "string"
         }
      },
      "defaultCapacityProviderStrategy": [ 
         { 
            "base": number,
            "capacityProvider": "string",
            "weight": number
         }
      ],
      "pendingTasksCount": number,
      "registeredContainerInstancesCount": number,
      "runningTasksCount": number,
      "serviceConnectDefaults": { 
         "namespace": "string"
      },
      "settings": [ 
         { 
            "name": "string",
            "value": "string"
         }
      ],
      "statistics": [ 
         { 
            "name": "string",
            "value": "string"
         }
      ],
      "status": "string",
      "tags": [ 
         { 
            "key": "string",
            "value": "string"
         }
      ]
   }
}
```

## 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.

 ** [cluster](#API_CreateCluster_ResponseSyntax) **   <a name="ECS-CreateCluster-response-cluster"></a>
The full description of your new cluster.  
Type: [Cluster](API_Cluster.md) object

## Errors


For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** ClientException **   
These errors are usually caused by a client action. This client action might be using an action or resource on behalf of a user that doesn't have permissions to use the action or resource. Or, it might be specifying an identifier that isn't valid.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** InvalidParameterException **   
The specified parameter isn't valid. Review the available parameters for the API request.  
For more information about service event errors, see [Amazon ECS service event messages](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/service-event-messages-list.html).     
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** NamespaceNotFoundException **   
The specified namespace wasn't found.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ServerException **   
These errors are usually caused by a server issue.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 500

## Examples


In the following example or examples, the Authorization header contents (`AUTHPARAMS`) must be replaced with an Amazon Signature Version 4 signature. For more information, see [Signature Version 4 Signing Process](https://docs.amazonaws.cn/general/latest/gr/signature-version-4.html) in the * Amazon General Reference*.

You only need to learn how to sign HTTP requests if you intend to create them manually. When you use the [Amazon Command Line Interface](http://www.amazonaws.cn/cli/) or one of the [Amazon SDKs](http://www.amazonaws.cn/tools/) to make requests to Amazon, these tools automatically sign the requests for you, with the access key that you specify when you configure the tools. When you use these tools, you don't have to sign requests yourself.

### Example


This example request creates a cluster called `My-cluster`.

#### Sample Request


```
POST / HTTP/1.1
Host: ecs.us-east-1.amazonaws.com
Accept-Encoding: identity
Content-Length: 29
X-Amz-Target: AmazonEC2ContainerServiceV20141113.CreateCluster
X-Amz-Date: 20150429T163840Z
Content-Type: application/x-amz-json-1.1
Authorization: AUTHPARAMS

{
  "clusterName": "My-cluster"
}
```

#### Sample Response


```
HTTP/1.1 200 OK
Server: Server
Date: Wed, 29 Apr 2015 16:38:41 GMT
Content-Type: application/x-amz-json-1.1
Content-Length: 209
Connection: keep-alive
x-amzn-RequestId: 123a4b56-7c89-01d2-3ef4-example5678f

{
  "cluster": {
    "activeServicesCount": 0,
    "clusterArn": "arn:aws:ecs:us-east-1:012345678910:cluster/My-cluster",
    "clusterName": "My-cluster",
    "pendingTasksCount": 0,
    "registeredContainerInstancesCount": 0,
    "runningTasksCount": 0,
    "status": "ACTIVE"
  }
}
```

## See Also


For more information about using this API in one of the language-specific Amazon SDKs, see the following:
+  [Amazon Command Line Interface V2](https://docs.amazonaws.cn/goto/cli2/ecs-2014-11-13/CreateCluster) 
+  [Amazon SDK for .NET V4](https://docs.amazonaws.cn/goto/DotNetSDKV4/ecs-2014-11-13/CreateCluster) 
+  [Amazon SDK for C\$1\$1](https://docs.amazonaws.cn/goto/SdkForCpp/ecs-2014-11-13/CreateCluster) 
+  [Amazon SDK for Go v2](https://docs.amazonaws.cn/goto/SdkForGoV2/ecs-2014-11-13/CreateCluster) 
+  [Amazon SDK for Java V2](https://docs.amazonaws.cn/goto/SdkForJavaV2/ecs-2014-11-13/CreateCluster) 
+  [Amazon SDK for JavaScript V3](https://docs.amazonaws.cn/goto/SdkForJavaScriptV3/ecs-2014-11-13/CreateCluster) 
+  [Amazon SDK for Kotlin](https://docs.amazonaws.cn/goto/SdkForKotlin/ecs-2014-11-13/CreateCluster) 
+  [Amazon SDK for PHP V3](https://docs.amazonaws.cn/goto/SdkForPHPV3/ecs-2014-11-13/CreateCluster) 
+  [Amazon SDK for Python](https://docs.amazonaws.cn/goto/boto3/ecs-2014-11-13/CreateCluster) 
+  [Amazon SDK for Ruby V3](https://docs.amazonaws.cn/goto/SdkForRubyV3/ecs-2014-11-13/CreateCluster) 

# CreateDaemon


Creates a new daemon in the specified cluster and capacity providers. A daemon deploys cross-cutting software agents such as security monitoring, telemetry, and logging independently across your Amazon ECS infrastructure.

Amazon ECS deploys exactly one daemon task on each container instance of the specified capacity providers. When a container instance registers with the cluster, Amazon ECS automatically starts daemon tasks. Amazon ECS starts a daemon task before scheduling other tasks.

Daemons are essential for instance health - if a daemon task stops, Amazon ECS automatically drains and replaces that container instance.

**Note**  
ECS Managed Daemons is only supported for Amazon ECS Managed Instances Capacity Providers.

## Request Syntax


```
{
   "capacityProviderArns": [ "string" ],
   "clientToken": "string",
   "clusterArn": "string",
   "daemonName": "string",
   "daemonTaskDefinitionArn": "string",
   "deploymentConfiguration": { 
      "alarms": { 
         "alarmNames": [ "string" ],
         "enable": boolean
      },
      "bakeTimeInMinutes": number,
      "drainPercent": number
   },
   "enableECSManagedTags": boolean,
   "enableExecuteCommand": boolean,
   "propagateTags": "string",
   "tags": [ 
      { 
         "key": "string",
         "value": "string"
      }
   ]
}
```

## Request Parameters


For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [capacityProviderArns](#API_CreateDaemon_RequestSyntax) **   <a name="ECS-CreateDaemon-request-capacityProviderArns"></a>
The Amazon Resource Names (ARNs) of the capacity providers to associate with the daemon. The daemon deploys tasks on container instances managed by these capacity providers.  
Type: Array of strings  
Required: Yes

 ** [clientToken](#API_CreateDaemon_RequestSyntax) **   <a name="ECS-CreateDaemon-request-clientToken"></a>
An identifier that you provide to ensure the idempotency of the request. It must be unique and is case sensitive. Up to 36 ASCII characters in the range of 33-126 (inclusive) are allowed.  
Type: String  
Required: No

 ** [clusterArn](#API_CreateDaemon_RequestSyntax) **   <a name="ECS-CreateDaemon-request-clusterArn"></a>
The Amazon Resource Name (ARN) of the cluster to create the daemon in.  
Type: String  
Required: No

 ** [daemonName](#API_CreateDaemon_RequestSyntax) **   <a name="ECS-CreateDaemon-request-daemonName"></a>
The name of the daemon. Up to 255 letters (uppercase and lowercase), numbers, underscores, and hyphens are allowed.  
Type: String  
Required: Yes

 ** [daemonTaskDefinitionArn](#API_CreateDaemon_RequestSyntax) **   <a name="ECS-CreateDaemon-request-daemonTaskDefinitionArn"></a>
The Amazon Resource Name (ARN) of the daemon task definition to use for the daemon.  
Type: String  
Required: Yes

 ** [deploymentConfiguration](#API_CreateDaemon_RequestSyntax) **   <a name="ECS-CreateDaemon-request-deploymentConfiguration"></a>
Optional deployment parameters that control how the daemon rolls out updates, including the drain percentage, alarm-based rollback, and bake time.  
Type: [DaemonDeploymentConfiguration](API_DaemonDeploymentConfiguration.md) object  
Required: No

 ** [enableECSManagedTags](#API_CreateDaemon_RequestSyntax) **   <a name="ECS-CreateDaemon-request-enableECSManagedTags"></a>
Specifies whether to turn on Amazon ECS managed tags for the tasks in the daemon. For more information, see [Tagging your Amazon ECS resources](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/ecs-using-tags.html) in the *Amazon Elastic Container Service Developer Guide*.  
Type: Boolean  
Required: No

 ** [enableExecuteCommand](#API_CreateDaemon_RequestSyntax) **   <a name="ECS-CreateDaemon-request-enableExecuteCommand"></a>
Determines whether the execute command functionality is turned on for the daemon. If `true`, the execute command functionality is turned on for all tasks in the daemon.  
Type: Boolean  
Required: No

 ** [propagateTags](#API_CreateDaemon_RequestSyntax) **   <a name="ECS-CreateDaemon-request-propagateTags"></a>
Specifies whether to propagate the tags from the daemon to the daemon tasks. If you don't specify a value, the tags aren't propagated. You can only propagate tags to daemon tasks during task creation. To add tags to a task after task creation, use the [TagResource](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_TagResource.html) API action.  
Type: String  
Valid Values: `DAEMON | NONE`   
Required: No

 ** [tags](#API_CreateDaemon_RequestSyntax) **   <a name="ECS-CreateDaemon-request-tags"></a>
The metadata that you apply to the daemon 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: \$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 Amazon 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.
Type: Array of [Tag](API_Tag.md) objects  
Array Members: Minimum number of 0 items. Maximum number of 50 items.  
Required: No

## Response Syntax


```
{
   "createdAt": number,
   "daemonArn": "string",
   "deploymentArn": "string",
   "status": "string"
}
```

## 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.

 ** [createdAt](#API_CreateDaemon_ResponseSyntax) **   <a name="ECS-CreateDaemon-response-createdAt"></a>
The Unix timestamp for the time when the daemon was created.  
Type: Timestamp

 ** [daemonArn](#API_CreateDaemon_ResponseSyntax) **   <a name="ECS-CreateDaemon-response-daemonArn"></a>
The Amazon Resource Name (ARN) of the daemon.  
Type: String

 ** [deploymentArn](#API_CreateDaemon_ResponseSyntax) **   <a name="ECS-CreateDaemon-response-deploymentArn"></a>
The Amazon Resource Name (ARN) of the initial daemon deployment. This deployment places daemon tasks on each container instance of the specified capacity providers.  
Type: String

 ** [status](#API_CreateDaemon_ResponseSyntax) **   <a name="ECS-CreateDaemon-response-status"></a>
The status of the daemon.  
Type: String  
Valid Values: `ACTIVE | DELETE_IN_PROGRESS` 

## Errors


For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** AccessDeniedException **   
You don't have authorization to perform the requested action.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ClientException **   
These errors are usually caused by a client action. This client action might be using an action or resource on behalf of a user that doesn't have permissions to use the action or resource. Or, it might be specifying an identifier that isn't valid.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ClusterNotFoundException **   
The specified cluster wasn't found. You can view your available clusters with [ListClusters](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_ListClusters.html). Amazon ECS clusters are Region specific.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** InvalidParameterException **   
The specified parameter isn't valid. Review the available parameters for the API request.  
For more information about service event errors, see [Amazon ECS service event messages](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/service-event-messages-list.html).     
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** PlatformUnknownException **   
The specified platform version doesn't exist.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ServerException **   
These errors are usually caused by a server issue.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 500

 ** UnsupportedFeatureException **   
The specified task isn't supported in this Region.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

## Examples


In the following example or examples, the Authorization header contents (`AUTHPARAMS`) must be replaced with an Amazon Signature Version 4 signature. For more information, see [Signature Version 4 Signing Process](https://docs.amazonaws.cn/general/latest/gr/signature-version-4.html) in the * Amazon General Reference*.

You only need to learn how to sign HTTP requests if you intend to create them manually. When you use the [Amazon Command Line Interface](http://www.amazonaws.cn/cli/) or one of the [Amazon SDKs](http://www.amazonaws.cn/tools/) to make requests to Amazon, these tools automatically sign the requests for you, with the access key that you specify when you configure the tools. When you use these tools, you don't have to sign requests yourself.

### Create a monitoring daemon in a cluster


This example creates a daemon named my-monitoring-daemon in the specified cluster using the monitoring-agent daemon task definition.

#### Sample Request


```
POST / HTTP/1.1
Host: ecs.us-east-1.amazonaws.com
Accept-Encoding: identity
Content-Length: 426
X-Amz-Target: AmazonEC2ContainerServiceV20141113.CreateDaemon
X-Amz-Date: 20250315T120000Z
Content-Type: application/x-amz-json-1.1
Authorization: AUTHPARAMS

{
  "daemonName": "my-monitoring-daemon",
  "clusterArn": "arn:aws:ecs:us-east-1:123456789012:cluster/my-cluster",
  "daemonTaskDefinitionArn": "arn:aws:ecs:us-east-1:123456789012:daemon-task-definition/monitoring-agent:1",
  "capacityProviderArns": [
    "arn:aws:ecs:us-east-1:123456789012:capacity-provider/my-capacity-provider"
  ],
  "deploymentConfiguration": {
    "drainPercent": 10.0,
    "bakeTimeInMinutes": 5
  }
}
```

#### Sample Response


```
HTTP/1.1 200 OK
Server: Server
Date: Sat, 15 Mar 2025 12:00:00 GMT
Content-Type: application/x-amz-json-1.1
Content-Length: 283
Connection: keep-alive
x-amzn-RequestId: 123a4b56-7c89-01d2-3ef4-example5678f

{
  "daemonArn": "arn:aws:ecs:us-east-1:123456789012:daemon/my-cluster/my-monitoring-daemon",
  "status": "ACTIVE",
  "createdAt": "2025-03-15T12:00:00.000Z",
  "deploymentArn": "arn:aws:ecs:us-east-1:123456789012:daemon-deployment/my-cluster/my-monitoring-daemon/aB1cD2eF3gH4iJ5k"
}
```

## See Also


For more information about using this API in one of the language-specific Amazon SDKs, see the following:
+  [Amazon Command Line Interface V2](https://docs.amazonaws.cn/goto/cli2/ecs-2014-11-13/CreateDaemon) 
+  [Amazon SDK for .NET V4](https://docs.amazonaws.cn/goto/DotNetSDKV4/ecs-2014-11-13/CreateDaemon) 
+  [Amazon SDK for C\$1\$1](https://docs.amazonaws.cn/goto/SdkForCpp/ecs-2014-11-13/CreateDaemon) 
+  [Amazon SDK for Go v2](https://docs.amazonaws.cn/goto/SdkForGoV2/ecs-2014-11-13/CreateDaemon) 
+  [Amazon SDK for Java V2](https://docs.amazonaws.cn/goto/SdkForJavaV2/ecs-2014-11-13/CreateDaemon) 
+  [Amazon SDK for JavaScript V3](https://docs.amazonaws.cn/goto/SdkForJavaScriptV3/ecs-2014-11-13/CreateDaemon) 
+  [Amazon SDK for Kotlin](https://docs.amazonaws.cn/goto/SdkForKotlin/ecs-2014-11-13/CreateDaemon) 
+  [Amazon SDK for PHP V3](https://docs.amazonaws.cn/goto/SdkForPHPV3/ecs-2014-11-13/CreateDaemon) 
+  [Amazon SDK for Python](https://docs.amazonaws.cn/goto/boto3/ecs-2014-11-13/CreateDaemon) 
+  [Amazon SDK for Ruby V3](https://docs.amazonaws.cn/goto/SdkForRubyV3/ecs-2014-11-13/CreateDaemon) 

# CreateExpressGatewayService


Creates an Express service that simplifies deploying containerized web applications on Amazon ECS with managed Amazon infrastructure. This operation provisions and configures Application Load Balancers, target groups, security groups, and auto-scaling policies automatically.

Specify a primary container configuration with your application image and basic settings. Amazon ECS creates the necessary Amazon resources for traffic distribution, health monitoring, network access control, and capacity management.

Provide an execution role for task operations and an infrastructure role for managing Amazon resources on your behalf.

## Request Syntax


```
{
   "cluster": "string",
   "cpu": "string",
   "executionRoleArn": "string",
   "healthCheckPath": "string",
   "infrastructureRoleArn": "string",
   "memory": "string",
   "networkConfiguration": { 
      "securityGroups": [ "string" ],
      "subnets": [ "string" ]
   },
   "primaryContainer": { 
      "awsLogsConfiguration": { 
         "logGroup": "string",
         "logStreamPrefix": "string"
      },
      "command": [ "string" ],
      "containerPort": number,
      "environment": [ 
         { 
            "name": "string",
            "value": "string"
         }
      ],
      "image": "string",
      "repositoryCredentials": { 
         "credentialsParameter": "string"
      },
      "secrets": [ 
         { 
            "name": "string",
            "valueFrom": "string"
         }
      ]
   },
   "scalingTarget": { 
      "autoScalingMetric": "string",
      "autoScalingTargetValue": number,
      "maxTaskCount": number,
      "minTaskCount": number
   },
   "serviceName": "string",
   "tags": [ 
      { 
         "key": "string",
         "value": "string"
      }
   ],
   "taskRoleArn": "string"
}
```

## Request Parameters


For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [cluster](#API_CreateExpressGatewayService_RequestSyntax) **   <a name="ECS-CreateExpressGatewayService-request-cluster"></a>
The short name or full Amazon Resource Name (ARN) of the cluster on which to create the Express service. If you do not specify a cluster, the `default` cluster is assumed.  
Type: String  
Required: No

 ** [cpu](#API_CreateExpressGatewayService_RequestSyntax) **   <a name="ECS-CreateExpressGatewayService-request-cpu"></a>
The number of CPU units used by the task. This parameter determines the CPU allocation for each task in the Express service. The default value for an Express service is 256 (.25 vCPU).  
Type: String  
Required: No

 ** [executionRoleArn](#API_CreateExpressGatewayService_RequestSyntax) **   <a name="ECS-CreateExpressGatewayService-request-executionRoleArn"></a>
The Amazon Resource Name (ARN) of the task execution role that grants the Amazon ECS container agent permission to make Amazon API calls on your behalf. This role is required for Amazon ECS to pull container images from Amazon ECR, send container logs to Amazon CloudWatch Logs, and retrieve sensitive data from Amazon Systems Manager Parameter Store or Amazon Secrets Manager.  
The execution role must include the `AmazonECSTaskExecutionRolePolicy` managed policy or equivalent permissions. For Express services, this role is used during task startup and runtime for container management operations.  
Type: String  
Required: Yes

 ** [healthCheckPath](#API_CreateExpressGatewayService_RequestSyntax) **   <a name="ECS-CreateExpressGatewayService-request-healthCheckPath"></a>
The path on the container that the Application Load Balancer uses for health checks. This should be a valid HTTP endpoint that returns a successful response (HTTP 200) when the application is healthy.  
If not specified, the default health check path is `/ping`. The health check path must start with a forward slash and can include query parameters. Examples: `/health`, `/api/status`, `/ping?format=json`.  
Type: String  
Required: No

 ** [infrastructureRoleArn](#API_CreateExpressGatewayService_RequestSyntax) **   <a name="ECS-CreateExpressGatewayService-request-infrastructureRoleArn"></a>
The Amazon Resource Name (ARN) of the infrastructure role that grants Amazon ECS permission to create and manage Amazon resources on your behalf for the Express service. This role is used to provision and manage Application Load Balancers, target groups, security groups, auto-scaling policies, and other Amazon infrastructure components.  
The infrastructure role must include permissions for Elastic Load Balancing, Application Auto Scaling, Amazon EC2 (for security groups), and other services required for managed infrastructure. This role is only used during Express service creation, updates, and deletion operations.  
Type: String  
Required: Yes

 ** [memory](#API_CreateExpressGatewayService_RequestSyntax) **   <a name="ECS-CreateExpressGatewayService-request-memory"></a>
The amount of memory (in MiB) used by the task. This parameter determines the memory allocation for each task in the Express service. The default value for an express service is 512 MiB.  
Type: String  
Required: No

 ** [networkConfiguration](#API_CreateExpressGatewayService_RequestSyntax) **   <a name="ECS-CreateExpressGatewayService-request-networkConfiguration"></a>
The network configuration for the Express service tasks. This specifies the VPC subnets and security groups for the tasks.  
For Express services, you can specify custom security groups and subnets. If not provided, Amazon ECS will use the default VPC configuration and create appropriate security groups automatically. The network configuration determines how your service integrates with your VPC and what network access it has.  
Type: [ExpressGatewayServiceNetworkConfiguration](API_ExpressGatewayServiceNetworkConfiguration.md) object  
Required: No

 ** [primaryContainer](#API_CreateExpressGatewayService_RequestSyntax) **   <a name="ECS-CreateExpressGatewayService-request-primaryContainer"></a>
The primary container configuration for the Express service. This defines the main application container that will receive traffic from the Application Load Balancer.  
The primary container must specify at minimum a container image. You can also configure the container port (defaults to 80), logging configuration, environment variables, secrets, and startup commands. The container image can be from Amazon ECR, Docker Hub, or any other container registry accessible to your execution role.  
Type: [ExpressGatewayContainer](API_ExpressGatewayContainer.md) object  
Required: Yes

 ** [scalingTarget](#API_CreateExpressGatewayService_RequestSyntax) **   <a name="ECS-CreateExpressGatewayService-request-scalingTarget"></a>
The auto-scaling configuration for the Express service. This defines how the service automatically adjusts the number of running tasks based on demand.  
You can specify the minimum and maximum number of tasks, the scaling metric (CPU utilization, memory utilization, or request count per target), and the target value for the metric. If not specified, the default target value for an Express service is 60.  
Type: [ExpressGatewayScalingTarget](API_ExpressGatewayScalingTarget.md) object  
Required: No

 ** [serviceName](#API_CreateExpressGatewayService_RequestSyntax) **   <a name="ECS-CreateExpressGatewayService-request-serviceName"></a>
The name of the Express service. This name must be unique within the specified cluster and can contain up to 255 letters (uppercase and lowercase), numbers, underscores, and hyphens. The name is used to identify the service in the Amazon ECS console and API operations.  
If you don't specify a service name, Amazon ECS generates a unique name for the service. The service name becomes part of the service ARN and cannot be changed after the service is created.  
Type: String  
Required: No

 ** [tags](#API_CreateExpressGatewayService_RequestSyntax) **   <a name="ECS-CreateExpressGatewayService-request-tags"></a>
The metadata that you apply to the Express service to help categorize and organize it. Each tag consists of a key and an optional value. You can apply up to 50 tags to a service.  
Type: Array of [Tag](API_Tag.md) objects  
Array Members: Minimum number of 0 items. Maximum number of 50 items.  
Required: No

 ** [taskRoleArn](#API_CreateExpressGatewayService_RequestSyntax) **   <a name="ECS-CreateExpressGatewayService-request-taskRoleArn"></a>
The Amazon Resource Name (ARN) of the IAM role that containers in this task can assume. This role allows your application code to access other Amazon services securely.  
The task role is different from the execution role. While the execution role is used by the Amazon ECS agent to set up the task, the task role is used by your application code running inside the container to make Amazon API calls. If your application doesn't need to access Amazon services, you can omit this parameter.  
Type: String  
Required: No

## Response Syntax


```
{
   "service": { 
      "activeConfigurations": [ 
         { 
            "cpu": "string",
            "createdAt": number,
            "executionRoleArn": "string",
            "healthCheckPath": "string",
            "ingressPaths": [ 
               { 
                  "accessType": "string",
                  "endpoint": "string"
               }
            ],
            "memory": "string",
            "networkConfiguration": { 
               "securityGroups": [ "string" ],
               "subnets": [ "string" ]
            },
            "primaryContainer": { 
               "awsLogsConfiguration": { 
                  "logGroup": "string",
                  "logStreamPrefix": "string"
               },
               "command": [ "string" ],
               "containerPort": number,
               "environment": [ 
                  { 
                     "name": "string",
                     "value": "string"
                  }
               ],
               "image": "string",
               "repositoryCredentials": { 
                  "credentialsParameter": "string"
               },
               "secrets": [ 
                  { 
                     "name": "string",
                     "valueFrom": "string"
                  }
               ]
            },
            "scalingTarget": { 
               "autoScalingMetric": "string",
               "autoScalingTargetValue": number,
               "maxTaskCount": number,
               "minTaskCount": number
            },
            "serviceRevisionArn": "string",
            "taskRoleArn": "string"
         }
      ],
      "cluster": "string",
      "createdAt": number,
      "currentDeployment": "string",
      "infrastructureRoleArn": "string",
      "serviceArn": "string",
      "serviceName": "string",
      "status": { 
         "statusCode": "string",
         "statusReason": "string"
      },
      "tags": [ 
         { 
            "key": "string",
            "value": "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.

 ** [service](#API_CreateExpressGatewayService_ResponseSyntax) **   <a name="ECS-CreateExpressGatewayService-response-service"></a>
The full description of your Express service following the create operation.  
Type: [ECSExpressGatewayService](API_ECSExpressGatewayService.md) object

## Errors


For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** AccessDeniedException **   
You don't have authorization to perform the requested action.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ClientException **   
These errors are usually caused by a client action. This client action might be using an action or resource on behalf of a user that doesn't have permissions to use the action or resource. Or, it might be specifying an identifier that isn't valid.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ClusterNotFoundException **   
The specified cluster wasn't found. You can view your available clusters with [ListClusters](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_ListClusters.html). Amazon ECS clusters are Region specific.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** InvalidParameterException **   
The specified parameter isn't valid. Review the available parameters for the API request.  
For more information about service event errors, see [Amazon ECS service event messages](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/service-event-messages-list.html).     
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** PlatformTaskDefinitionIncompatibilityException **   
The specified platform version doesn't satisfy the required capabilities of the task definition.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** PlatformUnknownException **   
The specified platform version doesn't exist.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ServerException **   
These errors are usually caused by a server issue.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 500

 ** UnsupportedFeatureException **   
The specified task isn't supported in this Region.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

## See Also


For more information about using this API in one of the language-specific Amazon SDKs, see the following:
+  [Amazon Command Line Interface V2](https://docs.amazonaws.cn/goto/cli2/ecs-2014-11-13/CreateExpressGatewayService) 
+  [Amazon SDK for .NET V4](https://docs.amazonaws.cn/goto/DotNetSDKV4/ecs-2014-11-13/CreateExpressGatewayService) 
+  [Amazon SDK for C\$1\$1](https://docs.amazonaws.cn/goto/SdkForCpp/ecs-2014-11-13/CreateExpressGatewayService) 
+  [Amazon SDK for Go v2](https://docs.amazonaws.cn/goto/SdkForGoV2/ecs-2014-11-13/CreateExpressGatewayService) 
+  [Amazon SDK for Java V2](https://docs.amazonaws.cn/goto/SdkForJavaV2/ecs-2014-11-13/CreateExpressGatewayService) 
+  [Amazon SDK for JavaScript V3](https://docs.amazonaws.cn/goto/SdkForJavaScriptV3/ecs-2014-11-13/CreateExpressGatewayService) 
+  [Amazon SDK for Kotlin](https://docs.amazonaws.cn/goto/SdkForKotlin/ecs-2014-11-13/CreateExpressGatewayService) 
+  [Amazon SDK for PHP V3](https://docs.amazonaws.cn/goto/SdkForPHPV3/ecs-2014-11-13/CreateExpressGatewayService) 
+  [Amazon SDK for Python](https://docs.amazonaws.cn/goto/boto3/ecs-2014-11-13/CreateExpressGatewayService) 
+  [Amazon SDK for Ruby V3](https://docs.amazonaws.cn/goto/SdkForRubyV3/ecs-2014-11-13/CreateExpressGatewayService) 

# CreateService


Runs and maintains your desired number of tasks from a specified task definition. If the number of tasks running in a service drops below the `desiredCount`, Amazon ECS runs another copy of the task in the specified cluster. To update an existing service, use [UpdateService](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_UpdateService.html).

**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.

**Note**  
Amazon Elastic Inference (EI) is no longer available to customers.

In addition to maintaining the desired count of tasks in your service, you can optionally run your service behind one or more load balancers. The load balancers distribute traffic across the tasks that are associated with the service. For more information, see [Service load balancing](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/service-load-balancing.html) in the *Amazon Elastic Container Service Developer Guide*.

You can attach Amazon EBS volumes to Amazon ECS tasks by configuring the volume when creating or updating a service. `volumeConfigurations` is only supported for REPLICA service and not DAEMON service. For more information, see [Amazon EBS volumes](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/ebs-volumes.html#ebs-volume-types) in the *Amazon Elastic Container Service Developer Guide*.

Tasks for services that don't use a load balancer are considered healthy if they're in the `RUNNING` state. Tasks for services that use a load balancer are considered healthy if they're in the `RUNNING` state and are reported as healthy by the load balancer.

There are two service scheduler strategies available:
+  `REPLICA` - The replica scheduling strategy places and maintains your desired number of tasks across your cluster. By default, the service scheduler spreads tasks across Availability Zones. You can use task placement strategies and constraints to customize task placement decisions. For more information, see [Service scheduler concepts](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/ecs_services.html) in the *Amazon Elastic Container Service Developer Guide*.
+  `DAEMON` - The daemon scheduling strategy deploys exactly one task on each active container instance that meets all of the task placement constraints that you specify in your cluster. The service scheduler also evaluates the task placement constraints for running tasks. It also stops tasks that don't meet the placement constraints. When using this strategy, you don't need to specify a desired number of tasks, a task placement strategy, or use Service Auto Scaling policies. For more information, see [Amazon ECS services](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/ecs_services.html) in the *Amazon Elastic Container Service Developer Guide*.

The deployment controller is the mechanism that determines how tasks are deployed for your service. The valid options are:
+ ECS

   When you create a service which uses the `ECS` deployment controller, you can choose between the following deployment strategies (which you can set in the “`strategy`” field in “`deploymentConfiguration`”): :
  +  `ROLLING`: When you create a service which uses the *rolling update* (`ROLLING`) deployment strategy, the Amazon ECS service scheduler replaces the currently running tasks with new tasks. The number of tasks that Amazon ECS adds or removes from the service during a rolling update is controlled by the service deployment configuration. For more information, see [Deploy Amazon ECS services by replacing tasks](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/deployment-type-ecs.html) in the *Amazon Elastic Container Service Developer Guide*.

    Rolling update deployments are best suited for the following scenarios:
    + Gradual service updates: You need to update your service incrementally without taking the entire service offline at once.
    + Limited resource requirements: You want to avoid the additional resource costs of running two complete environments simultaneously (as required by blue/green deployments).
    + Acceptable deployment time: Your application can tolerate a longer deployment process, as rolling updates replace tasks one by one.
    + No need for instant roll back: Your service can tolerate a rollback process that takes minutes rather than seconds.
    + Simple deployment process: You prefer a straightforward deployment approach without the complexity of managing multiple environments, target groups, and listeners.
    + No load balancer requirement: Your service doesn't use or require a load balancer, Application Load Balancer, Network Load Balancer, or Service Connect (which are required for blue/green deployments).
    + Stateful applications: Your application maintains state that makes it difficult to run two parallel environments.
    + Cost sensitivity: You want to minimize deployment costs by not running duplicate environments during deployment.

    Rolling updates are the default deployment strategy for services and provide a balance between deployment safety and resource efficiency for many common application scenarios.
  +  `BLUE_GREEN`: A *blue/green* deployment strategy (`BLUE_GREEN`) is a release methodology that reduces downtime and risk by running two identical production environments called blue and green. With Amazon ECS blue/green deployments, you can validate new service revisions before directing production traffic to them. This approach provides a safer way to deploy changes with the ability to quickly roll back if needed. For more information, see [Amazon ECS blue/green deployments](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/deployment-type-blue-green.html) in the *Amazon Elastic Container Service Developer Guide*.

    Amazon ECS blue/green deployments are best suited for the following scenarios:
    + Service validation: When you need to validate new service revisions before directing production traffic to them
    + Zero downtime: When your service requires zero-downtime deployments
    + Instant roll back: When you need the ability to quickly roll back if issues are detected
    + Load balancer requirement: When your service uses Application Load Balancer, Network Load Balancer, or Service Connect
  +  `LINEAR`: A *linear* deployment strategy (`LINEAR`) gradually shifts traffic from the current production environment to a new environment in equal percentage increments. With Amazon ECS linear deployments, you can control the pace of traffic shifting and validate new service revisions with increasing amounts of production traffic.

    Linear deployments are best suited for the following scenarios:
    + Gradual validation: When you want to gradually validate your new service version with increasing traffic
    + Performance monitoring: When you need time to monitor metrics and performance during the deployment
    + Risk minimization: When you want to minimize risk by exposing the new version to production traffic incrementally
    + Load balancer requirement: When your service uses Application Load Balancer or Service Connect
  +  `CANARY`: A *canary* deployment strategy (`CANARY`) shifts a small percentage of traffic to the new service revision first, then shifts the remaining traffic all at once after a specified time period. This allows you to test the new version with a subset of users before full deployment.

    Canary deployments are best suited for the following scenarios:
    + Feature testing: When you want to test new features with a small subset of users before full rollout
    + Production validation: When you need to validate performance and functionality with real production traffic
    + Blast radius control: When you want to minimize blast radius if issues are discovered in the new version
    + Load balancer requirement: When your service uses Application Load Balancer or Service Connect
+ External

  Use a third-party deployment controller.
+ Blue/green deployment (powered by Amazon CodeDeploy)

   Amazon CodeDeploy installs an updated version of the application as a new replacement task set and reroutes production traffic from the original application task set to the replacement task set. The original task set is terminated after a successful deployment. Use this deployment controller to verify a new deployment of a service before sending production traffic to it.

When creating a service that uses the `EXTERNAL` deployment controller, you can specify only parameters that aren't controlled at the task set level. The only required parameter is the service name. You control your services using the [CreateTaskSet](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_CreateTaskSet.html). For more information, see [Amazon ECS deployment types](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/deployment-types.html) in the *Amazon Elastic Container Service Developer Guide*.

When the service scheduler launches new tasks, it determines task placement. For information about task placement and task placement strategies, see [Amazon ECS task placement](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/task-placement.html) in the *Amazon Elastic Container Service Developer Guide* 

## Request Syntax


```
{
   "availabilityZoneRebalancing": "string",
   "capacityProviderStrategy": [ 
      { 
         "base": number,
         "capacityProvider": "string",
         "weight": number
      }
   ],
   "clientToken": "string",
   "cluster": "string",
   "deploymentConfiguration": { 
      "alarms": { 
         "alarmNames": [ "string" ],
         "enable": boolean,
         "rollback": boolean
      },
      "bakeTimeInMinutes": number,
      "canaryConfiguration": { 
         "canaryBakeTimeInMinutes": number,
         "canaryPercent": number
      },
      "deploymentCircuitBreaker": { 
         "enable": boolean,
         "rollback": boolean
      },
      "lifecycleHooks": [ 
         { 
            "hookDetails": JSON value,
            "hookTargetArn": "string",
            "lifecycleStages": [ "string" ],
            "roleArn": "string"
         }
      ],
      "linearConfiguration": { 
         "stepBakeTimeInMinutes": number,
         "stepPercent": number
      },
      "maximumPercent": number,
      "minimumHealthyPercent": number,
      "strategy": "string"
   },
   "deploymentController": { 
      "type": "string"
   },
   "desiredCount": number,
   "enableECSManagedTags": boolean,
   "enableExecuteCommand": boolean,
   "healthCheckGracePeriodSeconds": number,
   "launchType": "string",
   "loadBalancers": [ 
      { 
         "advancedConfiguration": { 
            "alternateTargetGroupArn": "string",
            "productionListenerRule": "string",
            "roleArn": "string",
            "testListenerRule": "string"
         },
         "containerName": "string",
         "containerPort": number,
         "loadBalancerName": "string",
         "targetGroupArn": "string"
      }
   ],
   "networkConfiguration": { 
      "awsvpcConfiguration": { 
         "assignPublicIp": "string",
         "securityGroups": [ "string" ],
         "subnets": [ "string" ]
      }
   },
   "placementConstraints": [ 
      { 
         "expression": "string",
         "type": "string"
      }
   ],
   "placementStrategy": [ 
      { 
         "field": "string",
         "type": "string"
      }
   ],
   "platformVersion": "string",
   "propagateTags": "string",
   "role": "string",
   "schedulingStrategy": "string",
   "serviceConnectConfiguration": { 
      "accessLogConfiguration": { 
         "format": "string",
         "includeQueryParameters": "string"
      },
      "enabled": boolean,
      "logConfiguration": { 
         "logDriver": "string",
         "options": { 
            "string" : "string" 
         },
         "secretOptions": [ 
            { 
               "name": "string",
               "valueFrom": "string"
            }
         ]
      },
      "namespace": "string",
      "services": [ 
         { 
            "clientAliases": [ 
               { 
                  "dnsName": "string",
                  "port": number,
                  "testTrafficRules": { 
                     "header": { 
                        "name": "string",
                        "value": { 
                           "exact": "string"
                        }
                     }
                  }
               }
            ],
            "discoveryName": "string",
            "ingressPortOverride": number,
            "portName": "string",
            "timeout": { 
               "idleTimeoutSeconds": number,
               "perRequestTimeoutSeconds": number
            },
            "tls": { 
               "issuerCertificateAuthority": { 
                  "awsPcaAuthorityArn": "string"
               },
               "kmsKey": "string",
               "roleArn": "string"
            }
         }
      ]
   },
   "serviceName": "string",
   "serviceRegistries": [ 
      { 
         "containerName": "string",
         "containerPort": number,
         "port": number,
         "registryArn": "string"
      }
   ],
   "tags": [ 
      { 
         "key": "string",
         "value": "string"
      }
   ],
   "taskDefinition": "string",
   "volumeConfigurations": [ 
      { 
         "managedEBSVolume": { 
            "encrypted": boolean,
            "filesystemType": "string",
            "iops": number,
            "kmsKeyId": "string",
            "roleArn": "string",
            "sizeInGiB": number,
            "snapshotId": "string",
            "tagSpecifications": [ 
               { 
                  "propagateTags": "string",
                  "resourceType": "string",
                  "tags": [ 
                     { 
                        "key": "string",
                        "value": "string"
                     }
                  ]
               }
            ],
            "throughput": number,
            "volumeInitializationRate": number,
            "volumeType": "string"
         },
         "name": "string"
      }
   ],
   "vpcLatticeConfigurations": [ 
      { 
         "portName": "string",
         "roleArn": "string",
         "targetGroupArn": "string"
      }
   ]
}
```

## Request Parameters


For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [availabilityZoneRebalancing](#API_CreateService_RequestSyntax) **   <a name="ECS-CreateService-request-availabilityZoneRebalancing"></a>
Indicates whether to use Availability Zone rebalancing for the service.  
For more information, see [Balancing an Amazon ECS service across Availability Zones](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/service-rebalancing.html) in the * *Amazon Elastic Container Service Developer Guide* *.  
The default behavior of `AvailabilityZoneRebalancing` differs between create and update requests:  
+ For create service requests, when no value is specified for `AvailabilityZoneRebalancing`, Amazon ECS defaults the value to `ENABLED`.
+ For update service requests, when no value is specified for `AvailabilityZoneRebalancing`, Amazon ECS defaults to the existing service’s `AvailabilityZoneRebalancing` value. If the service never had an `AvailabilityZoneRebalancing` value set, Amazon ECS treats this as `DISABLED`.
Type: String  
Valid Values: `ENABLED | DISABLED`   
Required: No

 ** [capacityProviderStrategy](#API_CreateService_RequestSyntax) **   <a name="ECS-CreateService-request-capacityProviderStrategy"></a>
The capacity provider strategy to use for the service.  
If you want to use Amazon ECS Managed Instances, you must use the `capacityProviderStrategy` request parameter and omit the `launchType` request parameter.
If a `capacityProviderStrategy` is specified, the `launchType` parameter must be omitted. If no `capacityProviderStrategy` or `launchType` is specified, the `defaultCapacityProviderStrategy` for the cluster is used.  
A capacity provider strategy can contain a maximum of 20 capacity providers.  
Type: Array of [CapacityProviderStrategyItem](API_CapacityProviderStrategyItem.md) objects  
Required: No

 ** [clientToken](#API_CreateService_RequestSyntax) **   <a name="ECS-CreateService-request-clientToken"></a>
An identifier that you provide to ensure the idempotency of the request. It must be unique and is case sensitive. Up to 36 ASCII characters in the range of 33-126 (inclusive) are allowed.  
Type: String  
Required: No

 ** [cluster](#API_CreateService_RequestSyntax) **   <a name="ECS-CreateService-request-cluster"></a>
The short name or full Amazon Resource Name (ARN) of the cluster that you run your service on. If you do not specify a cluster, the default cluster is assumed.  
Type: String  
Required: No

 ** [deploymentConfiguration](#API_CreateService_RequestSyntax) **   <a name="ECS-CreateService-request-deploymentConfiguration"></a>
Optional deployment parameters that control how many tasks run during the deployment and the ordering of stopping and starting tasks.  
Type: [DeploymentConfiguration](API_DeploymentConfiguration.md) object  
Required: No

 ** [deploymentController](#API_CreateService_RequestSyntax) **   <a name="ECS-CreateService-request-deploymentController"></a>
The deployment controller to use for the service. If no deployment controller is specified, the default value of `ECS` is used.  
Type: [DeploymentController](API_DeploymentController.md) object  
Required: No

 ** [desiredCount](#API_CreateService_RequestSyntax) **   <a name="ECS-CreateService-request-desiredCount"></a>
The number of instantiations of the specified task definition to place and keep running in your service.  
This is required if `schedulingStrategy` is `REPLICA` or isn't specified. If `schedulingStrategy` is `DAEMON` then this isn't required.  
Type: Integer  
Required: No

 ** [enableECSManagedTags](#API_CreateService_RequestSyntax) **   <a name="ECS-CreateService-request-enableECSManagedTags"></a>
Specifies whether to turn on Amazon ECS managed tags for the tasks within the service. For more information, see [Tagging your Amazon ECS resources](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/ecs-using-tags.html) in the *Amazon Elastic Container Service Developer Guide*.  
When you use Amazon ECS managed tags, you must set the `propagateTags` request parameter.  
Type: Boolean  
Required: No

 ** [enableExecuteCommand](#API_CreateService_RequestSyntax) **   <a name="ECS-CreateService-request-enableExecuteCommand"></a>
Determines whether the execute command functionality is turned on for the service. If `true`, this enables execute command functionality on all containers in the service tasks.  
Type: Boolean  
Required: No

 ** [healthCheckGracePeriodSeconds](#API_CreateService_RequestSyntax) **   <a name="ECS-CreateService-request-healthCheckGracePeriodSeconds"></a>
The period of time, in seconds, that the Amazon ECS service scheduler ignores unhealthy Elastic Load Balancing, VPC Lattice, and container health checks after a task has first started. If you do not specify a health check grace period value, the default value of 0 is used. If you do not use any of the health checks, then `healthCheckGracePeriodSeconds` is unused.  
If your service has more running tasks than desired, unhealthy tasks in the grace period might be stopped to reach the desired count.  
Type: Integer  
Required: No

 ** [launchType](#API_CreateService_RequestSyntax) **   <a name="ECS-CreateService-request-launchType"></a>
The infrastructure that you run your service on. For more information, see [Amazon ECS launch types](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/launch_types.html) in the *Amazon Elastic Container Service Developer Guide*.  
If you want to use Amazon ECS Managed Instances, you must use the `capacityProviderStrategy` request parameter and omit the `launchType` request parameter.
The `FARGATE` launch type runs your tasks on Amazon Fargate On-Demand infrastructure.  
Fargate Spot infrastructure is available for use but a capacity provider strategy must be used. For more information, see [Amazon Fargate capacity providers](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/fargate-capacity-providers.html) in the *Amazon ECS Developer Guide*.
The `EC2` launch type runs your tasks on Amazon EC2 instances registered to your cluster.  
The `EXTERNAL` launch type runs your tasks on your on-premises server or virtual machine (VM) capacity registered to your cluster.  
A service can use either a launch type or a capacity provider strategy. If a `launchType` is specified, the `capacityProviderStrategy` parameter must be omitted.  
Type: String  
Valid Values: `EC2 | FARGATE | EXTERNAL | MANAGED_INSTANCES`   
Required: No

 ** [loadBalancers](#API_CreateService_RequestSyntax) **   <a name="ECS-CreateService-request-loadBalancers"></a>
A load balancer object representing the load balancers to use with your service. For more information, see [Service load balancing](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/service-load-balancing.html) in the *Amazon Elastic Container Service Developer Guide*.  
If the service uses the `ECS` deployment controller and using either an Application Load Balancer or Network Load Balancer, you must specify one or more target group ARNs to attach to the service. The service-linked role is required for services that use multiple target groups. For more information, see [Using service-linked roles for Amazon ECS](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/using-service-linked-roles.html) in the *Amazon Elastic Container Service Developer Guide*.  
If the service uses the `CODE_DEPLOY` deployment controller, the service is required to use either an Application Load Balancer or Network Load Balancer. When creating an Amazon CodeDeploy deployment group, you specify two target groups (referred to as a `targetGroupPair`). During a deployment, Amazon CodeDeploy determines which task set in your service has the status `PRIMARY`, and it associates one target group with it. Then, it also associates the other target group with the replacement task set. The load balancer can also have up to two listeners: a required listener for production traffic and an optional listener that you can use to perform validation tests with Lambda functions before routing production traffic to it.  
If you use the `CODE_DEPLOY` deployment controller, these values can be changed when updating the service.  
For Application Load Balancers and Network Load Balancers, this object must contain the load balancer target group ARN, the container name, and the container port to access from the load balancer. The container name must be as it appears in a container definition. The load balancer name parameter must be omitted. When a task from this service is placed on a container instance, the container instance and port combination is registered as a target in the target group that's specified here.  
For Classic Load Balancers, this object must contain the load balancer name, the container name , and the container port to access from the load balancer. The container name must be as it appears in a container definition. The target group ARN parameter must be omitted. When a task from this service is placed on a container instance, the container instance is registered with the load balancer that's specified here.  
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 aren't supported. Also, when you create any target groups for these services, you must choose `ip` as the target type, not `instance`. This is because tasks that use the `awsvpc` network mode are associated with an elastic network interface, not an Amazon EC2 instance.  
Type: Array of [LoadBalancer](API_LoadBalancer.md) objects  
Required: No

 ** [networkConfiguration](#API_CreateService_RequestSyntax) **   <a name="ECS-CreateService-request-networkConfiguration"></a>
The network configuration for the service. This parameter is required for task definitions that use the `awsvpc` network mode to receive their own elastic network interface, and it isn't supported for other network modes. For more information, see [Task networking](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/task-networking.html) in the *Amazon Elastic Container Service Developer Guide*.  
Type: [NetworkConfiguration](API_NetworkConfiguration.md) object  
Required: No

 ** [placementConstraints](#API_CreateService_RequestSyntax) **   <a name="ECS-CreateService-request-placementConstraints"></a>
An array of placement constraint objects to use for tasks in your service. You can specify a maximum of 10 constraints for each task. This limit includes constraints in the task definition and those specified at runtime.  
Type: Array of [PlacementConstraint](API_PlacementConstraint.md) objects  
Required: No

 ** [placementStrategy](#API_CreateService_RequestSyntax) **   <a name="ECS-CreateService-request-placementStrategy"></a>
The placement strategy objects to use for tasks in your service. You can specify a maximum of 5 strategy rules for each service.  
Type: Array of [PlacementStrategy](API_PlacementStrategy.md) objects  
Required: No

 ** [platformVersion](#API_CreateService_RequestSyntax) **   <a name="ECS-CreateService-request-platformVersion"></a>
The platform version that your tasks in the service are running on. A platform version is specified only for tasks using the Fargate launch type. If one isn't specified, the `LATEST` platform version is used. For more information, see [Amazon Fargate platform versions](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/platform_versions.html) in the *Amazon Elastic Container Service Developer Guide*.  
Type: String  
Required: No

 ** [propagateTags](#API_CreateService_RequestSyntax) **   <a name="ECS-CreateService-request-propagateTags"></a>
Specifies whether to propagate the tags from the task definition to the task. If no value is specified, the tags aren't propagated. Tags can only be propagated to the task during task creation. To add tags to a task after task creation, use the [TagResource](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_TagResource.html) API action.  
You must set this to a value other than `NONE` when you use Cost Explorer. For more information, see [Amazon ECS usage reports](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/usage-reports.html) in the *Amazon Elastic Container Service Developer Guide*.  
The default is `NONE`.  
Type: String  
Valid Values: `TASK_DEFINITION | SERVICE | NONE`   
Required: No

 ** [role](#API_CreateService_RequestSyntax) **   <a name="ECS-CreateService-request-role"></a>
The name or full Amazon Resource Name (ARN) of the IAM role that allows Amazon ECS to make calls to your load balancer on your behalf. This parameter is only permitted if you are using a load balancer with your service and your task definition doesn't use the `awsvpc` network mode. If you specify the `role` parameter, you must also specify a load balancer object with the `loadBalancers` parameter.  
If your account has already created the Amazon ECS service-linked role, that role is used for your service unless you specify a role here. The service-linked role is required if your task definition uses the `awsvpc` network mode or if the service is configured to use service discovery, an external deployment controller, multiple target groups, or Elastic Inference accelerators in which case you don't specify a role here. For more information, see [Using service-linked roles for Amazon ECS](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/using-service-linked-roles.html) in the *Amazon Elastic Container Service Developer Guide*.
If your specified role has a path other than `/`, then you must either specify the full role ARN (this is recommended) or prefix the role name with the path. For example, if a role with the name `bar` has a path of `/foo/` then you would specify `/foo/bar` as the role name. For more information, see [Friendly names and paths](https://docs.amazonaws.cn/IAM/latest/UserGuide/reference_identifiers.html#identifiers-friendly-names) in the *IAM User Guide*.  
Type: String  
Required: No

 ** [schedulingStrategy](#API_CreateService_RequestSyntax) **   <a name="ECS-CreateService-request-schedulingStrategy"></a>
The scheduling strategy to use for the service. For more information, see [Services](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/ecs_services.html).  
There are two service scheduler strategies available:  
+  `REPLICA`-The replica scheduling strategy places and maintains the desired number of tasks across your cluster. By default, the service scheduler spreads tasks across Availability Zones. You can use task placement strategies and constraints to customize task placement decisions. This scheduler strategy is required if the service uses the `CODE_DEPLOY` or `EXTERNAL` deployment controller types.
+  `DAEMON`-The daemon scheduling strategy deploys exactly one task on each active container instance that meets all of the task placement constraints that you specify in your cluster. The service scheduler also evaluates the task placement constraints for running tasks and will stop tasks that don't meet the placement constraints. When you're using this strategy, you don't need to specify a desired number of tasks, a task placement strategy, or use Service Auto Scaling policies.
**Note**  
Tasks using the Fargate launch type or the `CODE_DEPLOY` or `EXTERNAL` deployment controller types don't support the `DAEMON` scheduling strategy.
Type: String  
Valid Values: `REPLICA | DAEMON`   
Required: No

 ** [serviceConnectConfiguration](#API_CreateService_RequestSyntax) **   <a name="ECS-CreateService-request-serviceConnectConfiguration"></a>
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](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/service-connect.html) in the *Amazon Elastic Container Service Developer Guide*.  
Type: [ServiceConnectConfiguration](API_ServiceConnectConfiguration.md) object  
Required: No

 ** [serviceName](#API_CreateService_RequestSyntax) **   <a name="ECS-CreateService-request-serviceName"></a>
The name of your service. Up to 255 letters (uppercase and lowercase), numbers, underscores, and hyphens are allowed. Service names must be unique within a cluster, but you can have similarly named services in multiple clusters within a Region or across multiple Regions.  
Type: String  
Required: Yes

 ** [serviceRegistries](#API_CreateService_RequestSyntax) **   <a name="ECS-CreateService-request-serviceRegistries"></a>
The details of the service discovery registry to associate with this service. For more information, see [Service discovery](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/service-discovery.html).  
Each service may be associated with one service registry. Multiple service registries for each service isn't supported.
Type: Array of [ServiceRegistry](API_ServiceRegistry.md) objects  
Required: No

 ** [tags](#API_CreateService_RequestSyntax) **   <a name="ECS-CreateService-request-tags"></a>
The metadata that you apply to the service to help you categorize and organize them. Each tag consists of a key and an optional value, both of which you define. When a service is deleted, the tags are deleted as well.  
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 Amazon 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.
Type: Array of [Tag](API_Tag.md) objects  
Array Members: Minimum number of 0 items. Maximum number of 50 items.  
Required: No

 ** [taskDefinition](#API_CreateService_RequestSyntax) **   <a name="ECS-CreateService-request-taskDefinition"></a>
The `family` and `revision` (`family:revision`) or full ARN of the task definition to run in your service. If a `revision` isn't specified, the latest `ACTIVE` revision is used.  
A task definition must be specified if the service uses either the `ECS` or `CODE_DEPLOY` deployment controllers.  
For more information about deployment types, see [Amazon ECS deployment types](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/deployment-types.html).  
Type: String  
Required: No

 ** [volumeConfigurations](#API_CreateService_RequestSyntax) **   <a name="ECS-CreateService-request-volumeConfigurations"></a>
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.  
Type: Array of [ServiceVolumeConfiguration](API_ServiceVolumeConfiguration.md) objects  
Required: No

 ** [vpcLatticeConfigurations](#API_CreateService_RequestSyntax) **   <a name="ECS-CreateService-request-vpcLatticeConfigurations"></a>
The VPC Lattice configuration for the service being created.  
Type: Array of [VpcLatticeConfiguration](API_VpcLatticeConfiguration.md) objects  
Required: No

## Response Syntax


```
{
   "service": { 
      "availabilityZoneRebalancing": "string",
      "capacityProviderStrategy": [ 
         { 
            "base": number,
            "capacityProvider": "string",
            "weight": number
         }
      ],
      "clusterArn": "string",
      "createdAt": number,
      "createdBy": "string",
      "currentServiceDeployment": "string",
      "currentServiceRevisions": [ 
         { 
            "arn": "string",
            "pendingTaskCount": number,
            "requestedTaskCount": number,
            "runningTaskCount": number
         }
      ],
      "deploymentConfiguration": { 
         "alarms": { 
            "alarmNames": [ "string" ],
            "enable": boolean,
            "rollback": boolean
         },
         "bakeTimeInMinutes": number,
         "canaryConfiguration": { 
            "canaryBakeTimeInMinutes": number,
            "canaryPercent": number
         },
         "deploymentCircuitBreaker": { 
            "enable": boolean,
            "rollback": boolean
         },
         "lifecycleHooks": [ 
            { 
               "hookDetails": JSON value,
               "hookTargetArn": "string",
               "lifecycleStages": [ "string" ],
               "roleArn": "string"
            }
         ],
         "linearConfiguration": { 
            "stepBakeTimeInMinutes": number,
            "stepPercent": number
         },
         "maximumPercent": number,
         "minimumHealthyPercent": number,
         "strategy": "string"
      },
      "deploymentController": { 
         "type": "string"
      },
      "deployments": [ 
         { 
            "capacityProviderStrategy": [ 
               { 
                  "base": number,
                  "capacityProvider": "string",
                  "weight": number
               }
            ],
            "createdAt": number,
            "desiredCount": number,
            "failedTasks": number,
            "fargateEphemeralStorage": { 
               "kmsKeyId": "string"
            },
            "id": "string",
            "launchType": "string",
            "networkConfiguration": { 
               "awsvpcConfiguration": { 
                  "assignPublicIp": "string",
                  "securityGroups": [ "string" ],
                  "subnets": [ "string" ]
               }
            },
            "pendingCount": number,
            "platformFamily": "string",
            "platformVersion": "string",
            "rolloutState": "string",
            "rolloutStateReason": "string",
            "runningCount": number,
            "serviceConnectConfiguration": { 
               "accessLogConfiguration": { 
                  "format": "string",
                  "includeQueryParameters": "string"
               },
               "enabled": boolean,
               "logConfiguration": { 
                  "logDriver": "string",
                  "options": { 
                     "string" : "string" 
                  },
                  "secretOptions": [ 
                     { 
                        "name": "string",
                        "valueFrom": "string"
                     }
                  ]
               },
               "namespace": "string",
               "services": [ 
                  { 
                     "clientAliases": [ 
                        { 
                           "dnsName": "string",
                           "port": number,
                           "testTrafficRules": { 
                              "header": { 
                                 "name": "string",
                                 "value": { 
                                    "exact": "string"
                                 }
                              }
                           }
                        }
                     ],
                     "discoveryName": "string",
                     "ingressPortOverride": number,
                     "portName": "string",
                     "timeout": { 
                        "idleTimeoutSeconds": number,
                        "perRequestTimeoutSeconds": number
                     },
                     "tls": { 
                        "issuerCertificateAuthority": { 
                           "awsPcaAuthorityArn": "string"
                        },
                        "kmsKey": "string",
                        "roleArn": "string"
                     }
                  }
               ]
            },
            "serviceConnectResources": [ 
               { 
                  "discoveryArn": "string",
                  "discoveryName": "string"
               }
            ],
            "status": "string",
            "taskDefinition": "string",
            "updatedAt": number,
            "volumeConfigurations": [ 
               { 
                  "managedEBSVolume": { 
                     "encrypted": boolean,
                     "filesystemType": "string",
                     "iops": number,
                     "kmsKeyId": "string",
                     "roleArn": "string",
                     "sizeInGiB": number,
                     "snapshotId": "string",
                     "tagSpecifications": [ 
                        { 
                           "propagateTags": "string",
                           "resourceType": "string",
                           "tags": [ 
                              { 
                                 "key": "string",
                                 "value": "string"
                              }
                           ]
                        }
                     ],
                     "throughput": number,
                     "volumeInitializationRate": number,
                     "volumeType": "string"
                  },
                  "name": "string"
               }
            ],
            "vpcLatticeConfigurations": [ 
               { 
                  "portName": "string",
                  "roleArn": "string",
                  "targetGroupArn": "string"
               }
            ]
         }
      ],
      "desiredCount": number,
      "enableECSManagedTags": boolean,
      "enableExecuteCommand": boolean,
      "events": [ 
         { 
            "createdAt": number,
            "id": "string",
            "message": "string"
         }
      ],
      "healthCheckGracePeriodSeconds": number,
      "launchType": "string",
      "loadBalancers": [ 
         { 
            "advancedConfiguration": { 
               "alternateTargetGroupArn": "string",
               "productionListenerRule": "string",
               "roleArn": "string",
               "testListenerRule": "string"
            },
            "containerName": "string",
            "containerPort": number,
            "loadBalancerName": "string",
            "targetGroupArn": "string"
         }
      ],
      "networkConfiguration": { 
         "awsvpcConfiguration": { 
            "assignPublicIp": "string",
            "securityGroups": [ "string" ],
            "subnets": [ "string" ]
         }
      },
      "pendingCount": number,
      "placementConstraints": [ 
         { 
            "expression": "string",
            "type": "string"
         }
      ],
      "placementStrategy": [ 
         { 
            "field": "string",
            "type": "string"
         }
      ],
      "platformFamily": "string",
      "platformVersion": "string",
      "propagateTags": "string",
      "resourceManagementType": "string",
      "roleArn": "string",
      "runningCount": number,
      "schedulingStrategy": "string",
      "serviceArn": "string",
      "serviceName": "string",
      "serviceRegistries": [ 
         { 
            "containerName": "string",
            "containerPort": number,
            "port": number,
            "registryArn": "string"
         }
      ],
      "status": "string",
      "tags": [ 
         { 
            "key": "string",
            "value": "string"
         }
      ],
      "taskDefinition": "string",
      "taskSets": [ 
         { 
            "capacityProviderStrategy": [ 
               { 
                  "base": number,
                  "capacityProvider": "string",
                  "weight": number
               }
            ],
            "clusterArn": "string",
            "computedDesiredCount": number,
            "createdAt": number,
            "externalId": "string",
            "fargateEphemeralStorage": { 
               "kmsKeyId": "string"
            },
            "id": "string",
            "launchType": "string",
            "loadBalancers": [ 
               { 
                  "advancedConfiguration": { 
                     "alternateTargetGroupArn": "string",
                     "productionListenerRule": "string",
                     "roleArn": "string",
                     "testListenerRule": "string"
                  },
                  "containerName": "string",
                  "containerPort": number,
                  "loadBalancerName": "string",
                  "targetGroupArn": "string"
               }
            ],
            "networkConfiguration": { 
               "awsvpcConfiguration": { 
                  "assignPublicIp": "string",
                  "securityGroups": [ "string" ],
                  "subnets": [ "string" ]
               }
            },
            "pendingCount": number,
            "platformFamily": "string",
            "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",
            "tags": [ 
               { 
                  "key": "string",
                  "value": "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.

 ** [service](#API_CreateService_ResponseSyntax) **   <a name="ECS-CreateService-response-service"></a>
The full description of your service following the create call.  
A service will return either a `capacityProviderStrategy` or `launchType` parameter, but not both, depending where one was specified when it was created.  
If a service is using the `ECS` deployment controller, the `deploymentController` and `taskSets` parameters will not be returned.  
if the service uses the `CODE_DEPLOY` deployment controller, the `deploymentController`, `taskSets` and `deployments` parameters will be returned, however the `deployments` parameter will be an empty list.  
Type: [Service](API_Service.md) object

## Errors


For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** AccessDeniedException **   
You don't have authorization to perform the requested action.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ClientException **   
These errors are usually caused by a client action. This client action might be using an action or resource on behalf of a user that doesn't have permissions to use the action or resource. Or, it might be specifying an identifier that isn't valid.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ClusterNotFoundException **   
The specified cluster wasn't found. You can view your available clusters with [ListClusters](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_ListClusters.html). Amazon ECS clusters are Region specific.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** InvalidParameterException **   
The specified parameter isn't valid. Review the available parameters for the API request.  
For more information about service event errors, see [Amazon ECS service event messages](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/service-event-messages-list.html).     
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** NamespaceNotFoundException **   
The specified namespace wasn't found.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** PlatformTaskDefinitionIncompatibilityException **   
The specified platform version doesn't satisfy the required capabilities of the task definition.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** PlatformUnknownException **   
The specified platform version doesn't exist.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ServerException **   
These errors are usually caused by a server issue.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 500

 ** UnsupportedFeatureException **   
The specified task isn't supported in this Region.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

## Examples


In the following example or examples, the Authorization header contents (`AUTHPARAMS`) must be replaced with an Amazon Signature Version 4 signature. For more information, see [Signature Version 4 Signing Process](https://docs.amazonaws.cn/general/latest/gr/signature-version-4.html) in the * Amazon General Reference*.

You only need to learn how to sign HTTP requests if you intend to create them manually. When you use the [Amazon Command Line Interface](http://www.amazonaws.cn/cli/) or one of the [Amazon SDKs](http://www.amazonaws.cn/tools/) to make requests to Amazon, these tools automatically sign the requests for you, with the access key that you specify when you configure the tools. When you use these tools, you don't have to sign requests yourself.

### Example 1


This example API request creates a service in your default Region called `ecs-simple-service`. The service uses the `ecs-demo` task definition and it maintains 10 instantiations of that task. It uses both the `FARGATE` and `FARGATE_SPOT` capacity providers.

#### Sample Request


```
POST / HTTP/1.1
Host: ecs.us-east-1.amazonaws.com
Accept-Encoding: identity
Content-Length: 87
X-Amz-Target: AmazonEC2ContainerServiceV20141113.CreateService
X-Amz-Date: 20150429T170125Z
Content-Type: application/x-amz-json-1.1
Authorization: AUTHPARAMS

{
  "serviceName": "ecs-simple-service",
  "taskDefinition": "ecs-demo",
  "desiredCount": 10,
   "capacityProviderStrategy": [ 
      { 
         "base": number,
         "capacityProvider": "FARGATE",
         "weight": 1
      }
   ],
   "capacityProviderStrategy": [ 
      { 
         "base": number,
         "capacityProvider": "FARGATE_SPOT",
         "weight": 1
      }
   ]
}
```

#### Sample Response


```
HTTP/1.1 200 OK
Server: Server
Date: Wed, 29 Apr 2015 17:01:27 GMT
Content-Type: application/x-amz-json-1.1
Content-Length: 636
Connection: keep-alive
x-amzn-RequestId: 123a4b56-7c89-01d2-3ef4-example5678f

{
  "service": {
    "clusterArn": "arn:aws:ecs:us-east-1:012345678910:cluster/default",
    "deploymentConfiguration": {
        "maximumPercent": 200,
        "minimumHealthyPercent": 100
    },
    "deployments": [
      {
        "createdAt": 1430326887.362,
        "desiredCount": 10,
        "id": "ecs-svc/9223370606527888445",
        "pendingCount": 0,
        "runningCount": 0,
        "status": "PRIMARY",
        "taskDefinition": "arn:aws:ecs:us-east-1:012345678910:task-definition/ecs-demo:1",
        "updatedAt": 1430326887.362
      }
    ],
    "capacityProviderStrategy": [
      {
        "capacityProvider": "FARGATE",
        "weight": 1,
        "base": 0
      },
      {
        "capacityProvider": "FARGATE_SPOT",
        "weight": 1,
        "base": 0
      }
    ],
    "desiredCount": 10,
    "events": [],
    "loadBalancers": [],
    "pendingCount": 0,
    "runningCount": 0,
    "serviceArn": "arn:aws:ecs:us-east-1:012345678910:service/default/ecs-simple-service",
    "serviceName": "ecs-simple-service",
    "status": "ACTIVE",
    "taskDefinition": "arn:aws:ecs:us-east-1:012345678910:task-definition/ecs-demo:1"
  }
}
```

### Example 2


This example API request creates a service with multiple load balancer target groups.

#### Sample Request


```
POST / HTTP/1.1
Host: ecs.us-east-1.amazonaws.com
Accept-Encoding: identity
X-Amz-Target: AmazonEC2ContainerServiceV20141113.CreateService
Content-Type: application/x-amz-json-1.1
User-Agent: aws-cli/1.16.190 Python/3.6.1 Darwin/16.7.0 botocore/1.12.180
X-Amz-Date: 20190723T001203Z
Authorization: AUTHPARAMS
Content-Length: 453

{
   "serviceName":"ecs-multiplealb-service",
   "taskDefinition":"ecs-multiplealb-demo",
   "loadBalancers":[
      {
         "targetGroupArn":"arn:aws:elasticloadbalancing:us-east-1:012345678910:targetgroup/tg1/18ce32cc074018ed",
         "containerName":"simple-app",
         "containerPort":80
      },
      {
         "targetGroupArn":"arn:aws:elasticloadbalancing:us-east-1:012345678910:targetgroup/tg2/737bead11d516e2a",
         "containerName":"simple-app",
         "containerPort":8080
      }
   ],
   "desiredCount":10
}
```

#### Sample Response


```
HTTP/1.1 200 OK
x-amzn-RequestId: 123a4b56-7c89-01d2-3ef4-example5678f
Content-Type: application/x-amz-json-1.1
Content-Length: 1440
Date: Tue, 23 Jul 2019 00:12:03 GMT
Connection: keep-alive

{
    "service": {
        "serviceArn": "arn:aws:ecs:us-east-1:012345678910:service/default/ecs-multiplealb-service",
        "serviceName": "ecs-multiplealb-service",
        "clusterArn": "arn:aws:ecs:us-east-1:012345678910:cluster/default",
        "loadBalancers": [
            {
                "targetGroupArn": "arn:aws:elasticloadbalancing:us-east-1:012345678910:targetgroup/tg1/18ce32cc074018ed",
                "containerName": "simple-app",
                "containerPort": 80
            },
            {
                "targetGroupArn": "arn:aws:elasticloadbalancing:us-east-1:012345678910:targetgroup/tg2/737bead11d516e2a",
                "containerName": "simple-app",
                "containerPort": 8080
            }
        ],
        "serviceRegistries": [],
        "status": "ACTIVE",
        "desiredCount": 10,
        "runningCount": 0,
        "pendingCount": 0,
        "launchType": "EC2",
        "taskDefinition": "arn:aws:ecs:us-east-1:012345678910:task-definition/ecs-multiplealb-demo",
        "deploymentConfiguration": {
            "maximumPercent": 200,
            "minimumHealthyPercent": 100
        },
        "deployments": [
            {
                "id": "ecs-svc/9223370473014051517",
                "status": "PRIMARY",
                "taskDefinition": "arn:aws:ecs:us-east-1:012345678910:task-definition/ecs-multiplealb-demo",
                "desiredCount": 10,
                "pendingCount": 0,
                "runningCount": 0,
                "createdAt": 1563840724.29,
                "updatedAt": 1563840724.29,
                "launchType": "EC2"
            }
        ],
        "roleArn": "arn:aws:iam::012345678910:role/aws-service-role/ecs.amazonaws.com/AWSServiceRoleForECS",
        "events": [],
        "createdAt": 1563840724.29,
        "placementConstraints": [],
        "placementStrategy": [],
        "healthCheckGracePeriodSeconds": 0,
        "schedulingStrategy": "REPLICA",
        "enableECSManagedTags": false,
        "propagateTags": "NONE"
    }
}
```

### Example 3


This example API request creates a service with a strategy that distributes tasks evenly across Availability Zones and then bin packs tasks based on memory within each Availability Zone.

#### Sample Request


```
POST / HTTP/1.1
Host: ecs.us-east-1.amazonaws.com
Accept-Encoding: identity
X-Amz-Target: AmazonEC2ContainerServiceV20141113.CreateService
Content-Type: application/x-amz-json-1.1
User-Agent: aws-cli/1.16.190 Python/3.6.1 Darwin/16.7.0 botocore/1.12.180
X-Amz-Date: 20190723T001203Z
Authorization: AUTHPARAMS
Content-Length: 453

{
   "serviceName":"example-placement1",
   "taskDefinition":"windows-simple-iis",
   "placementStrategy": [
        {
            "field": "attribute:ecs.availability-zone",
            "type": "spread"
        },
        {
            "field": "memory",
            "type": "binpack"
        }
   ]
   "desiredCount":3
}
```

#### Sample Response


```
HTTP/1.1 200 OK
x-amzn-RequestId: 123a4b56-7c89-01d2-3ef4-example5678f
Content-Type: application/x-amz-json-1.1
Content-Length: 1440
Date: Tue, 23 Jul 2019 00:12:03 GMT
Connection: keep-alive

{
    "service": {
        "serviceArn": "arn:aws:ecs:us-east-1:123456789012:service/windows-ec2/default/example-placement1",
        "serviceName": "example-placement1",
        "clusterArn": "arn:aws:ecs:us-east-1:123456789012:cluster/windows-ec2",
        "loadBalancers": [],
        "serviceRegistries": [],
        "status": "ACTIVE",
        "desiredCount": 3,
        "runningCount": 0,
        "pendingCount": 0,
        "launchType": "EC2",
        "taskDefinition": "arn:aws:ecs:us-east-1:123456789012:task-definition/windows-simple-iis:2",
        "deploymentConfiguration": {
            "deploymentCircuitBreaker": {
                "enable": false,
                "rollback": false
            },
            "maximumPercent": 200,
            "minimumHealthyPercent": 100
        },
        "deployments": [
            {
                "id": "ecs-svc/409552086333EXAMPLE",
                "status": "PRIMARY",
                "taskDefinition": "arn:aws:ecs:us-east-1:123456789012:task-definition/windows-simple-iis:2",
                "desiredCount": 3,
                "pendingCount": 0,
                "runningCount": 0,
                "failedTasks": 0,
                "createdAt": "2022-07-21T15:06:08.787000-04:00",
                "updatedAt": "2022-07-21T15:06:08.787000-04:00",
                "launchType": "EC2",
                "rolloutState": "IN_PROGRESS",
                "rolloutStateReason": "ECS deployment ecs-svc/409552086333EXAMPLE in progress."
            }
        ],
        "events": [],
        "createdAt": "2022-07-21T15:06:08.787000-04:00",
        "placementConstraints": [],
        "placementStrategy": [
            {
                "type": "spread",
                "field": "attribute:ecs.availability-zone"
            },
            {
                "type": "binpack",
                "field": "MEMORY"
            }
        ],
        "schedulingStrategy": "REPLICA",
        "createdBy": "arn:aws:iam::123456789012:user/johndoe",
        "enableECSManagedTags": false,
        "propagateTags": "NONE",
        "enableExecuteCommand": false
    }
}
```

## See Also


For more information about using this API in one of the language-specific Amazon SDKs, see the following:
+  [Amazon Command Line Interface V2](https://docs.amazonaws.cn/goto/cli2/ecs-2014-11-13/CreateService) 
+  [Amazon SDK for .NET V4](https://docs.amazonaws.cn/goto/DotNetSDKV4/ecs-2014-11-13/CreateService) 
+  [Amazon SDK for C\$1\$1](https://docs.amazonaws.cn/goto/SdkForCpp/ecs-2014-11-13/CreateService) 
+  [Amazon SDK for Go v2](https://docs.amazonaws.cn/goto/SdkForGoV2/ecs-2014-11-13/CreateService) 
+  [Amazon SDK for Java V2](https://docs.amazonaws.cn/goto/SdkForJavaV2/ecs-2014-11-13/CreateService) 
+  [Amazon SDK for JavaScript V3](https://docs.amazonaws.cn/goto/SdkForJavaScriptV3/ecs-2014-11-13/CreateService) 
+  [Amazon SDK for Kotlin](https://docs.amazonaws.cn/goto/SdkForKotlin/ecs-2014-11-13/CreateService) 
+  [Amazon SDK for PHP V3](https://docs.amazonaws.cn/goto/SdkForPHPV3/ecs-2014-11-13/CreateService) 
+  [Amazon SDK for Python](https://docs.amazonaws.cn/goto/boto3/ecs-2014-11-13/CreateService) 
+  [Amazon SDK for Ruby V3](https://docs.amazonaws.cn/goto/SdkForRubyV3/ecs-2014-11-13/CreateService) 

# 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](https://docs.amazonaws.cn/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.amazonaws.cn/AmazonECS/latest/developerguide/service-quotas.html) in the *Amazon Elastic Container Service Developer Guide*.

## Request Syntax


```
{
   "capacityProviderStrategy": [ 
      { 
         "base": number,
         "capacityProvider": "string",
         "weight": number
      }
   ],
   "clientToken": "string",
   "cluster": "string",
   "externalId": "string",
   "launchType": "string",
   "loadBalancers": [ 
      { 
         "advancedConfiguration": { 
            "alternateTargetGroupArn": "string",
            "productionListenerRule": "string",
            "roleArn": "string",
            "testListenerRule": "string"
         },
         "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"
      }
   ],
   "tags": [ 
      { 
         "key": "string",
         "value": "string"
      }
   ],
   "taskDefinition": "string"
}
```

## Request Parameters


For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [capacityProviderStrategy](#API_CreateTaskSet_RequestSyntax) **   <a name="ECS-CreateTaskSet-request-capacityProviderStrategy"></a>
The capacity provider strategy to use for the task set.  
A capacity provider strategy consists of one or more capacity providers along with the `base` and `weight` to assign to them. A capacity provider must be associated with the cluster to be used in a capacity provider strategy. The [PutClusterCapacityProviders](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_PutClusterCapacityProviders.html) API is used to associate a capacity provider with a cluster. Only capacity providers with an `ACTIVE` or `UPDATING` status can be used.  
If a `capacityProviderStrategy` is specified, the `launchType` parameter must be omitted. If no `capacityProviderStrategy` or `launchType` is specified, the `defaultCapacityProviderStrategy` for the cluster is used.  
If specifying a capacity provider that uses an Auto Scaling group, the capacity provider must already be created. New capacity providers can be created with the [CreateCapacityProviderProvider](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_CreateCapacityProviderProvider.html)API operation.  
To use a Amazon Fargate capacity provider, specify either the `FARGATE` or `FARGATE_SPOT` capacity providers. The Amazon Fargate capacity providers are available to all accounts and only need to be associated with a cluster to be used.  
The [PutClusterCapacityProviders](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_PutClusterCapacityProviders.html) API operation is used to update the list of available capacity providers for a cluster after the cluster is created.  
Type: Array of [CapacityProviderStrategyItem](API_CapacityProviderStrategyItem.md) objects  
Required: No

 ** [clientToken](#API_CreateTaskSet_RequestSyntax) **   <a name="ECS-CreateTaskSet-request-clientToken"></a>
An identifier that you provide to ensure the idempotency of the request. It must be unique and is case sensitive. Up to 36 ASCII characters in the range of 33-126 (inclusive) are allowed.  
Type: String  
Required: No

 ** [cluster](#API_CreateTaskSet_RequestSyntax) **   <a name="ECS-CreateTaskSet-request-cluster"></a>
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](#API_CreateTaskSet_RequestSyntax) **   <a name="ECS-CreateTaskSet-request-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` Amazon Cloud Map attribute set to the provided value.  
Type: String  
Required: No

 ** [launchType](#API_CreateTaskSet_RequestSyntax) **   <a name="ECS-CreateTaskSet-request-launchType"></a>
The launch type that new tasks in the task set uses. For more information, see [Amazon ECS launch types](https://docs.amazonaws.cn/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.  
Type: String  
Valid Values: `EC2 | FARGATE | EXTERNAL | MANAGED_INSTANCES`   
Required: No

 ** [loadBalancers](#API_CreateTaskSet_RequestSyntax) **   <a name="ECS-CreateTaskSet-request-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.  
Type: Array of [LoadBalancer](API_LoadBalancer.md) objects  
Required: No

 ** [networkConfiguration](#API_CreateTaskSet_RequestSyntax) **   <a name="ECS-CreateTaskSet-request-networkConfiguration"></a>
An object representing the network configuration for a task set.  
Type: [NetworkConfiguration](API_NetworkConfiguration.md) object  
Required: No

 ** [platformVersion](#API_CreateTaskSet_RequestSyntax) **   <a name="ECS-CreateTaskSet-request-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.  
Type: String  
Required: No

 ** [scale](#API_CreateTaskSet_RequestSyntax) **   <a name="ECS-CreateTaskSet-request-scale"></a>
A floating-point percentage of the desired number of tasks to place and keep running in the task set.  
Type: [Scale](API_Scale.md) object  
Required: No

 ** [service](#API_CreateTaskSet_RequestSyntax) **   <a name="ECS-CreateTaskSet-request-service"></a>
The short name or full Amazon Resource Name (ARN) of the service to create the task set in.  
Type: String  
Required: Yes

 ** [serviceRegistries](#API_CreateTaskSet_RequestSyntax) **   <a name="ECS-CreateTaskSet-request-serviceRegistries"></a>
The details of the service discovery registries to assign to this task set. For more information, see [Service discovery](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/service-discovery.html).  
Type: Array of [ServiceRegistry](API_ServiceRegistry.md) objects  
Required: No

 ** [tags](#API_CreateTaskSet_RequestSyntax) **   <a name="ECS-CreateTaskSet-request-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. When a service is deleted, the tags are deleted.  
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 Amazon 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.
Type: Array of [Tag](API_Tag.md) objects  
Array Members: Minimum number of 0 items. Maximum number of 50 items.  
Required: No

 ** [taskDefinition](#API_CreateTaskSet_RequestSyntax) **   <a name="ECS-CreateTaskSet-request-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.  
Type: String  
Required: Yes

## Response Syntax


```
{
   "taskSet": { 
      "capacityProviderStrategy": [ 
         { 
            "base": number,
            "capacityProvider": "string",
            "weight": number
         }
      ],
      "clusterArn": "string",
      "computedDesiredCount": number,
      "createdAt": number,
      "externalId": "string",
      "fargateEphemeralStorage": { 
         "kmsKeyId": "string"
      },
      "id": "string",
      "launchType": "string",
      "loadBalancers": [ 
         { 
            "advancedConfiguration": { 
               "alternateTargetGroupArn": "string",
               "productionListenerRule": "string",
               "roleArn": "string",
               "testListenerRule": "string"
            },
            "containerName": "string",
            "containerPort": number,
            "loadBalancerName": "string",
            "targetGroupArn": "string"
         }
      ],
      "networkConfiguration": { 
         "awsvpcConfiguration": { 
            "assignPublicIp": "string",
            "securityGroups": [ "string" ],
            "subnets": [ "string" ]
         }
      },
      "pendingCount": number,
      "platformFamily": "string",
      "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",
      "tags": [ 
         { 
            "key": "string",
            "value": "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](#API_CreateTaskSet_ResponseSyntax) **   <a name="ECS-CreateTaskSet-response-taskSet"></a>
Information about a set of Amazon ECS tasks in either an Amazon CodeDeploy or an `EXTERNAL` deployment. A 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](API_TaskSet.md) object

## Errors


For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** AccessDeniedException **   
You don't have authorization to perform the requested action.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ClientException **   
These errors are usually caused by a client action. This client action might be using an action or resource on behalf of a user that doesn't have permissions to use the action or resource. Or, it might be specifying an identifier that isn't valid.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ClusterNotFoundException **   
The specified cluster wasn't found. You can view your available clusters with [ListClusters](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_ListClusters.html). Amazon ECS clusters are Region specific.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** InvalidParameterException **   
The specified parameter isn't valid. Review the available parameters for the API request.  
For more information about service event errors, see [Amazon ECS service event messages](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/service-event-messages-list.html).     
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** NamespaceNotFoundException **   
The specified namespace wasn't found.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** PlatformTaskDefinitionIncompatibilityException **   
The specified platform version doesn't satisfy the required capabilities of the task definition.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** PlatformUnknownException **   
The specified platform version doesn't exist.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ServerException **   
These errors are usually caused by a server issue.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 500

 ** ServiceNotActiveException **   
The specified service isn't active. You can't update a service that's inactive. If you have previously deleted a service, you can re-create it with [CreateService](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_CreateService.html).    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ServiceNotFoundException **   
The specified service wasn't found. You can view your available services with [ListServices](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_ListServices.html). Amazon ECS services are cluster specific and Region specific.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** UnsupportedFeatureException **   
The specified task isn't supported in this Region.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

## See Also


For more information about using this API in one of the language-specific Amazon SDKs, see the following:
+  [Amazon Command Line Interface V2](https://docs.amazonaws.cn/goto/cli2/ecs-2014-11-13/CreateTaskSet) 
+  [Amazon SDK for .NET V4](https://docs.amazonaws.cn/goto/DotNetSDKV4/ecs-2014-11-13/CreateTaskSet) 
+  [Amazon SDK for C\$1\$1](https://docs.amazonaws.cn/goto/SdkForCpp/ecs-2014-11-13/CreateTaskSet) 
+  [Amazon SDK for Go v2](https://docs.amazonaws.cn/goto/SdkForGoV2/ecs-2014-11-13/CreateTaskSet) 
+  [Amazon SDK for Java V2](https://docs.amazonaws.cn/goto/SdkForJavaV2/ecs-2014-11-13/CreateTaskSet) 
+  [Amazon SDK for JavaScript V3](https://docs.amazonaws.cn/goto/SdkForJavaScriptV3/ecs-2014-11-13/CreateTaskSet) 
+  [Amazon SDK for Kotlin](https://docs.amazonaws.cn/goto/SdkForKotlin/ecs-2014-11-13/CreateTaskSet) 
+  [Amazon SDK for PHP V3](https://docs.amazonaws.cn/goto/SdkForPHPV3/ecs-2014-11-13/CreateTaskSet) 
+  [Amazon SDK for Python](https://docs.amazonaws.cn/goto/boto3/ecs-2014-11-13/CreateTaskSet) 
+  [Amazon SDK for Ruby V3](https://docs.amazonaws.cn/goto/SdkForRubyV3/ecs-2014-11-13/CreateTaskSet) 

# DeleteAccountSetting


Disables an account setting for a specified user, role, or the root user for an account.

## Request Syntax


```
{
   "name": "string",
   "principalArn": "string"
}
```

## Request Parameters


For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [name](#API_DeleteAccountSetting_RequestSyntax) **   <a name="ECS-DeleteAccountSetting-request-name"></a>
The resource name to disable the account setting for. If `serviceLongArnFormat` is specified, the ARN for your Amazon ECS services is affected. If `taskLongArnFormat` is specified, the ARN and resource ID for your Amazon ECS tasks is affected. If `containerInstanceLongArnFormat` is specified, the ARN and resource ID for your Amazon ECS container instances is affected. If `awsvpcTrunking` is specified, the ENI limit for your Amazon ECS container instances is affected.  
Type: String  
Valid Values: `serviceLongArnFormat | taskLongArnFormat | containerInstanceLongArnFormat | awsvpcTrunking | containerInsights | fargateFIPSMode | tagResourceAuthorization | fargateTaskRetirementWaitPeriod | guardDutyActivate | defaultLogDriverMode | fargateEventWindows`   
Required: Yes

 ** [principalArn](#API_DeleteAccountSetting_RequestSyntax) **   <a name="ECS-DeleteAccountSetting-request-principalArn"></a>
The Amazon Resource Name (ARN) of the principal. It can be a user, role, or the root user. If you specify the root user, it disables the account setting for all users, roles, and the root user of the account unless a user or role explicitly overrides these settings. If this field is omitted, the setting is changed only for the authenticated user.  
In order to use this parameter, you must be the root user, or the principal.  
Type: String  
Required: No

## Response Syntax


```
{
   "setting": { 
      "name": "string",
      "principalArn": "string",
      "type": "string",
      "value": "string"
   }
}
```

## 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.

 ** [setting](#API_DeleteAccountSetting_ResponseSyntax) **   <a name="ECS-DeleteAccountSetting-response-setting"></a>
The account setting for the specified principal ARN.  
Type: [Setting](API_Setting.md) object

## Errors


For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** ClientException **   
These errors are usually caused by a client action. This client action might be using an action or resource on behalf of a user that doesn't have permissions to use the action or resource. Or, it might be specifying an identifier that isn't valid.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** InvalidParameterException **   
The specified parameter isn't valid. Review the available parameters for the API request.  
For more information about service event errors, see [Amazon ECS service event messages](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/service-event-messages-list.html).     
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ServerException **   
These errors are usually caused by a server issue.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 500

## See Also


For more information about using this API in one of the language-specific Amazon SDKs, see the following:
+  [Amazon Command Line Interface V2](https://docs.amazonaws.cn/goto/cli2/ecs-2014-11-13/DeleteAccountSetting) 
+  [Amazon SDK for .NET V4](https://docs.amazonaws.cn/goto/DotNetSDKV4/ecs-2014-11-13/DeleteAccountSetting) 
+  [Amazon SDK for C\$1\$1](https://docs.amazonaws.cn/goto/SdkForCpp/ecs-2014-11-13/DeleteAccountSetting) 
+  [Amazon SDK for Go v2](https://docs.amazonaws.cn/goto/SdkForGoV2/ecs-2014-11-13/DeleteAccountSetting) 
+  [Amazon SDK for Java V2](https://docs.amazonaws.cn/goto/SdkForJavaV2/ecs-2014-11-13/DeleteAccountSetting) 
+  [Amazon SDK for JavaScript V3](https://docs.amazonaws.cn/goto/SdkForJavaScriptV3/ecs-2014-11-13/DeleteAccountSetting) 
+  [Amazon SDK for Kotlin](https://docs.amazonaws.cn/goto/SdkForKotlin/ecs-2014-11-13/DeleteAccountSetting) 
+  [Amazon SDK for PHP V3](https://docs.amazonaws.cn/goto/SdkForPHPV3/ecs-2014-11-13/DeleteAccountSetting) 
+  [Amazon SDK for Python](https://docs.amazonaws.cn/goto/boto3/ecs-2014-11-13/DeleteAccountSetting) 
+  [Amazon SDK for Ruby V3](https://docs.amazonaws.cn/goto/SdkForRubyV3/ecs-2014-11-13/DeleteAccountSetting) 

# DeleteAttributes


Deletes one or more custom attributes from an Amazon ECS resource.

## Request Syntax


```
{
   "attributes": [ 
      { 
         "name": "string",
         "targetId": "string",
         "targetType": "string",
         "value": "string"
      }
   ],
   "cluster": "string"
}
```

## Request Parameters


For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [attributes](#API_DeleteAttributes_RequestSyntax) **   <a name="ECS-DeleteAttributes-request-attributes"></a>
The attributes to delete from your resource. You can specify up to 10 attributes for each request. For custom attributes, specify the attribute name and target ID, but don't specify the value. If you specify the target ID using the short form, you must also specify the target type.  
Type: Array of [Attribute](API_Attribute.md) objects  
Required: Yes

 ** [cluster](#API_DeleteAttributes_RequestSyntax) **   <a name="ECS-DeleteAttributes-request-cluster"></a>
The short name or full Amazon Resource Name (ARN) of the cluster that contains the resource to delete attributes. If you do not specify a cluster, the default cluster is assumed.  
Type: String  
Required: No

## Response Syntax


```
{
   "attributes": [ 
      { 
         "name": "string",
         "targetId": "string",
         "targetType": "string",
         "value": "string"
      }
   ]
}
```

## 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.

 ** [attributes](#API_DeleteAttributes_ResponseSyntax) **   <a name="ECS-DeleteAttributes-response-attributes"></a>
A list of attribute objects that were successfully deleted from your resource.  
Type: Array of [Attribute](API_Attribute.md) objects

## Errors


For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** ClusterNotFoundException **   
The specified cluster wasn't found. You can view your available clusters with [ListClusters](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_ListClusters.html). Amazon ECS clusters are Region specific.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** InvalidParameterException **   
The specified parameter isn't valid. Review the available parameters for the API request.  
For more information about service event errors, see [Amazon ECS service event messages](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/service-event-messages-list.html).     
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** TargetNotFoundException **   
The specified target wasn't found. You can view your available container instances with [ListContainerInstances](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_ListContainerInstances.html). Amazon ECS container instances are cluster-specific and Region-specific.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

## Examples


In the following example or examples, the Authorization header contents (`AUTHPARAMS`) must be replaced with an Amazon Signature Version 4 signature. For more information, see [Signature Version 4 Signing Process](https://docs.amazonaws.cn/general/latest/gr/signature-version-4.html) in the * Amazon General Reference*.

You only need to learn how to sign HTTP requests if you intend to create them manually. When you use the [Amazon Command Line Interface](http://www.amazonaws.cn/cli/) or one of the [Amazon SDKs](http://www.amazonaws.cn/tools/) to make requests to Amazon, these tools automatically sign the requests for you, with the access key that you specify when you configure the tools. When you use these tools, you don't have to sign requests yourself.

### Example


This example deletes an attribute with the name `stack` from a container instance.

#### Sample Request


```
POST / HTTP/1.1
Host: ecs.us-west-2.amazonaws.com
Accept-Encoding: identity
Content-Length: 169
X-Amz-Target: AmazonEC2ContainerServiceV20141113.DeleteAttributes
X-Amz-Date: 20161222T193851Z
User-Agent: aws-cli/1.11.30 Python/2.7.12 Darwin/16.3.0 botocore/1.4.87
Content-Type: application/x-amz-json-1.1
Authorization: AUTHPARAMS

{
  "cluster": "default",
  "attributes": [
    {
      "targetId": "arn:aws:ecs:us-west-2:123456789012:container-instance/1c3be8ed-df30-47b4-8f1e-6e68ebd01f34",
      "name": "stack"
    }
  ]
}
```

#### Sample Response


```
HTTP/1.1 200 OK
Server: Server
Date: Thu, 22 Dec 2016 19:38:51 GMT
Content-Type: application/x-amz-json-1.1
Content-Length: 158
Connection: keep-alive
x-amzn-RequestId: 445193ca-c87e-11e6-86db-1bd3d9928caf

{
  "attributes": [
    {
      "name": "stack",
      "targetId": "arn:aws:ecs:us-west-2:123456789012:container-instance/1c3be8ed-df30-47b4-8f1e-6e68ebd01f34",
      "value": "production"
    }
  ]
}
```

## See Also


For more information about using this API in one of the language-specific Amazon SDKs, see the following:
+  [Amazon Command Line Interface V2](https://docs.amazonaws.cn/goto/cli2/ecs-2014-11-13/DeleteAttributes) 
+  [Amazon SDK for .NET V4](https://docs.amazonaws.cn/goto/DotNetSDKV4/ecs-2014-11-13/DeleteAttributes) 
+  [Amazon SDK for C\$1\$1](https://docs.amazonaws.cn/goto/SdkForCpp/ecs-2014-11-13/DeleteAttributes) 
+  [Amazon SDK for Go v2](https://docs.amazonaws.cn/goto/SdkForGoV2/ecs-2014-11-13/DeleteAttributes) 
+  [Amazon SDK for Java V2](https://docs.amazonaws.cn/goto/SdkForJavaV2/ecs-2014-11-13/DeleteAttributes) 
+  [Amazon SDK for JavaScript V3](https://docs.amazonaws.cn/goto/SdkForJavaScriptV3/ecs-2014-11-13/DeleteAttributes) 
+  [Amazon SDK for Kotlin](https://docs.amazonaws.cn/goto/SdkForKotlin/ecs-2014-11-13/DeleteAttributes) 
+  [Amazon SDK for PHP V3](https://docs.amazonaws.cn/goto/SdkForPHPV3/ecs-2014-11-13/DeleteAttributes) 
+  [Amazon SDK for Python](https://docs.amazonaws.cn/goto/boto3/ecs-2014-11-13/DeleteAttributes) 
+  [Amazon SDK for Ruby V3](https://docs.amazonaws.cn/goto/SdkForRubyV3/ecs-2014-11-13/DeleteAttributes) 

# DeleteCapacityProvider


Deletes the specified capacity provider.

**Note**  
The `FARGATE` and `FARGATE_SPOT` capacity providers are reserved and can't be deleted. You can disassociate them from a cluster using either [PutClusterCapacityProviders](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_PutClusterCapacityProviders.html) or by deleting the cluster.

Prior to a capacity provider being deleted, the capacity provider must be removed from the capacity provider strategy from all services. The [UpdateService](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_UpdateService.html) API can be used to remove a capacity provider from a service's capacity provider strategy. When updating a service, the `forceNewDeployment` option can be used to ensure that any tasks using the Amazon EC2 instance capacity provided by the capacity provider are transitioned to use the capacity from the remaining capacity providers. Only capacity providers that aren't associated with a cluster can be deleted. To remove a capacity provider from a cluster, you can either use [PutClusterCapacityProviders](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_PutClusterCapacityProviders.html) or delete the cluster.

## Request Syntax


```
{
   "capacityProvider": "string",
   "cluster": "string"
}
```

## Request Parameters


For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [capacityProvider](#API_DeleteCapacityProvider_RequestSyntax) **   <a name="ECS-DeleteCapacityProvider-request-capacityProvider"></a>
The short name or full Amazon Resource Name (ARN) of the capacity provider to delete.  
Type: String  
Required: Yes

 ** [cluster](#API_DeleteCapacityProvider_RequestSyntax) **   <a name="ECS-DeleteCapacityProvider-request-cluster"></a>
The name of the cluster that contains the capacity provider to delete. Managed instances capacity providers are cluster-scoped and can only be deleted from their associated cluster.  
Type: String  
Required: No

## Response Syntax


```
{
   "capacityProvider": { 
      "autoScalingGroupProvider": { 
         "autoScalingGroupArn": "string",
         "managedDraining": "string",
         "managedScaling": { 
            "instanceWarmupPeriod": number,
            "maximumScalingStepSize": number,
            "minimumScalingStepSize": number,
            "status": "string",
            "targetCapacity": number
         },
         "managedTerminationProtection": "string"
      },
      "capacityProviderArn": "string",
      "cluster": "string",
      "managedInstancesProvider": { 
         "infrastructureOptimization": { 
            "scaleInAfter": number
         },
         "infrastructureRoleArn": "string",
         "instanceLaunchTemplate": { 
            "capacityOptionType": "string",
            "capacityReservations": { 
               "reservationGroupArn": "string",
               "reservationPreference": "string"
            },
            "ec2InstanceProfileArn": "string",
            "fipsEnabled": boolean,
            "instanceMetadataTagsPropagation": boolean,
            "instanceRequirements": { 
               "acceleratorCount": { 
                  "max": number,
                  "min": number
               },
               "acceleratorManufacturers": [ "string" ],
               "acceleratorNames": [ "string" ],
               "acceleratorTotalMemoryMiB": { 
                  "max": number,
                  "min": number
               },
               "acceleratorTypes": [ "string" ],
               "allowedInstanceTypes": [ "string" ],
               "bareMetal": "string",
               "baselineEbsBandwidthMbps": { 
                  "max": number,
                  "min": number
               },
               "burstablePerformance": "string",
               "cpuManufacturers": [ "string" ],
               "excludedInstanceTypes": [ "string" ],
               "instanceGenerations": [ "string" ],
               "localStorage": "string",
               "localStorageTypes": [ "string" ],
               "maxSpotPriceAsPercentageOfOptimalOnDemandPrice": number,
               "memoryGiBPerVCpu": { 
                  "max": number,
                  "min": number
               },
               "memoryMiB": { 
                  "max": number,
                  "min": number
               },
               "networkBandwidthGbps": { 
                  "max": number,
                  "min": number
               },
               "networkInterfaceCount": { 
                  "max": number,
                  "min": number
               },
               "onDemandMaxPricePercentageOverLowestPrice": number,
               "requireHibernateSupport": boolean,
               "spotMaxPricePercentageOverLowestPrice": number,
               "totalLocalStorageGB": { 
                  "max": number,
                  "min": number
               },
               "vCpuCount": { 
                  "max": number,
                  "min": number
               }
            },
            "localStorageConfiguration": { 
               "useLocalStorage": boolean
            },
            "monitoring": "string",
            "networkConfiguration": { 
               "securityGroups": [ "string" ],
               "subnets": [ "string" ]
            },
            "storageConfiguration": { 
               "storageSizeGiB": number
            }
         },
         "propagateTags": "string"
      },
      "name": "string",
      "status": "string",
      "tags": [ 
         { 
            "key": "string",
            "value": "string"
         }
      ],
      "type": "string",
      "updateStatus": "string",
      "updateStatusReason": "string"
   }
}
```

## 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.

 ** [capacityProvider](#API_DeleteCapacityProvider_ResponseSyntax) **   <a name="ECS-DeleteCapacityProvider-response-capacityProvider"></a>
The details of the capacity provider.  
Type: [CapacityProvider](API_CapacityProvider.md) object

## Errors


For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** ClientException **   
These errors are usually caused by a client action. This client action might be using an action or resource on behalf of a user that doesn't have permissions to use the action or resource. Or, it might be specifying an identifier that isn't valid.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ClusterNotFoundException **   
The specified cluster wasn't found. You can view your available clusters with [ListClusters](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_ListClusters.html). Amazon ECS clusters are Region specific.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** InvalidParameterException **   
The specified parameter isn't valid. Review the available parameters for the API request.  
For more information about service event errors, see [Amazon ECS service event messages](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/service-event-messages-list.html).     
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ServerException **   
These errors are usually caused by a server issue.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 500

 ** UnsupportedFeatureException **   
The specified task isn't supported in this Region.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

## See Also


For more information about using this API in one of the language-specific Amazon SDKs, see the following:
+  [Amazon Command Line Interface V2](https://docs.amazonaws.cn/goto/cli2/ecs-2014-11-13/DeleteCapacityProvider) 
+  [Amazon SDK for .NET V4](https://docs.amazonaws.cn/goto/DotNetSDKV4/ecs-2014-11-13/DeleteCapacityProvider) 
+  [Amazon SDK for C\$1\$1](https://docs.amazonaws.cn/goto/SdkForCpp/ecs-2014-11-13/DeleteCapacityProvider) 
+  [Amazon SDK for Go v2](https://docs.amazonaws.cn/goto/SdkForGoV2/ecs-2014-11-13/DeleteCapacityProvider) 
+  [Amazon SDK for Java V2](https://docs.amazonaws.cn/goto/SdkForJavaV2/ecs-2014-11-13/DeleteCapacityProvider) 
+  [Amazon SDK for JavaScript V3](https://docs.amazonaws.cn/goto/SdkForJavaScriptV3/ecs-2014-11-13/DeleteCapacityProvider) 
+  [Amazon SDK for Kotlin](https://docs.amazonaws.cn/goto/SdkForKotlin/ecs-2014-11-13/DeleteCapacityProvider) 
+  [Amazon SDK for PHP V3](https://docs.amazonaws.cn/goto/SdkForPHPV3/ecs-2014-11-13/DeleteCapacityProvider) 
+  [Amazon SDK for Python](https://docs.amazonaws.cn/goto/boto3/ecs-2014-11-13/DeleteCapacityProvider) 
+  [Amazon SDK for Ruby V3](https://docs.amazonaws.cn/goto/SdkForRubyV3/ecs-2014-11-13/DeleteCapacityProvider) 

# DeleteCluster


Deletes the specified cluster. The cluster transitions to the `INACTIVE` state. Clusters with an `INACTIVE` status might remain discoverable in your account for a period of time. However, this behavior is subject to change in the future. We don't recommend that you rely on `INACTIVE` clusters persisting.

You must deregister all container instances from this cluster before you may delete it. You can list the container instances in a cluster with [ListContainerInstances](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_ListContainerInstances.html) and deregister them with [DeregisterContainerInstance](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_DeregisterContainerInstance.html).

## Request Syntax


```
{
   "cluster": "string"
}
```

## Request Parameters


For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [cluster](#API_DeleteCluster_RequestSyntax) **   <a name="ECS-DeleteCluster-request-cluster"></a>
The short name or full Amazon Resource Name (ARN) of the cluster to delete.  
Type: String  
Required: Yes

## Response Syntax


```
{
   "cluster": { 
      "activeServicesCount": number,
      "attachments": [ 
         { 
            "details": [ 
               { 
                  "name": "string",
                  "value": "string"
               }
            ],
            "id": "string",
            "status": "string",
            "type": "string"
         }
      ],
      "attachmentsStatus": "string",
      "capacityProviders": [ "string" ],
      "clusterArn": "string",
      "clusterName": "string",
      "configuration": { 
         "executeCommandConfiguration": { 
            "kmsKeyId": "string",
            "logConfiguration": { 
               "cloudWatchEncryptionEnabled": boolean,
               "cloudWatchLogGroupName": "string",
               "s3BucketName": "string",
               "s3EncryptionEnabled": boolean,
               "s3KeyPrefix": "string"
            },
            "logging": "string"
         },
         "managedStorageConfiguration": { 
            "fargateEphemeralStorageKmsKeyId": "string",
            "kmsKeyId": "string"
         }
      },
      "defaultCapacityProviderStrategy": [ 
         { 
            "base": number,
            "capacityProvider": "string",
            "weight": number
         }
      ],
      "pendingTasksCount": number,
      "registeredContainerInstancesCount": number,
      "runningTasksCount": number,
      "serviceConnectDefaults": { 
         "namespace": "string"
      },
      "settings": [ 
         { 
            "name": "string",
            "value": "string"
         }
      ],
      "statistics": [ 
         { 
            "name": "string",
            "value": "string"
         }
      ],
      "status": "string",
      "tags": [ 
         { 
            "key": "string",
            "value": "string"
         }
      ]
   }
}
```

## 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.

 ** [cluster](#API_DeleteCluster_ResponseSyntax) **   <a name="ECS-DeleteCluster-response-cluster"></a>
The full description of the deleted cluster.  
Type: [Cluster](API_Cluster.md) object

## Errors


For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** ClientException **   
These errors are usually caused by a client action. This client action might be using an action or resource on behalf of a user that doesn't have permissions to use the action or resource. Or, it might be specifying an identifier that isn't valid.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ClusterContainsCapacityProviderException **   
The cluster contains one or more capacity providers that prevent the requested operation. This exception occurs when you try to delete a cluster that still has active capacity providers, including Amazon ECS Managed Instances capacity providers. You must first delete all capacity providers from the cluster before you can delete the cluster itself.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ClusterContainsContainerInstancesException **   
You can't delete a cluster that has registered container instances. First, deregister the container instances before you can delete the cluster. For more information, see [DeregisterContainerInstance](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_DeregisterContainerInstance.html).    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ClusterContainsServicesException **   
You can't delete a cluster that contains services. First, update the service to reduce its desired task count to 0, and then delete the service. For more information, see [UpdateService](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_UpdateService.html) and [DeleteService](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_DeleteService.html).    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ClusterContainsTasksException **   
You can't delete a cluster that has active tasks.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ClusterNotFoundException **   
The specified cluster wasn't found. You can view your available clusters with [ListClusters](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_ListClusters.html). Amazon ECS clusters are Region specific.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** InvalidParameterException **   
The specified parameter isn't valid. Review the available parameters for the API request.  
For more information about service event errors, see [Amazon ECS service event messages](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/service-event-messages-list.html).     
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ServerException **   
These errors are usually caused by a server issue.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 500

 ** UpdateInProgressException **   
There's already a current Amazon ECS container agent update in progress on the container instance that's specified. If the container agent becomes disconnected while it's in a transitional stage, such as `PENDING` or `STAGING`, the update process can get stuck in that state. However, when the agent reconnects, it resumes where it stopped previously.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

## Examples


In the following example or examples, the Authorization header contents (`AUTHPARAMS`) must be replaced with an Amazon Signature Version 4 signature. For more information, see [Signature Version 4 Signing Process](https://docs.amazonaws.cn/general/latest/gr/signature-version-4.html) in the * Amazon General Reference*.

You only need to learn how to sign HTTP requests if you intend to create them manually. When you use the [Amazon Command Line Interface](http://www.amazonaws.cn/cli/) or one of the [Amazon SDKs](http://www.amazonaws.cn/tools/) to make requests to Amazon, these tools automatically sign the requests for you, with the access key that you specify when you configure the tools. When you use these tools, you don't have to sign requests yourself.

### Example


This example request deletes the cluster called `My-cluster`.

#### Sample Request


```
POST / HTTP/1.1
Host: ecs.us-east-1.amazonaws.com
Accept-Encoding: identity
Content-Length: 25
X-Amz-Target: AmazonEC2ContainerServiceV20141113.DeleteCluster
X-Amz-Date: 20150429T170952Z
Content-Type: application/x-amz-json-1.1
Authorization: AUTHPARAMS

{
  "cluster": "My-cluster"
}
```

#### Sample Response


```
HTTP/1.1 200 OK
Server: Server
Date: Wed, 29 Apr 2015 17:09:54 GMT
Content-Type: application/x-amz-json-1.1
Content-Length: 211
Connection: keep-alive
x-amzn-RequestId: 123a4b56-7c89-01d2-3ef4-example5678f

{
  "cluster": {
    "activeServicesCount": 0,
    "clusterArn": "arn:aws:ecs:us-east-1:012345678910:cluster/My-cluster",
    "clusterName": "My-cluster",
    "pendingTasksCount": 0,
    "registeredContainerInstancesCount": 0,
    "runningTasksCount": 0,
    "status": "INACTIVE"
  }
}
```

## See Also


For more information about using this API in one of the language-specific Amazon SDKs, see the following:
+  [Amazon Command Line Interface V2](https://docs.amazonaws.cn/goto/cli2/ecs-2014-11-13/DeleteCluster) 
+  [Amazon SDK for .NET V4](https://docs.amazonaws.cn/goto/DotNetSDKV4/ecs-2014-11-13/DeleteCluster) 
+  [Amazon SDK for C\$1\$1](https://docs.amazonaws.cn/goto/SdkForCpp/ecs-2014-11-13/DeleteCluster) 
+  [Amazon SDK for Go v2](https://docs.amazonaws.cn/goto/SdkForGoV2/ecs-2014-11-13/DeleteCluster) 
+  [Amazon SDK for Java V2](https://docs.amazonaws.cn/goto/SdkForJavaV2/ecs-2014-11-13/DeleteCluster) 
+  [Amazon SDK for JavaScript V3](https://docs.amazonaws.cn/goto/SdkForJavaScriptV3/ecs-2014-11-13/DeleteCluster) 
+  [Amazon SDK for Kotlin](https://docs.amazonaws.cn/goto/SdkForKotlin/ecs-2014-11-13/DeleteCluster) 
+  [Amazon SDK for PHP V3](https://docs.amazonaws.cn/goto/SdkForPHPV3/ecs-2014-11-13/DeleteCluster) 
+  [Amazon SDK for Python](https://docs.amazonaws.cn/goto/boto3/ecs-2014-11-13/DeleteCluster) 
+  [Amazon SDK for Ruby V3](https://docs.amazonaws.cn/goto/SdkForRubyV3/ecs-2014-11-13/DeleteCluster) 

# DeleteDaemon


Deletes the specified daemon. The daemon must be in an `ACTIVE` state to be deleted. Deleting a daemon stops all running daemon tasks on the associated container instances. Amazon ECS drains existing container instances and provisions new instances without the deleted daemon. Amazon ECS automatically launches replacement tasks for your Amazon ECS services.

**Note**  
ECS Managed Daemons is only supported for Amazon ECS Managed Instances Capacity Providers.

## Request Syntax


```
{
   "daemonArn": "string"
}
```

## Request Parameters


For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [daemonArn](#API_DeleteDaemon_RequestSyntax) **   <a name="ECS-DeleteDaemon-request-daemonArn"></a>
The Amazon Resource Name (ARN) of the daemon to delete.  
Type: String  
Required: Yes

## Response Syntax


```
{
   "createdAt": number,
   "daemonArn": "string",
   "deploymentArn": "string",
   "status": "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.

 ** [createdAt](#API_DeleteDaemon_ResponseSyntax) **   <a name="ECS-DeleteDaemon-response-createdAt"></a>
The Unix timestamp for the time when the daemon was created.  
Type: Timestamp

 ** [daemonArn](#API_DeleteDaemon_ResponseSyntax) **   <a name="ECS-DeleteDaemon-response-daemonArn"></a>
The Amazon Resource Name (ARN) of the daemon.  
Type: String

 ** [deploymentArn](#API_DeleteDaemon_ResponseSyntax) **   <a name="ECS-DeleteDaemon-response-deploymentArn"></a>
The Amazon Resource Name (ARN) of the daemon deployment that was triggered by the delete operation. This deployment drains existing daemon tasks from the container instances.  
Type: String

 ** [status](#API_DeleteDaemon_ResponseSyntax) **   <a name="ECS-DeleteDaemon-response-status"></a>
The status of the daemon. After you call `DeleteDaemon`, the status changes to `DELETE_IN_PROGRESS`.  
Type: String  
Valid Values: `ACTIVE | DELETE_IN_PROGRESS` 

 ** [updatedAt](#API_DeleteDaemon_ResponseSyntax) **   <a name="ECS-DeleteDaemon-response-updatedAt"></a>
The Unix timestamp for the time when the daemon was last updated.  
Type: Timestamp

## Errors


For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** AccessDeniedException **   
You don't have authorization to perform the requested action.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ClientException **   
These errors are usually caused by a client action. This client action might be using an action or resource on behalf of a user that doesn't have permissions to use the action or resource. Or, it might be specifying an identifier that isn't valid.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ClusterNotFoundException **   
The specified cluster wasn't found. You can view your available clusters with [ListClusters](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_ListClusters.html). Amazon ECS clusters are Region specific.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** DaemonNotActiveException **   
The specified daemon isn't active. You can't update a daemon that's inactive. If you have previously deleted a daemon, you can re-create it with [CreateDaemon](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_CreateDaemon.html).  
HTTP Status Code: 400

 ** DaemonNotFoundException **   
The specified daemon wasn't found. You can view your available daemons with [ListDaemons](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_ListDaemons.html). Amazon ECS daemons are cluster specific and Region specific.  
HTTP Status Code: 400

 ** InvalidParameterException **   
The specified parameter isn't valid. Review the available parameters for the API request.  
For more information about service event errors, see [Amazon ECS service event messages](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/service-event-messages-list.html).     
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ServerException **   
These errors are usually caused by a server issue.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 500

 ** UnsupportedFeatureException **   
The specified task isn't supported in this Region.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

## Examples


In the following example or examples, the Authorization header contents (`AUTHPARAMS`) must be replaced with an Amazon Signature Version 4 signature. For more information, see [Signature Version 4 Signing Process](https://docs.amazonaws.cn/general/latest/gr/signature-version-4.html) in the * Amazon General Reference*.

You only need to learn how to sign HTTP requests if you intend to create them manually. When you use the [Amazon Command Line Interface](http://www.amazonaws.cn/cli/) or one of the [Amazon SDKs](http://www.amazonaws.cn/tools/) to make requests to Amazon, these tools automatically sign the requests for you, with the access key that you specify when you configure the tools. When you use these tools, you don't have to sign requests yourself.

### Example


This example deletes the my-monitoring-daemon daemon.

#### Sample Request


```
POST / HTTP/1.1
Host: ecs.us-east-1.amazonaws.com
Accept-Encoding: identity
Content-Length: 94
X-Amz-Target: AmazonEC2ContainerServiceV20141113.DeleteDaemon
X-Amz-Date: 20250325T090000Z
Content-Type: application/x-amz-json-1.1
Authorization: AUTHPARAMS

{
  "daemonArn": "arn:aws:ecs:us-east-1:123456789012:daemon/my-cluster/my-monitoring-daemon"
}
```

#### Sample Response


```
HTTP/1.1 200 OK
Server: Server
Date: Tue, 25 Mar 2025 09:00:00 GMT
Content-Type: application/x-amz-json-1.1
Content-Length: 338
Connection: keep-alive
x-amzn-RequestId: 123a4b56-7c89-01d2-3ef4-example5678f

{
  "daemonArn": "arn:aws:ecs:us-east-1:123456789012:daemon/my-cluster/my-monitoring-daemon",
  "status": "DELETE_IN_PROGRESS",
  "createdAt": "2025-03-15T12:00:00.000Z",
  "updatedAt": "2025-03-25T09:00:00.000Z",
  "deploymentArn": "arn:aws:ecs:us-east-1:123456789012:daemon-deployment/my-cluster/my-monitoring-daemon/mN3oP4qR5sT6uV7w"
}
```

## See Also


For more information about using this API in one of the language-specific Amazon SDKs, see the following:
+  [Amazon Command Line Interface V2](https://docs.amazonaws.cn/goto/cli2/ecs-2014-11-13/DeleteDaemon) 
+  [Amazon SDK for .NET V4](https://docs.amazonaws.cn/goto/DotNetSDKV4/ecs-2014-11-13/DeleteDaemon) 
+  [Amazon SDK for C\$1\$1](https://docs.amazonaws.cn/goto/SdkForCpp/ecs-2014-11-13/DeleteDaemon) 
+  [Amazon SDK for Go v2](https://docs.amazonaws.cn/goto/SdkForGoV2/ecs-2014-11-13/DeleteDaemon) 
+  [Amazon SDK for Java V2](https://docs.amazonaws.cn/goto/SdkForJavaV2/ecs-2014-11-13/DeleteDaemon) 
+  [Amazon SDK for JavaScript V3](https://docs.amazonaws.cn/goto/SdkForJavaScriptV3/ecs-2014-11-13/DeleteDaemon) 
+  [Amazon SDK for Kotlin](https://docs.amazonaws.cn/goto/SdkForKotlin/ecs-2014-11-13/DeleteDaemon) 
+  [Amazon SDK for PHP V3](https://docs.amazonaws.cn/goto/SdkForPHPV3/ecs-2014-11-13/DeleteDaemon) 
+  [Amazon SDK for Python](https://docs.amazonaws.cn/goto/boto3/ecs-2014-11-13/DeleteDaemon) 
+  [Amazon SDK for Ruby V3](https://docs.amazonaws.cn/goto/SdkForRubyV3/ecs-2014-11-13/DeleteDaemon) 

# DeleteDaemonTaskDefinition


Deletes the specified daemon task definition. After a daemon task definition is deleted, no new daemons can be created using this definition. Existing daemons that reference the deleted daemon task definition continue to run.

A daemon task definition must be in an `ACTIVE` state to be deleted.

## Request Syntax


```
{
   "daemonTaskDefinition": "string"
}
```

## Request Parameters


For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [daemonTaskDefinition](#API_DeleteDaemonTaskDefinition_RequestSyntax) **   <a name="ECS-DeleteDaemonTaskDefinition-request-daemonTaskDefinition"></a>
The `family` and `revision` (`family:revision`) or full Amazon Resource Name (ARN) of the daemon task definition to delete.  
Type: String  
Required: Yes

## Response Syntax


```
{
   "daemonTaskDefinitionArn": "string"
}
```

## 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.

 ** [daemonTaskDefinitionArn](#API_DeleteDaemonTaskDefinition_ResponseSyntax) **   <a name="ECS-DeleteDaemonTaskDefinition-response-daemonTaskDefinitionArn"></a>
The full Amazon Resource Name (ARN) of the deleted daemon task definition.  
Type: String

## Errors


For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** AccessDeniedException **   
You don't have authorization to perform the requested action.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ClientException **   
These errors are usually caused by a client action. This client action might be using an action or resource on behalf of a user that doesn't have permissions to use the action or resource. Or, it might be specifying an identifier that isn't valid.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** InvalidParameterException **   
The specified parameter isn't valid. Review the available parameters for the API request.  
For more information about service event errors, see [Amazon ECS service event messages](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/service-event-messages-list.html).     
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ServerException **   
These errors are usually caused by a server issue.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 500

## Examples


In the following example or examples, the Authorization header contents (`AUTHPARAMS`) must be replaced with an Amazon Signature Version 4 signature. For more information, see [Signature Version 4 Signing Process](https://docs.amazonaws.cn/general/latest/gr/signature-version-4.html) in the * Amazon General Reference*.

You only need to learn how to sign HTTP requests if you intend to create them manually. When you use the [Amazon Command Line Interface](http://www.amazonaws.cn/cli/) or one of the [Amazon SDKs](http://www.amazonaws.cn/tools/) to make requests to Amazon, these tools automatically sign the requests for you, with the access key that you specify when you configure the tools. When you use these tools, you don't have to sign requests yourself.

### Example


This example deletes the first revision of the monitoring-agent daemon task definition.

#### Sample Request


```
POST / HTTP/1.1
Host: ecs.us-east-1.amazonaws.com
Accept-Encoding: identity
X-Amz-Target: AmazonEC2ContainerServiceV20141113.DeleteDaemonTaskDefinition
X-Amz-Date: 20250315T103000Z
Content-Type: application/x-amz-json-1.1
Authorization: AUTHPARAMS

{
  "daemonTaskDefinition": "monitoring-agent:1"
}
```

#### Sample Response


```
HTTP/1.1 200 OK
Server: Server
Date: Sat, 15 Mar 2025 10:30:00 GMT
Content-Type: application/x-amz-json-1.1
Content-Length: 97
Connection: keep-alive
x-amzn-RequestId: 123a4b56-7c89-01d2-3ef4-example5678f

{
  "daemonTaskDefinitionArn": "arn:aws:ecs:us-east-1:123456789012:daemon-task-definition/monitoring-agent:1"
}
```

## See Also


For more information about using this API in one of the language-specific Amazon SDKs, see the following:
+  [Amazon Command Line Interface V2](https://docs.amazonaws.cn/goto/cli2/ecs-2014-11-13/DeleteDaemonTaskDefinition) 
+  [Amazon SDK for .NET V4](https://docs.amazonaws.cn/goto/DotNetSDKV4/ecs-2014-11-13/DeleteDaemonTaskDefinition) 
+  [Amazon SDK for C\$1\$1](https://docs.amazonaws.cn/goto/SdkForCpp/ecs-2014-11-13/DeleteDaemonTaskDefinition) 
+  [Amazon SDK for Go v2](https://docs.amazonaws.cn/goto/SdkForGoV2/ecs-2014-11-13/DeleteDaemonTaskDefinition) 
+  [Amazon SDK for Java V2](https://docs.amazonaws.cn/goto/SdkForJavaV2/ecs-2014-11-13/DeleteDaemonTaskDefinition) 
+  [Amazon SDK for JavaScript V3](https://docs.amazonaws.cn/goto/SdkForJavaScriptV3/ecs-2014-11-13/DeleteDaemonTaskDefinition) 
+  [Amazon SDK for Kotlin](https://docs.amazonaws.cn/goto/SdkForKotlin/ecs-2014-11-13/DeleteDaemonTaskDefinition) 
+  [Amazon SDK for PHP V3](https://docs.amazonaws.cn/goto/SdkForPHPV3/ecs-2014-11-13/DeleteDaemonTaskDefinition) 
+  [Amazon SDK for Python](https://docs.amazonaws.cn/goto/boto3/ecs-2014-11-13/DeleteDaemonTaskDefinition) 
+  [Amazon SDK for Ruby V3](https://docs.amazonaws.cn/goto/SdkForRubyV3/ecs-2014-11-13/DeleteDaemonTaskDefinition) 

# DeleteExpressGatewayService


Deletes an Express service and removes all associated Amazon resources. This operation stops service tasks, removes the Application Load Balancer, target groups, security groups, auto-scaling policies, and other managed infrastructure components.

The service enters a `DRAINING` state where existing tasks complete current requests without starting new tasks. After all tasks stop, the service and infrastructure are permanently removed.

This operation cannot be reversed. Back up important data and verify the service is no longer needed before deletion.

## Request Syntax


```
{
   "serviceArn": "string"
}
```

## Request Parameters


For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [serviceArn](#API_DeleteExpressGatewayService_RequestSyntax) **   <a name="ECS-DeleteExpressGatewayService-request-serviceArn"></a>
The Amazon Resource Name (ARN) of the Express service to delete. The ARN uniquely identifies the service within your Amazon account and region.  
Type: String  
Required: Yes

## Response Syntax


```
{
   "service": { 
      "activeConfigurations": [ 
         { 
            "cpu": "string",
            "createdAt": number,
            "executionRoleArn": "string",
            "healthCheckPath": "string",
            "ingressPaths": [ 
               { 
                  "accessType": "string",
                  "endpoint": "string"
               }
            ],
            "memory": "string",
            "networkConfiguration": { 
               "securityGroups": [ "string" ],
               "subnets": [ "string" ]
            },
            "primaryContainer": { 
               "awsLogsConfiguration": { 
                  "logGroup": "string",
                  "logStreamPrefix": "string"
               },
               "command": [ "string" ],
               "containerPort": number,
               "environment": [ 
                  { 
                     "name": "string",
                     "value": "string"
                  }
               ],
               "image": "string",
               "repositoryCredentials": { 
                  "credentialsParameter": "string"
               },
               "secrets": [ 
                  { 
                     "name": "string",
                     "valueFrom": "string"
                  }
               ]
            },
            "scalingTarget": { 
               "autoScalingMetric": "string",
               "autoScalingTargetValue": number,
               "maxTaskCount": number,
               "minTaskCount": number
            },
            "serviceRevisionArn": "string",
            "taskRoleArn": "string"
         }
      ],
      "cluster": "string",
      "createdAt": number,
      "currentDeployment": "string",
      "infrastructureRoleArn": "string",
      "serviceArn": "string",
      "serviceName": "string",
      "status": { 
         "statusCode": "string",
         "statusReason": "string"
      },
      "tags": [ 
         { 
            "key": "string",
            "value": "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.

 ** [service](#API_DeleteExpressGatewayService_ResponseSyntax) **   <a name="ECS-DeleteExpressGatewayService-response-service"></a>
The full description of the deleted express service.  
Type: [ECSExpressGatewayService](API_ECSExpressGatewayService.md) object

## Errors


For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** AccessDeniedException **   
You don't have authorization to perform the requested action.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ClientException **   
These errors are usually caused by a client action. This client action might be using an action or resource on behalf of a user that doesn't have permissions to use the action or resource. Or, it might be specifying an identifier that isn't valid.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ClusterNotFoundException **   
The specified cluster wasn't found. You can view your available clusters with [ListClusters](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_ListClusters.html). Amazon ECS clusters are Region specific.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** InvalidParameterException **   
The specified parameter isn't valid. Review the available parameters for the API request.  
For more information about service event errors, see [Amazon ECS service event messages](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/service-event-messages-list.html).     
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ServerException **   
These errors are usually caused by a server issue.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 500

 ** ServiceNotActiveException **   
The specified service isn't active. You can't update a service that's inactive. If you have previously deleted a service, you can re-create it with [CreateService](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_CreateService.html).    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ServiceNotFoundException **   
The specified service wasn't found. You can view your available services with [ListServices](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_ListServices.html). Amazon ECS services are cluster specific and Region specific.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** UnsupportedFeatureException **   
The specified task isn't supported in this Region.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

## See Also


For more information about using this API in one of the language-specific Amazon SDKs, see the following:
+  [Amazon Command Line Interface V2](https://docs.amazonaws.cn/goto/cli2/ecs-2014-11-13/DeleteExpressGatewayService) 
+  [Amazon SDK for .NET V4](https://docs.amazonaws.cn/goto/DotNetSDKV4/ecs-2014-11-13/DeleteExpressGatewayService) 
+  [Amazon SDK for C\$1\$1](https://docs.amazonaws.cn/goto/SdkForCpp/ecs-2014-11-13/DeleteExpressGatewayService) 
+  [Amazon SDK for Go v2](https://docs.amazonaws.cn/goto/SdkForGoV2/ecs-2014-11-13/DeleteExpressGatewayService) 
+  [Amazon SDK for Java V2](https://docs.amazonaws.cn/goto/SdkForJavaV2/ecs-2014-11-13/DeleteExpressGatewayService) 
+  [Amazon SDK for JavaScript V3](https://docs.amazonaws.cn/goto/SdkForJavaScriptV3/ecs-2014-11-13/DeleteExpressGatewayService) 
+  [Amazon SDK for Kotlin](https://docs.amazonaws.cn/goto/SdkForKotlin/ecs-2014-11-13/DeleteExpressGatewayService) 
+  [Amazon SDK for PHP V3](https://docs.amazonaws.cn/goto/SdkForPHPV3/ecs-2014-11-13/DeleteExpressGatewayService) 
+  [Amazon SDK for Python](https://docs.amazonaws.cn/goto/boto3/ecs-2014-11-13/DeleteExpressGatewayService) 
+  [Amazon SDK for Ruby V3](https://docs.amazonaws.cn/goto/SdkForRubyV3/ecs-2014-11-13/DeleteExpressGatewayService) 

# DeleteService


Deletes a specified service within a cluster. You can delete a service if you have no running tasks in it and the desired task count is zero. If the service is actively maintaining tasks, you can't delete it, and you must update the service to a desired task count of zero. For more information, see [UpdateService](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_UpdateService.html).

**Note**  
When you delete a service, if there are still running tasks that require cleanup, the service status moves from `ACTIVE` to `DRAINING`, and the service is no longer visible in the console or in the [ListServices](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_ListServices.html) API operation. After all tasks have transitioned to either `STOPPING` or `STOPPED` status, the service status moves from `DRAINING` to `INACTIVE`. Services in the `DRAINING` or `INACTIVE` status can still be viewed with the [DescribeServices](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_DescribeServices.html) API operation. However, in the future, `INACTIVE` services may be cleaned up and purged from Amazon ECS record keeping, and [DescribeServices](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_DescribeServices.html) calls on those services return a `ServiceNotFoundException` error.

**Important**  
If you attempt to create a new service with the same name as an existing service in either `ACTIVE` or `DRAINING` status, you receive an error.

## Request Syntax


```
{
   "cluster": "string",
   "force": boolean,
   "service": "string"
}
```

## Request Parameters


For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [cluster](#API_DeleteService_RequestSyntax) **   <a name="ECS-DeleteService-request-cluster"></a>
The short name or full Amazon Resource Name (ARN) of the cluster that hosts the service to delete. If you do not specify a cluster, the default cluster is assumed.  
Type: String  
Required: No

 ** [force](#API_DeleteService_RequestSyntax) **   <a name="ECS-DeleteService-request-force"></a>
If `true`, allows you to delete a service even if it wasn't scaled down to zero tasks. It's only necessary to use this if the service uses the `REPLICA` scheduling strategy.  
Type: Boolean  
Required: No

 ** [service](#API_DeleteService_RequestSyntax) **   <a name="ECS-DeleteService-request-service"></a>
The name of the service to delete.  
Type: String  
Required: Yes

## Response Syntax


```
{
   "service": { 
      "availabilityZoneRebalancing": "string",
      "capacityProviderStrategy": [ 
         { 
            "base": number,
            "capacityProvider": "string",
            "weight": number
         }
      ],
      "clusterArn": "string",
      "createdAt": number,
      "createdBy": "string",
      "currentServiceDeployment": "string",
      "currentServiceRevisions": [ 
         { 
            "arn": "string",
            "pendingTaskCount": number,
            "requestedTaskCount": number,
            "runningTaskCount": number
         }
      ],
      "deploymentConfiguration": { 
         "alarms": { 
            "alarmNames": [ "string" ],
            "enable": boolean,
            "rollback": boolean
         },
         "bakeTimeInMinutes": number,
         "canaryConfiguration": { 
            "canaryBakeTimeInMinutes": number,
            "canaryPercent": number
         },
         "deploymentCircuitBreaker": { 
            "enable": boolean,
            "rollback": boolean
         },
         "lifecycleHooks": [ 
            { 
               "hookDetails": JSON value,
               "hookTargetArn": "string",
               "lifecycleStages": [ "string" ],
               "roleArn": "string"
            }
         ],
         "linearConfiguration": { 
            "stepBakeTimeInMinutes": number,
            "stepPercent": number
         },
         "maximumPercent": number,
         "minimumHealthyPercent": number,
         "strategy": "string"
      },
      "deploymentController": { 
         "type": "string"
      },
      "deployments": [ 
         { 
            "capacityProviderStrategy": [ 
               { 
                  "base": number,
                  "capacityProvider": "string",
                  "weight": number
               }
            ],
            "createdAt": number,
            "desiredCount": number,
            "failedTasks": number,
            "fargateEphemeralStorage": { 
               "kmsKeyId": "string"
            },
            "id": "string",
            "launchType": "string",
            "networkConfiguration": { 
               "awsvpcConfiguration": { 
                  "assignPublicIp": "string",
                  "securityGroups": [ "string" ],
                  "subnets": [ "string" ]
               }
            },
            "pendingCount": number,
            "platformFamily": "string",
            "platformVersion": "string",
            "rolloutState": "string",
            "rolloutStateReason": "string",
            "runningCount": number,
            "serviceConnectConfiguration": { 
               "accessLogConfiguration": { 
                  "format": "string",
                  "includeQueryParameters": "string"
               },
               "enabled": boolean,
               "logConfiguration": { 
                  "logDriver": "string",
                  "options": { 
                     "string" : "string" 
                  },
                  "secretOptions": [ 
                     { 
                        "name": "string",
                        "valueFrom": "string"
                     }
                  ]
               },
               "namespace": "string",
               "services": [ 
                  { 
                     "clientAliases": [ 
                        { 
                           "dnsName": "string",
                           "port": number,
                           "testTrafficRules": { 
                              "header": { 
                                 "name": "string",
                                 "value": { 
                                    "exact": "string"
                                 }
                              }
                           }
                        }
                     ],
                     "discoveryName": "string",
                     "ingressPortOverride": number,
                     "portName": "string",
                     "timeout": { 
                        "idleTimeoutSeconds": number,
                        "perRequestTimeoutSeconds": number
                     },
                     "tls": { 
                        "issuerCertificateAuthority": { 
                           "awsPcaAuthorityArn": "string"
                        },
                        "kmsKey": "string",
                        "roleArn": "string"
                     }
                  }
               ]
            },
            "serviceConnectResources": [ 
               { 
                  "discoveryArn": "string",
                  "discoveryName": "string"
               }
            ],
            "status": "string",
            "taskDefinition": "string",
            "updatedAt": number,
            "volumeConfigurations": [ 
               { 
                  "managedEBSVolume": { 
                     "encrypted": boolean,
                     "filesystemType": "string",
                     "iops": number,
                     "kmsKeyId": "string",
                     "roleArn": "string",
                     "sizeInGiB": number,
                     "snapshotId": "string",
                     "tagSpecifications": [ 
                        { 
                           "propagateTags": "string",
                           "resourceType": "string",
                           "tags": [ 
                              { 
                                 "key": "string",
                                 "value": "string"
                              }
                           ]
                        }
                     ],
                     "throughput": number,
                     "volumeInitializationRate": number,
                     "volumeType": "string"
                  },
                  "name": "string"
               }
            ],
            "vpcLatticeConfigurations": [ 
               { 
                  "portName": "string",
                  "roleArn": "string",
                  "targetGroupArn": "string"
               }
            ]
         }
      ],
      "desiredCount": number,
      "enableECSManagedTags": boolean,
      "enableExecuteCommand": boolean,
      "events": [ 
         { 
            "createdAt": number,
            "id": "string",
            "message": "string"
         }
      ],
      "healthCheckGracePeriodSeconds": number,
      "launchType": "string",
      "loadBalancers": [ 
         { 
            "advancedConfiguration": { 
               "alternateTargetGroupArn": "string",
               "productionListenerRule": "string",
               "roleArn": "string",
               "testListenerRule": "string"
            },
            "containerName": "string",
            "containerPort": number,
            "loadBalancerName": "string",
            "targetGroupArn": "string"
         }
      ],
      "networkConfiguration": { 
         "awsvpcConfiguration": { 
            "assignPublicIp": "string",
            "securityGroups": [ "string" ],
            "subnets": [ "string" ]
         }
      },
      "pendingCount": number,
      "placementConstraints": [ 
         { 
            "expression": "string",
            "type": "string"
         }
      ],
      "placementStrategy": [ 
         { 
            "field": "string",
            "type": "string"
         }
      ],
      "platformFamily": "string",
      "platformVersion": "string",
      "propagateTags": "string",
      "resourceManagementType": "string",
      "roleArn": "string",
      "runningCount": number,
      "schedulingStrategy": "string",
      "serviceArn": "string",
      "serviceName": "string",
      "serviceRegistries": [ 
         { 
            "containerName": "string",
            "containerPort": number,
            "port": number,
            "registryArn": "string"
         }
      ],
      "status": "string",
      "tags": [ 
         { 
            "key": "string",
            "value": "string"
         }
      ],
      "taskDefinition": "string",
      "taskSets": [ 
         { 
            "capacityProviderStrategy": [ 
               { 
                  "base": number,
                  "capacityProvider": "string",
                  "weight": number
               }
            ],
            "clusterArn": "string",
            "computedDesiredCount": number,
            "createdAt": number,
            "externalId": "string",
            "fargateEphemeralStorage": { 
               "kmsKeyId": "string"
            },
            "id": "string",
            "launchType": "string",
            "loadBalancers": [ 
               { 
                  "advancedConfiguration": { 
                     "alternateTargetGroupArn": "string",
                     "productionListenerRule": "string",
                     "roleArn": "string",
                     "testListenerRule": "string"
                  },
                  "containerName": "string",
                  "containerPort": number,
                  "loadBalancerName": "string",
                  "targetGroupArn": "string"
               }
            ],
            "networkConfiguration": { 
               "awsvpcConfiguration": { 
                  "assignPublicIp": "string",
                  "securityGroups": [ "string" ],
                  "subnets": [ "string" ]
               }
            },
            "pendingCount": number,
            "platformFamily": "string",
            "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",
            "tags": [ 
               { 
                  "key": "string",
                  "value": "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.

 ** [service](#API_DeleteService_ResponseSyntax) **   <a name="ECS-DeleteService-response-service"></a>
The full description of the deleted service.  
Type: [Service](API_Service.md) object

## Errors


For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** ClientException **   
These errors are usually caused by a client action. This client action might be using an action or resource on behalf of a user that doesn't have permissions to use the action or resource. Or, it might be specifying an identifier that isn't valid.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ClusterNotFoundException **   
The specified cluster wasn't found. You can view your available clusters with [ListClusters](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_ListClusters.html). Amazon ECS clusters are Region specific.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** InvalidParameterException **   
The specified parameter isn't valid. Review the available parameters for the API request.  
For more information about service event errors, see [Amazon ECS service event messages](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/service-event-messages-list.html).     
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ServerException **   
These errors are usually caused by a server issue.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 500

 ** ServiceNotFoundException **   
The specified service wasn't found. You can view your available services with [ListServices](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_ListServices.html). Amazon ECS services are cluster specific and Region specific.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

## Examples


In the following example or examples, the Authorization header contents (`AUTHPARAMS`) must be replaced with an Amazon Signature Version 4 signature. For more information, see [Signature Version 4 Signing Process](https://docs.amazonaws.cn/general/latest/gr/signature-version-4.html) in the * Amazon General Reference*.

You only need to learn how to sign HTTP requests if you intend to create them manually. When you use the [Amazon Command Line Interface](http://www.amazonaws.cn/cli/) or one of the [Amazon SDKs](http://www.amazonaws.cn/tools/) to make requests to Amazon, these tools automatically sign the requests for you, with the access key that you specify when you configure the tools. When you use these tools, you don't have to sign requests yourself.

### Example


This example API request deletes the `test` service from the `default` cluster.

#### Sample Request


```
POST / HTTP/1.1
Host: ecs.us-east-1.amazonaws.com
Accept-Encoding: identity
Content-Length: 19
X-Amz-Target: AmazonEC2ContainerServiceV20141113.DeleteService
X-Amz-Date: 20150429T172539Z
Content-Type: application/x-amz-json-1.1
Authorization: AUTHPARAMS

{
  "service": "test"
}
```

#### Sample Response


```
HTTP/1.1 200 OK
Server: Server
Date: Wed, 29 Apr 2015 17:25:40 GMT
Content-Type: application/x-amz-json-1.1
Content-Length: 13590
Connection: keep-alive
x-amzn-RequestId: 123a4b56-7c89-01d2-3ef4-example5678f

{
  "service": {
    "clusterArn": "arn:aws:ecs:us-east-1:012345678910:cluster/default",
    "deploymentConfiguration": {
        "maximumPercent": 200,
        "minimumHealthyPercent": 100
    },
    "deployments": [
      {
        "createdAt": 1430320735.285,
        "desiredCount": 0,
        "id": "ecs-svc/9223370606534040511",
        "pendingCount": 0,
        "runningCount": 0,
        "status": "PRIMARY",
        "taskDefinition": "arn:aws:ecs:us-east-1:012345678910:task-definition/sleep360:27",
        "updatedAt": 1430320735.285
      }
    ],
    "desiredCount": 0,
    "events": [],
    "loadBalancers": [],
    "pendingCount": 0,
    "runningCount": 0,
    "serviceArn": "arn:aws:ecs:us-east-1:012345678910:service/default/test",
    "serviceName": "test",
    "status": "DRAINING",
    "taskDefinition": "arn:aws:ecs:us-east-1:012345678910:task-definition/sleep360:27"
  }
}
```

## See Also


For more information about using this API in one of the language-specific Amazon SDKs, see the following:
+  [Amazon Command Line Interface V2](https://docs.amazonaws.cn/goto/cli2/ecs-2014-11-13/DeleteService) 
+  [Amazon SDK for .NET V4](https://docs.amazonaws.cn/goto/DotNetSDKV4/ecs-2014-11-13/DeleteService) 
+  [Amazon SDK for C\$1\$1](https://docs.amazonaws.cn/goto/SdkForCpp/ecs-2014-11-13/DeleteService) 
+  [Amazon SDK for Go v2](https://docs.amazonaws.cn/goto/SdkForGoV2/ecs-2014-11-13/DeleteService) 
+  [Amazon SDK for Java V2](https://docs.amazonaws.cn/goto/SdkForJavaV2/ecs-2014-11-13/DeleteService) 
+  [Amazon SDK for JavaScript V3](https://docs.amazonaws.cn/goto/SdkForJavaScriptV3/ecs-2014-11-13/DeleteService) 
+  [Amazon SDK for Kotlin](https://docs.amazonaws.cn/goto/SdkForKotlin/ecs-2014-11-13/DeleteService) 
+  [Amazon SDK for PHP V3](https://docs.amazonaws.cn/goto/SdkForPHPV3/ecs-2014-11-13/DeleteService) 
+  [Amazon SDK for Python](https://docs.amazonaws.cn/goto/boto3/ecs-2014-11-13/DeleteService) 
+  [Amazon SDK for Ruby V3](https://docs.amazonaws.cn/goto/SdkForRubyV3/ecs-2014-11-13/DeleteService) 

# DeleteTaskDefinitions


Deletes one or more task definitions.

You must deregister a task definition revision before you delete it. For more information, see [DeregisterTaskDefinition](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_DeregisterTaskDefinition.html).

When you delete a task definition revision, it is immediately transitions from the `INACTIVE` to `DELETE_IN_PROGRESS`. Existing tasks and services that reference a `DELETE_IN_PROGRESS` task definition revision continue to run without disruption. Existing services that reference a `DELETE_IN_PROGRESS` task definition revision can still scale up or down by modifying the service's desired count.

You can't use a `DELETE_IN_PROGRESS` task definition revision to run new tasks or create new services. You also can't update an existing service to reference a `DELETE_IN_PROGRESS` task definition revision.

 A task definition revision will stay in `DELETE_IN_PROGRESS` status until all the associated tasks and services have been terminated.

When you delete all `INACTIVE` task definition revisions, the task definition name is not displayed in the console and not returned in the API. If a task definition revisions are in the `DELETE_IN_PROGRESS` state, the task definition name is displayed in the console and returned in the API. The task definition name is retained by Amazon ECS and the revision is incremented the next time you create a task definition with that name.

## Request Syntax


```
{
   "taskDefinitions": [ "string" ]
}
```

## Request Parameters


For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [taskDefinitions](#API_DeleteTaskDefinitions_RequestSyntax) **   <a name="ECS-DeleteTaskDefinitions-request-taskDefinitions"></a>
The `family` and `revision` (`family:revision`) or full Amazon Resource Name (ARN) of the task definition to delete. You must specify a `revision`.  
You can specify up to 10 task definitions as a comma separated list.  
Type: Array of strings  
Required: Yes

## Response Syntax


```
{
   "failures": [ 
      { 
         "arn": "string",
         "detail": "string",
         "reason": "string"
      }
   ],
   "taskDefinitions": [ 
      { 
         "compatibilities": [ "string" ],
         "containerDefinitions": [ 
            { 
               "command": [ "string" ],
               "cpu": number,
               "credentialSpecs": [ "string" ],
               "dependsOn": [ 
                  { 
                     "condition": "string",
                     "containerName": "string"
                  }
               ],
               "disableNetworking": boolean,
               "dnsSearchDomains": [ "string" ],
               "dnsServers": [ "string" ],
               "dockerLabels": { 
                  "string" : "string" 
               },
               "dockerSecurityOptions": [ "string" ],
               "entryPoint": [ "string" ],
               "environment": [ 
                  { 
                     "name": "string",
                     "value": "string"
                  }
               ],
               "environmentFiles": [ 
                  { 
                     "type": "string",
                     "value": "string"
                  }
               ],
               "essential": boolean,
               "extraHosts": [ 
                  { 
                     "hostname": "string",
                     "ipAddress": "string"
                  }
               ],
               "firelensConfiguration": { 
                  "options": { 
                     "string" : "string" 
                  },
                  "type": "string"
               },
               "healthCheck": { 
                  "command": [ "string" ],
                  "interval": number,
                  "retries": number,
                  "startPeriod": number,
                  "timeout": number
               },
               "hostname": "string",
               "image": "string",
               "interactive": boolean,
               "links": [ "string" ],
               "linuxParameters": { 
                  "capabilities": { 
                     "add": [ "string" ],
                     "drop": [ "string" ]
                  },
                  "devices": [ 
                     { 
                        "containerPath": "string",
                        "hostPath": "string",
                        "permissions": [ "string" ]
                     }
                  ],
                  "initProcessEnabled": boolean,
                  "maxSwap": number,
                  "sharedMemorySize": number,
                  "swappiness": number,
                  "tmpfs": [ 
                     { 
                        "containerPath": "string",
                        "mountOptions": [ "string" ],
                        "size": number
                     }
                  ]
               },
               "logConfiguration": { 
                  "logDriver": "string",
                  "options": { 
                     "string" : "string" 
                  },
                  "secretOptions": [ 
                     { 
                        "name": "string",
                        "valueFrom": "string"
                     }
                  ]
               },
               "memory": number,
               "memoryReservation": number,
               "mountPoints": [ 
                  { 
                     "containerPath": "string",
                     "readOnly": boolean,
                     "sourceVolume": "string"
                  }
               ],
               "name": "string",
               "portMappings": [ 
                  { 
                     "appProtocol": "string",
                     "containerPort": number,
                     "containerPortRange": "string",
                     "hostPort": number,
                     "name": "string",
                     "protocol": "string"
                  }
               ],
               "privileged": boolean,
               "pseudoTerminal": boolean,
               "readonlyRootFilesystem": boolean,
               "repositoryCredentials": { 
                  "credentialsParameter": "string"
               },
               "resourceRequirements": [ 
                  { 
                     "type": "string",
                     "value": "string"
                  }
               ],
               "restartPolicy": { 
                  "enabled": boolean,
                  "ignoredExitCodes": [ number ],
                  "restartAttemptPeriod": number
               },
               "secrets": [ 
                  { 
                     "name": "string",
                     "valueFrom": "string"
                  }
               ],
               "startTimeout": number,
               "stopTimeout": number,
               "systemControls": [ 
                  { 
                     "namespace": "string",
                     "value": "string"
                  }
               ],
               "ulimits": [ 
                  { 
                     "hardLimit": number,
                     "name": "string",
                     "softLimit": number
                  }
               ],
               "user": "string",
               "versionConsistency": "string",
               "volumesFrom": [ 
                  { 
                     "readOnly": boolean,
                     "sourceContainer": "string"
                  }
               ],
               "workingDirectory": "string"
            }
         ],
         "cpu": "string",
         "deleteRequestedAt": number,
         "deregisteredAt": number,
         "enableFaultInjection": boolean,
         "ephemeralStorage": { 
            "sizeInGiB": number
         },
         "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"
         },
         "registeredAt": number,
         "registeredBy": "string",
         "requiresAttributes": [ 
            { 
               "name": "string",
               "targetId": "string",
               "targetType": "string",
               "value": "string"
            }
         ],
         "requiresCompatibilities": [ "string" ],
         "revision": number,
         "runtimePlatform": { 
            "cpuArchitecture": "string",
            "operatingSystemFamily": "string"
         },
         "status": "string",
         "taskDefinitionArn": "string",
         "taskRoleArn": "string",
         "volumes": [ 
            { 
               "configuredAtLaunch": boolean,
               "dockerVolumeConfiguration": { 
                  "autoprovision": boolean,
                  "driver": "string",
                  "driverOpts": { 
                     "string" : "string" 
                  },
                  "labels": { 
                     "string" : "string" 
                  },
                  "scope": "string"
               },
               "efsVolumeConfiguration": { 
                  "authorizationConfig": { 
                     "accessPointId": "string",
                     "iam": "string"
                  },
                  "fileSystemId": "string",
                  "rootDirectory": "string",
                  "transitEncryption": "string",
                  "transitEncryptionPort": number
               },
               "fsxWindowsFileServerVolumeConfiguration": { 
                  "authorizationConfig": { 
                     "credentialsParameter": "string",
                     "domain": "string"
                  },
                  "fileSystemId": "string",
                  "rootDirectory": "string"
               },
               "host": { 
                  "sourcePath": "string"
               },
               "name": "string"
            }
         ]
      }
   ]
}
```

## 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.

 ** [failures](#API_DeleteTaskDefinitions_ResponseSyntax) **   <a name="ECS-DeleteTaskDefinitions-response-failures"></a>
Any failures associated with the call.  
Type: Array of [Failure](API_Failure.md) objects

 ** [taskDefinitions](#API_DeleteTaskDefinitions_ResponseSyntax) **   <a name="ECS-DeleteTaskDefinitions-response-taskDefinitions"></a>
The list of deleted task definitions.  
Type: Array of [TaskDefinition](API_TaskDefinition.md) objects

## Errors


For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** AccessDeniedException **   
You don't have authorization to perform the requested action.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ClientException **   
These errors are usually caused by a client action. This client action might be using an action or resource on behalf of a user that doesn't have permissions to use the action or resource. Or, it might be specifying an identifier that isn't valid.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** InvalidParameterException **   
The specified parameter isn't valid. Review the available parameters for the API request.  
For more information about service event errors, see [Amazon ECS service event messages](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/service-event-messages-list.html).     
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ServerException **   
These errors are usually caused by a server issue.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 500

## Examples


In the following example or examples, the Authorization header contents (`AUTHPARAMS`) must be replaced with an Amazon Signature Version 4 signature. For more information, see [Signature Version 4 Signing Process](https://docs.amazonaws.cn/general/latest/gr/signature-version-4.html) in the * Amazon General Reference*.

You only need to learn how to sign HTTP requests if you intend to create them manually. When you use the [Amazon Command Line Interface](http://www.amazonaws.cn/cli/) or one of the [Amazon SDKs](http://www.amazonaws.cn/tools/) to make requests to Amazon, these tools automatically sign the requests for you, with the access key that you specify when you configure the tools. When you use these tools, you don't have to sign requests yourself.

### Example


This example request deletes the task definition named `Example-task-definition:1`.

#### Sample Request


```
POST / HTTP/1.1
Host: ecs.us-east-1.amazonaws.com
Accept-Encoding: identity
Content-Length: 25
X-Amz-Target: AmazonEC2ContainerServiceV20141113.DeleteTaskDefinitions
X-Amz-Date: 20150429T170952Z
Content-Type: application/x-amz-json-1.1
Authorization: AUTHPARAMS

{
  "taskDefinitions": [
    "Example-task-definition:1"
  ]
}
```

#### Sample Response


```
HTTP/1.1 200 OK
Server: Server
Date: Wed, 7 Dec 2022 17:09:54 GMT
Content-Type: application/x-amz-json-1.1
Content-Length: 211
Connection: keep-alive
x-amzn-RequestId: 123a4b56-7c89-01d2-3ef4-example5678f

{
  "failures": [],
  "taskDefinitions": [
    {
      "containerDefinitions": [
        {
          "command": [
            "apt-get update; apt-get install stress; while true; do stress --cpu $(( RANDOM % 4 )) -t $(( RANDOM % 10 )); done"
          ],
          "cpu": 50,
          "entryPoint": [
            "bash",
            "-c"
          ],
          "environment": [],
          "essential": true,
          "image": "public.ecr.aws/docker/library/ubuntu:latest",
          "memory": 100,
          "mountPoints": [],
          "name": "wave",
          "portMappings": [],
          "volumesFrom": []
        }
      ],
      "family": "cpu-wave",
      "revision": 1,
      "status": "DELETE_IN_PROGRESS",
      "taskDefinitionArn": "arn:aws:ecs:us-east-1:012345678910:task-definition/Example-task-definition:1",
      "volumes": []
    }
  ]
}
```

## See Also


For more information about using this API in one of the language-specific Amazon SDKs, see the following:
+  [Amazon Command Line Interface V2](https://docs.amazonaws.cn/goto/cli2/ecs-2014-11-13/DeleteTaskDefinitions) 
+  [Amazon SDK for .NET V4](https://docs.amazonaws.cn/goto/DotNetSDKV4/ecs-2014-11-13/DeleteTaskDefinitions) 
+  [Amazon SDK for C\$1\$1](https://docs.amazonaws.cn/goto/SdkForCpp/ecs-2014-11-13/DeleteTaskDefinitions) 
+  [Amazon SDK for Go v2](https://docs.amazonaws.cn/goto/SdkForGoV2/ecs-2014-11-13/DeleteTaskDefinitions) 
+  [Amazon SDK for Java V2](https://docs.amazonaws.cn/goto/SdkForJavaV2/ecs-2014-11-13/DeleteTaskDefinitions) 
+  [Amazon SDK for JavaScript V3](https://docs.amazonaws.cn/goto/SdkForJavaScriptV3/ecs-2014-11-13/DeleteTaskDefinitions) 
+  [Amazon SDK for Kotlin](https://docs.amazonaws.cn/goto/SdkForKotlin/ecs-2014-11-13/DeleteTaskDefinitions) 
+  [Amazon SDK for PHP V3](https://docs.amazonaws.cn/goto/SdkForPHPV3/ecs-2014-11-13/DeleteTaskDefinitions) 
+  [Amazon SDK for Python](https://docs.amazonaws.cn/goto/boto3/ecs-2014-11-13/DeleteTaskDefinitions) 
+  [Amazon SDK for Ruby V3](https://docs.amazonaws.cn/goto/SdkForRubyV3/ecs-2014-11-13/DeleteTaskDefinitions) 

# DeleteTaskSet


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

## Request Syntax


```
{
   "cluster": "string",
   "force": boolean,
   "service": "string",
   "taskSet": "string"
}
```

## Request Parameters


For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [cluster](#API_DeleteTaskSet_RequestSyntax) **   <a name="ECS-DeleteTaskSet-request-cluster"></a>
The short name or full Amazon Resource Name (ARN) of the cluster that hosts the service that the task set found in to delete.  
Type: String  
Required: Yes

 ** [force](#API_DeleteTaskSet_RequestSyntax) **   <a name="ECS-DeleteTaskSet-request-force"></a>
If `true`, you can delete a task set even if it hasn't been scaled down to zero.  
Type: Boolean  
Required: No

 ** [service](#API_DeleteTaskSet_RequestSyntax) **   <a name="ECS-DeleteTaskSet-request-service"></a>
The short name or full Amazon Resource Name (ARN) of the service that hosts the task set to delete.  
Type: String  
Required: Yes

 ** [taskSet](#API_DeleteTaskSet_RequestSyntax) **   <a name="ECS-DeleteTaskSet-request-taskSet"></a>
The task set ID or full Amazon Resource Name (ARN) of the task set to delete.  
Type: String  
Required: Yes

## Response Syntax


```
{
   "taskSet": { 
      "capacityProviderStrategy": [ 
         { 
            "base": number,
            "capacityProvider": "string",
            "weight": number
         }
      ],
      "clusterArn": "string",
      "computedDesiredCount": number,
      "createdAt": number,
      "externalId": "string",
      "fargateEphemeralStorage": { 
         "kmsKeyId": "string"
      },
      "id": "string",
      "launchType": "string",
      "loadBalancers": [ 
         { 
            "advancedConfiguration": { 
               "alternateTargetGroupArn": "string",
               "productionListenerRule": "string",
               "roleArn": "string",
               "testListenerRule": "string"
            },
            "containerName": "string",
            "containerPort": number,
            "loadBalancerName": "string",
            "targetGroupArn": "string"
         }
      ],
      "networkConfiguration": { 
         "awsvpcConfiguration": { 
            "assignPublicIp": "string",
            "securityGroups": [ "string" ],
            "subnets": [ "string" ]
         }
      },
      "pendingCount": number,
      "platformFamily": "string",
      "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",
      "tags": [ 
         { 
            "key": "string",
            "value": "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](#API_DeleteTaskSet_ResponseSyntax) **   <a name="ECS-DeleteTaskSet-response-taskSet"></a>
Details about the task set.  
Type: [TaskSet](API_TaskSet.md) object

## Errors


For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** AccessDeniedException **   
You don't have authorization to perform the requested action.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ClientException **   
These errors are usually caused by a client action. This client action might be using an action or resource on behalf of a user that doesn't have permissions to use the action or resource. Or, it might be specifying an identifier that isn't valid.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ClusterNotFoundException **   
The specified cluster wasn't found. You can view your available clusters with [ListClusters](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_ListClusters.html). Amazon ECS clusters are Region specific.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** InvalidParameterException **   
The specified parameter isn't valid. Review the available parameters for the API request.  
For more information about service event errors, see [Amazon ECS service event messages](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/service-event-messages-list.html).     
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ServerException **   
These errors are usually caused by a server issue.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 500

 ** ServiceNotActiveException **   
The specified service isn't active. You can't update a service that's inactive. If you have previously deleted a service, you can re-create it with [CreateService](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_CreateService.html).    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ServiceNotFoundException **   
The specified service wasn't found. You can view your available services with [ListServices](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_ListServices.html). Amazon ECS services are cluster specific and Region specific.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** TaskSetNotFoundException **   
The specified task set wasn't found. You can view your available task sets with [DescribeTaskSets](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_DescribeTaskSets.html). Task sets are specific to each cluster, service and Region.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** UnsupportedFeatureException **   
The specified task isn't supported in this Region.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

## See Also


For more information about using this API in one of the language-specific Amazon SDKs, see the following:
+  [Amazon Command Line Interface V2](https://docs.amazonaws.cn/goto/cli2/ecs-2014-11-13/DeleteTaskSet) 
+  [Amazon SDK for .NET V4](https://docs.amazonaws.cn/goto/DotNetSDKV4/ecs-2014-11-13/DeleteTaskSet) 
+  [Amazon SDK for C\$1\$1](https://docs.amazonaws.cn/goto/SdkForCpp/ecs-2014-11-13/DeleteTaskSet) 
+  [Amazon SDK for Go v2](https://docs.amazonaws.cn/goto/SdkForGoV2/ecs-2014-11-13/DeleteTaskSet) 
+  [Amazon SDK for Java V2](https://docs.amazonaws.cn/goto/SdkForJavaV2/ecs-2014-11-13/DeleteTaskSet) 
+  [Amazon SDK for JavaScript V3](https://docs.amazonaws.cn/goto/SdkForJavaScriptV3/ecs-2014-11-13/DeleteTaskSet) 
+  [Amazon SDK for Kotlin](https://docs.amazonaws.cn/goto/SdkForKotlin/ecs-2014-11-13/DeleteTaskSet) 
+  [Amazon SDK for PHP V3](https://docs.amazonaws.cn/goto/SdkForPHPV3/ecs-2014-11-13/DeleteTaskSet) 
+  [Amazon SDK for Python](https://docs.amazonaws.cn/goto/boto3/ecs-2014-11-13/DeleteTaskSet) 
+  [Amazon SDK for Ruby V3](https://docs.amazonaws.cn/goto/SdkForRubyV3/ecs-2014-11-13/DeleteTaskSet) 

# DeregisterContainerInstance


Deregisters an Amazon ECS container instance from the specified cluster. This instance is no longer available to run tasks.

If you intend to use the container instance for some other purpose after deregistration, we recommend that you stop all of the tasks running on the container instance before deregistration. That prevents any orphaned tasks from consuming resources.

Deregistering a container instance removes the instance from a cluster, but it doesn't terminate the EC2 instance. If you are finished using the instance, be sure to terminate it in the Amazon EC2 console to stop billing.

**Note**  
If you terminate a running container instance, Amazon ECS automatically deregisters the instance from your cluster (stopped container instances or instances with disconnected agents aren't automatically deregistered when terminated).

## Request Syntax


```
{
   "cluster": "string",
   "containerInstance": "string",
   "force": boolean
}
```

## Request Parameters


For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [cluster](#API_DeregisterContainerInstance_RequestSyntax) **   <a name="ECS-DeregisterContainerInstance-request-cluster"></a>
The short name or full Amazon Resource Name (ARN) of the cluster that hosts the container instance to deregister. If you do not specify a cluster, the default cluster is assumed.  
Type: String  
Required: No

 ** [containerInstance](#API_DeregisterContainerInstance_RequestSyntax) **   <a name="ECS-DeregisterContainerInstance-request-containerInstance"></a>
The container instance ID or full ARN of the container instance to deregister. For more information about the ARN format, see [Amazon Resource Name (ARN)](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/ecs-account-settings.html#ecs-resource-ids) in the *Amazon ECS Developer Guide*.  
Type: String  
Required: Yes

 ** [force](#API_DeregisterContainerInstance_RequestSyntax) **   <a name="ECS-DeregisterContainerInstance-request-force"></a>
Forces the container instance to be deregistered. If you have tasks running on the container instance when you deregister it with the `force` option, these tasks remain running until you terminate the instance or the tasks stop through some other means, but they're orphaned (no longer monitored or accounted for by Amazon ECS). If an orphaned task on your container instance is part of an Amazon ECS service, then the service scheduler starts another copy of that task, on a different container instance if possible.   
Any containers in orphaned service tasks that are registered with a Classic Load Balancer or an Application Load Balancer target group are deregistered. They begin connection draining according to the settings on the load balancer or target group.  
Type: Boolean  
Required: No

## Response Syntax


```
{
   "containerInstance": { 
      "agentConnected": boolean,
      "agentUpdateStatus": "string",
      "attachments": [ 
         { 
            "details": [ 
               { 
                  "name": "string",
                  "value": "string"
               }
            ],
            "id": "string",
            "status": "string",
            "type": "string"
         }
      ],
      "attributes": [ 
         { 
            "name": "string",
            "targetId": "string",
            "targetType": "string",
            "value": "string"
         }
      ],
      "capacityProviderName": "string",
      "containerInstanceArn": "string",
      "ec2InstanceId": "string",
      "healthStatus": { 
         "details": [ 
            { 
               "lastStatusChange": number,
               "lastUpdated": number,
               "status": "string",
               "type": "string"
            }
         ],
         "overallStatus": "string"
      },
      "pendingTasksCount": number,
      "registeredAt": number,
      "registeredResources": [ 
         { 
            "doubleValue": number,
            "integerValue": number,
            "longValue": number,
            "name": "string",
            "stringSetValue": [ "string" ],
            "type": "string"
         }
      ],
      "remainingResources": [ 
         { 
            "doubleValue": number,
            "integerValue": number,
            "longValue": number,
            "name": "string",
            "stringSetValue": [ "string" ],
            "type": "string"
         }
      ],
      "runningTasksCount": number,
      "status": "string",
      "statusReason": "string",
      "tags": [ 
         { 
            "key": "string",
            "value": "string"
         }
      ],
      "version": number,
      "versionInfo": { 
         "agentHash": "string",
         "agentVersion": "string",
         "dockerVersion": "string"
      }
   }
}
```

## 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.

 ** [containerInstance](#API_DeregisterContainerInstance_ResponseSyntax) **   <a name="ECS-DeregisterContainerInstance-response-containerInstance"></a>
The container instance that was deregistered.  
Type: [ContainerInstance](API_ContainerInstance.md) object

## Errors


For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** ClientException **   
These errors are usually caused by a client action. This client action might be using an action or resource on behalf of a user that doesn't have permissions to use the action or resource. Or, it might be specifying an identifier that isn't valid.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ClusterNotFoundException **   
The specified cluster wasn't found. You can view your available clusters with [ListClusters](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_ListClusters.html). Amazon ECS clusters are Region specific.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** InvalidParameterException **   
The specified parameter isn't valid. Review the available parameters for the API request.  
For more information about service event errors, see [Amazon ECS service event messages](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/service-event-messages-list.html).     
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ServerException **   
These errors are usually caused by a server issue.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 500

## Examples


In the following example or examples, the Authorization header contents (`AUTHPARAMS`) must be replaced with an Amazon Signature Version 4 signature. For more information, see [Signature Version 4 Signing Process](https://docs.amazonaws.cn/general/latest/gr/signature-version-4.html) in the * Amazon General Reference*.

You only need to learn how to sign HTTP requests if you intend to create them manually. When you use the [Amazon Command Line Interface](http://www.amazonaws.cn/cli/) or one of the [Amazon SDKs](http://www.amazonaws.cn/tools/) to make requests to Amazon, these tools automatically sign the requests for you, with the access key that you specify when you configure the tools. When you use these tools, you don't have to sign requests yourself.

### Example


This example request deregisters a container instance with the ID `f4292606-fbed-4b53-833b-92cad7c687c2` in the `default` cluster.

#### Sample Request


```
POST / HTTP/1.1
Host: ecs.us-west-2.amazonaws.com
Accept-Encoding: identity
Content-Length: 61
X-Amz-Target: AmazonEC2ContainerServiceV20141113.DeregisterContainerInstance
X-Amz-Date: 20151001T191224Z
User-Agent: aws-cli/1.8.7 Python/2.7.9 Darwin/14.5.0
Content-Type: application/x-amz-json-1.1
Authorization: AUTHPARAMS

{
  "containerInstance": "c9c9a6f2-8766-464b-8805-9c57b9368fb0"
}
```

#### Sample Response


```
HTTP/1.1 200 OK
Server: Server
Date: Thu, 01 Oct 2015 19:12:25 GMT
Content-Type: application/x-amz-json-1.1
Content-Length: 1613
Connection: keep-alive
x-amzn-RequestId: 123a4b56-7c89-01d2-3ef4-example5678f

{
  "containerInstance": {
    "agentConnected": true,
    "attributes": [
      {
        "name": "com.amazonaws.ecs.capability.privileged-container"
      },
      {
        "name": "com.amazonaws.ecs.capability.docker-remote-api.1.17"
      },
      {
        "name": "com.amazonaws.ecs.capability.docker-remote-api.1.18"
      },
      {
        "name": "com.amazonaws.ecs.capability.docker-remote-api.1.19"
      },
      {
        "name": "com.amazonaws.ecs.capability.logging-driver.json-file"
      },
      {
        "name": "com.amazonaws.ecs.capability.logging-driver.syslog"
      }
    ],
    "containerInstanceArn": "arn:aws:ecs:us-west-2:012345678910:container-instance/default/c9c9a6f2-8766-464b-8805-9c57b9368fb0",
    "ec2InstanceId": "i-0c3826c9",
    "pendingTasksCount": 0,
    "registeredResources": [
      {
        "doubleValue": 0,
        "integerValue": 1024,
        "longValue": 0,
        "name": "CPU",
        "type": "INTEGER"
      },
      {
        "doubleValue": 0,
        "integerValue": 995,
        "longValue": 0,
        "name": "MEMORY",
        "type": "INTEGER"
      },
      {
        "doubleValue": 0,
        "integerValue": 0,
        "longValue": 0,
        "name": "PORTS",
        "stringSetValue": [
          "22",
          "2376",
          "2375",
          "51678"
        ],
        "type": "STRINGSET"
      },
      {
        "doubleValue": 0,
        "integerValue": 0,
        "longValue": 0,
        "name": "PORTS_UDP",
        "stringSetValue": [],
        "type": "STRINGSET"
      }
    ],
    "remainingResources": [
      {
        "doubleValue": 0,
        "integerValue": 1024,
        "longValue": 0,
        "name": "CPU",
        "type": "INTEGER"
      },
      {
        "doubleValue": 0,
        "integerValue": 995,
        "longValue": 0,
        "name": "MEMORY",
        "type": "INTEGER"
      },
      {
        "doubleValue": 0,
        "integerValue": 0,
        "longValue": 0,
        "name": "PORTS",
        "stringSetValue": [
          "22",
          "2376",
          "2375",
          "51678"
        ],
        "type": "STRINGSET"
      },
      {
        "doubleValue": 0,
        "integerValue": 0,
        "longValue": 0,
        "name": "PORTS_UDP",
        "stringSetValue": [],
        "type": "STRINGSET"
      }
    ],
    "runningTasksCount": 0,
    "status": "INACTIVE",
    "versionInfo": {
      "agentHash": "b197edd",
      "agentVersion": "1.5.0",
      "dockerVersion": "DockerVersion: 1.7.1"
    }
  }
}
```

## See Also


For more information about using this API in one of the language-specific Amazon SDKs, see the following:
+  [Amazon Command Line Interface V2](https://docs.amazonaws.cn/goto/cli2/ecs-2014-11-13/DeregisterContainerInstance) 
+  [Amazon SDK for .NET V4](https://docs.amazonaws.cn/goto/DotNetSDKV4/ecs-2014-11-13/DeregisterContainerInstance) 
+  [Amazon SDK for C\$1\$1](https://docs.amazonaws.cn/goto/SdkForCpp/ecs-2014-11-13/DeregisterContainerInstance) 
+  [Amazon SDK for Go v2](https://docs.amazonaws.cn/goto/SdkForGoV2/ecs-2014-11-13/DeregisterContainerInstance) 
+  [Amazon SDK for Java V2](https://docs.amazonaws.cn/goto/SdkForJavaV2/ecs-2014-11-13/DeregisterContainerInstance) 
+  [Amazon SDK for JavaScript V3](https://docs.amazonaws.cn/goto/SdkForJavaScriptV3/ecs-2014-11-13/DeregisterContainerInstance) 
+  [Amazon SDK for Kotlin](https://docs.amazonaws.cn/goto/SdkForKotlin/ecs-2014-11-13/DeregisterContainerInstance) 
+  [Amazon SDK for PHP V3](https://docs.amazonaws.cn/goto/SdkForPHPV3/ecs-2014-11-13/DeregisterContainerInstance) 
+  [Amazon SDK for Python](https://docs.amazonaws.cn/goto/boto3/ecs-2014-11-13/DeregisterContainerInstance) 
+  [Amazon SDK for Ruby V3](https://docs.amazonaws.cn/goto/SdkForRubyV3/ecs-2014-11-13/DeregisterContainerInstance) 

# DeregisterTaskDefinition


Deregisters the specified task definition by family and revision. Upon deregistration, the task definition is marked as `INACTIVE`. Existing tasks and services that reference an `INACTIVE` task definition continue to run without disruption. Existing services that reference an `INACTIVE` task definition can still scale up or down by modifying the service's desired count. If you want to delete a task definition revision, you must first deregister the task definition revision.

You can't use an `INACTIVE` task definition to run new tasks or create new services, and you can't update an existing service to reference an `INACTIVE` task definition. However, there may be up to a 10-minute window following deregistration where these restrictions have not yet taken effect.

**Note**  
At this time, `INACTIVE` task definitions remain discoverable in your account indefinitely. However, this behavior is subject to change in the future. We don't recommend that you rely on `INACTIVE` task definitions persisting beyond the lifecycle of any associated tasks and services.

You must deregister a task definition revision before you delete it. For more information, see [DeleteTaskDefinitions](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_DeleteTaskDefinitions.html).

## Request Syntax


```
{
   "taskDefinition": "string"
}
```

## Request Parameters


For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [taskDefinition](#API_DeregisterTaskDefinition_RequestSyntax) **   <a name="ECS-DeregisterTaskDefinition-request-taskDefinition"></a>
The `family` and `revision` (`family:revision`) or full Amazon Resource Name (ARN) of the task definition to deregister. You must specify a `revision`.  
Type: String  
Required: Yes

## Response Syntax


```
{
   "taskDefinition": { 
      "compatibilities": [ "string" ],
      "containerDefinitions": [ 
         { 
            "command": [ "string" ],
            "cpu": number,
            "credentialSpecs": [ "string" ],
            "dependsOn": [ 
               { 
                  "condition": "string",
                  "containerName": "string"
               }
            ],
            "disableNetworking": boolean,
            "dnsSearchDomains": [ "string" ],
            "dnsServers": [ "string" ],
            "dockerLabels": { 
               "string" : "string" 
            },
            "dockerSecurityOptions": [ "string" ],
            "entryPoint": [ "string" ],
            "environment": [ 
               { 
                  "name": "string",
                  "value": "string"
               }
            ],
            "environmentFiles": [ 
               { 
                  "type": "string",
                  "value": "string"
               }
            ],
            "essential": boolean,
            "extraHosts": [ 
               { 
                  "hostname": "string",
                  "ipAddress": "string"
               }
            ],
            "firelensConfiguration": { 
               "options": { 
                  "string" : "string" 
               },
               "type": "string"
            },
            "healthCheck": { 
               "command": [ "string" ],
               "interval": number,
               "retries": number,
               "startPeriod": number,
               "timeout": number
            },
            "hostname": "string",
            "image": "string",
            "interactive": boolean,
            "links": [ "string" ],
            "linuxParameters": { 
               "capabilities": { 
                  "add": [ "string" ],
                  "drop": [ "string" ]
               },
               "devices": [ 
                  { 
                     "containerPath": "string",
                     "hostPath": "string",
                     "permissions": [ "string" ]
                  }
               ],
               "initProcessEnabled": boolean,
               "maxSwap": number,
               "sharedMemorySize": number,
               "swappiness": number,
               "tmpfs": [ 
                  { 
                     "containerPath": "string",
                     "mountOptions": [ "string" ],
                     "size": number
                  }
               ]
            },
            "logConfiguration": { 
               "logDriver": "string",
               "options": { 
                  "string" : "string" 
               },
               "secretOptions": [ 
                  { 
                     "name": "string",
                     "valueFrom": "string"
                  }
               ]
            },
            "memory": number,
            "memoryReservation": number,
            "mountPoints": [ 
               { 
                  "containerPath": "string",
                  "readOnly": boolean,
                  "sourceVolume": "string"
               }
            ],
            "name": "string",
            "portMappings": [ 
               { 
                  "appProtocol": "string",
                  "containerPort": number,
                  "containerPortRange": "string",
                  "hostPort": number,
                  "name": "string",
                  "protocol": "string"
               }
            ],
            "privileged": boolean,
            "pseudoTerminal": boolean,
            "readonlyRootFilesystem": boolean,
            "repositoryCredentials": { 
               "credentialsParameter": "string"
            },
            "resourceRequirements": [ 
               { 
                  "type": "string",
                  "value": "string"
               }
            ],
            "restartPolicy": { 
               "enabled": boolean,
               "ignoredExitCodes": [ number ],
               "restartAttemptPeriod": number
            },
            "secrets": [ 
               { 
                  "name": "string",
                  "valueFrom": "string"
               }
            ],
            "startTimeout": number,
            "stopTimeout": number,
            "systemControls": [ 
               { 
                  "namespace": "string",
                  "value": "string"
               }
            ],
            "ulimits": [ 
               { 
                  "hardLimit": number,
                  "name": "string",
                  "softLimit": number
               }
            ],
            "user": "string",
            "versionConsistency": "string",
            "volumesFrom": [ 
               { 
                  "readOnly": boolean,
                  "sourceContainer": "string"
               }
            ],
            "workingDirectory": "string"
         }
      ],
      "cpu": "string",
      "deleteRequestedAt": number,
      "deregisteredAt": number,
      "enableFaultInjection": boolean,
      "ephemeralStorage": { 
         "sizeInGiB": number
      },
      "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"
      },
      "registeredAt": number,
      "registeredBy": "string",
      "requiresAttributes": [ 
         { 
            "name": "string",
            "targetId": "string",
            "targetType": "string",
            "value": "string"
         }
      ],
      "requiresCompatibilities": [ "string" ],
      "revision": number,
      "runtimePlatform": { 
         "cpuArchitecture": "string",
         "operatingSystemFamily": "string"
      },
      "status": "string",
      "taskDefinitionArn": "string",
      "taskRoleArn": "string",
      "volumes": [ 
         { 
            "configuredAtLaunch": boolean,
            "dockerVolumeConfiguration": { 
               "autoprovision": boolean,
               "driver": "string",
               "driverOpts": { 
                  "string" : "string" 
               },
               "labels": { 
                  "string" : "string" 
               },
               "scope": "string"
            },
            "efsVolumeConfiguration": { 
               "authorizationConfig": { 
                  "accessPointId": "string",
                  "iam": "string"
               },
               "fileSystemId": "string",
               "rootDirectory": "string",
               "transitEncryption": "string",
               "transitEncryptionPort": number
            },
            "fsxWindowsFileServerVolumeConfiguration": { 
               "authorizationConfig": { 
                  "credentialsParameter": "string",
                  "domain": "string"
               },
               "fileSystemId": "string",
               "rootDirectory": "string"
            },
            "host": { 
               "sourcePath": "string"
            },
            "name": "string"
         }
      ]
   }
}
```

## 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.

 ** [taskDefinition](#API_DeregisterTaskDefinition_ResponseSyntax) **   <a name="ECS-DeregisterTaskDefinition-response-taskDefinition"></a>
The full description of the deregistered task.  
Type: [TaskDefinition](API_TaskDefinition.md) object

## Errors


For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** ClientException **   
These errors are usually caused by a client action. This client action might be using an action or resource on behalf of a user that doesn't have permissions to use the action or resource. Or, it might be specifying an identifier that isn't valid.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** InvalidParameterException **   
The specified parameter isn't valid. Review the available parameters for the API request.  
For more information about service event errors, see [Amazon ECS service event messages](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/service-event-messages-list.html).     
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ServerException **   
These errors are usually caused by a server issue.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 500

## Examples


In the following example or examples, the Authorization header contents (`AUTHPARAMS`) must be replaced with an Amazon Signature Version 4 signature. For more information, see [Signature Version 4 Signing Process](https://docs.amazonaws.cn/general/latest/gr/signature-version-4.html) in the * Amazon General Reference*.

You only need to learn how to sign HTTP requests if you intend to create them manually. When you use the [Amazon Command Line Interface](http://www.amazonaws.cn/cli/) or one of the [Amazon SDKs](http://www.amazonaws.cn/tools/) to make requests to Amazon, these tools automatically sign the requests for you, with the access key that you specify when you configure the tools. When you use these tools, you don't have to sign requests yourself.

### Example


The following example request deregisters the first revision of the `cpu-wave` task definition family (`cpu-wave:1`). In the resulting output, the task definition status becomes `INACTIVE`.

#### Sample Request


```
POST / HTTP/1.1
Host: ecs.us-east-1.amazonaws.com
Accept-Encoding: identity
Content-Length: 35
X-Amz-Target: AmazonEC2ContainerServiceV20141113.DeregisterTaskDefinition
X-Amz-Date: 20150429T184806Z
Content-Type: application/x-amz-json-1.1
Authorization: AUTHPARAMS

{
  "taskDefinition": "cpu-wave:1"
}
```

#### Sample Response


```
HTTP/1.1 200 OK
Server: Server
Date: Fri, 12 Jun 2015 23:07:39 GMT
Content-Type: application/x-amz-json-1.1
Content-Length: 491
Connection: keep-alive
x-amzn-RequestId: 123a4b56-7c89-01d2-3ef4-example5678f

{
  "taskDefinition": {
    "containerDefinitions": [
      {
        "command": [
          "apt-get update; apt-get install stress; while true; do stress --cpu $(( RANDOM % 4 )) -t $(( RANDOM % 10 )); done"
        ],
        "cpu": 50,
        "entryPoint": [
          "bash",
          "-c"
        ],
        "environment": [],
        "essential": true,
        "image": "public.ecr.aws/docker/library/ubuntu:latest",
        "memory": 100,
        "mountPoints": [],
        "name": "wave",
        "portMappings": [],
        "volumesFrom": []
      }
    ],
    "family": "cpu-wave",
    "revision": 1,
    "status": "INACTIVE",
    "taskDefinitionArn": "arn:aws:ecs:us-west-2:012345678910:task-definition/cpu-wave:1",
    "volumes": []
  }
}
```

## See Also


For more information about using this API in one of the language-specific Amazon SDKs, see the following:
+  [Amazon Command Line Interface V2](https://docs.amazonaws.cn/goto/cli2/ecs-2014-11-13/DeregisterTaskDefinition) 
+  [Amazon SDK for .NET V4](https://docs.amazonaws.cn/goto/DotNetSDKV4/ecs-2014-11-13/DeregisterTaskDefinition) 
+  [Amazon SDK for C\$1\$1](https://docs.amazonaws.cn/goto/SdkForCpp/ecs-2014-11-13/DeregisterTaskDefinition) 
+  [Amazon SDK for Go v2](https://docs.amazonaws.cn/goto/SdkForGoV2/ecs-2014-11-13/DeregisterTaskDefinition) 
+  [Amazon SDK for Java V2](https://docs.amazonaws.cn/goto/SdkForJavaV2/ecs-2014-11-13/DeregisterTaskDefinition) 
+  [Amazon SDK for JavaScript V3](https://docs.amazonaws.cn/goto/SdkForJavaScriptV3/ecs-2014-11-13/DeregisterTaskDefinition) 
+  [Amazon SDK for Kotlin](https://docs.amazonaws.cn/goto/SdkForKotlin/ecs-2014-11-13/DeregisterTaskDefinition) 
+  [Amazon SDK for PHP V3](https://docs.amazonaws.cn/goto/SdkForPHPV3/ecs-2014-11-13/DeregisterTaskDefinition) 
+  [Amazon SDK for Python](https://docs.amazonaws.cn/goto/boto3/ecs-2014-11-13/DeregisterTaskDefinition) 
+  [Amazon SDK for Ruby V3](https://docs.amazonaws.cn/goto/SdkForRubyV3/ecs-2014-11-13/DeregisterTaskDefinition) 

# DescribeCapacityProviders


Describes one or more of your capacity providers.

## Request Syntax


```
{
   "capacityProviders": [ "string" ],
   "cluster": "string",
   "include": [ "string" ],
   "maxResults": number,
   "nextToken": "string"
}
```

## Request Parameters


For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [capacityProviders](#API_DescribeCapacityProviders_RequestSyntax) **   <a name="ECS-DescribeCapacityProviders-request-capacityProviders"></a>
The short name or full Amazon Resource Name (ARN) of one or more capacity providers. Up to `100` capacity providers can be described in an action.  
Type: Array of strings  
Required: No

 ** [cluster](#API_DescribeCapacityProviders_RequestSyntax) **   <a name="ECS-DescribeCapacityProviders-request-cluster"></a>
The name of the cluster to describe capacity providers for. When specified, only capacity providers associated with this cluster are returned, including Amazon ECS Managed Instances capacity providers.  
Type: String  
Required: No

 ** [include](#API_DescribeCapacityProviders_RequestSyntax) **   <a name="ECS-DescribeCapacityProviders-request-include"></a>
Specifies whether or not you want to see the resource tags for the capacity provider. If `TAGS` is specified, the tags are included in the response. If this field is omitted, tags aren't included in the response.  
Type: Array of strings  
Valid Values: `TAGS`   
Required: No

 ** [maxResults](#API_DescribeCapacityProviders_RequestSyntax) **   <a name="ECS-DescribeCapacityProviders-request-maxResults"></a>
The maximum number of account setting results returned by `DescribeCapacityProviders` in paginated output. When this parameter is used, `DescribeCapacityProviders` only returns `maxResults` results in a single page along with a `nextToken` response element. The remaining results of the initial request can be seen by sending another `DescribeCapacityProviders` request with the returned `nextToken` value. This value can be between 1 and 10. If this parameter is not used, then `DescribeCapacityProviders` returns up to 10 results and a `nextToken` value if applicable.  
Type: Integer  
Required: No

 ** [nextToken](#API_DescribeCapacityProviders_RequestSyntax) **   <a name="ECS-DescribeCapacityProviders-request-nextToken"></a>
The `nextToken` value returned from a previous paginated `DescribeCapacityProviders` request where `maxResults` was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the `nextToken` value.  
This token should be treated as an opaque identifier that is only used to retrieve the next items in a list and not for other programmatic purposes.
Type: String  
Required: No

## Response Syntax


```
{
   "capacityProviders": [ 
      { 
         "autoScalingGroupProvider": { 
            "autoScalingGroupArn": "string",
            "managedDraining": "string",
            "managedScaling": { 
               "instanceWarmupPeriod": number,
               "maximumScalingStepSize": number,
               "minimumScalingStepSize": number,
               "status": "string",
               "targetCapacity": number
            },
            "managedTerminationProtection": "string"
         },
         "capacityProviderArn": "string",
         "cluster": "string",
         "managedInstancesProvider": { 
            "infrastructureOptimization": { 
               "scaleInAfter": number
            },
            "infrastructureRoleArn": "string",
            "instanceLaunchTemplate": { 
               "capacityOptionType": "string",
               "capacityReservations": { 
                  "reservationGroupArn": "string",
                  "reservationPreference": "string"
               },
               "ec2InstanceProfileArn": "string",
               "fipsEnabled": boolean,
               "instanceMetadataTagsPropagation": boolean,
               "instanceRequirements": { 
                  "acceleratorCount": { 
                     "max": number,
                     "min": number
                  },
                  "acceleratorManufacturers": [ "string" ],
                  "acceleratorNames": [ "string" ],
                  "acceleratorTotalMemoryMiB": { 
                     "max": number,
                     "min": number
                  },
                  "acceleratorTypes": [ "string" ],
                  "allowedInstanceTypes": [ "string" ],
                  "bareMetal": "string",
                  "baselineEbsBandwidthMbps": { 
                     "max": number,
                     "min": number
                  },
                  "burstablePerformance": "string",
                  "cpuManufacturers": [ "string" ],
                  "excludedInstanceTypes": [ "string" ],
                  "instanceGenerations": [ "string" ],
                  "localStorage": "string",
                  "localStorageTypes": [ "string" ],
                  "maxSpotPriceAsPercentageOfOptimalOnDemandPrice": number,
                  "memoryGiBPerVCpu": { 
                     "max": number,
                     "min": number
                  },
                  "memoryMiB": { 
                     "max": number,
                     "min": number
                  },
                  "networkBandwidthGbps": { 
                     "max": number,
                     "min": number
                  },
                  "networkInterfaceCount": { 
                     "max": number,
                     "min": number
                  },
                  "onDemandMaxPricePercentageOverLowestPrice": number,
                  "requireHibernateSupport": boolean,
                  "spotMaxPricePercentageOverLowestPrice": number,
                  "totalLocalStorageGB": { 
                     "max": number,
                     "min": number
                  },
                  "vCpuCount": { 
                     "max": number,
                     "min": number
                  }
               },
               "localStorageConfiguration": { 
                  "useLocalStorage": boolean
               },
               "monitoring": "string",
               "networkConfiguration": { 
                  "securityGroups": [ "string" ],
                  "subnets": [ "string" ]
               },
               "storageConfiguration": { 
                  "storageSizeGiB": number
               }
            },
            "propagateTags": "string"
         },
         "name": "string",
         "status": "string",
         "tags": [ 
            { 
               "key": "string",
               "value": "string"
            }
         ],
         "type": "string",
         "updateStatus": "string",
         "updateStatusReason": "string"
      }
   ],
   "failures": [ 
      { 
         "arn": "string",
         "detail": "string",
         "reason": "string"
      }
   ],
   "nextToken": "string"
}
```

## 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.

 ** [capacityProviders](#API_DescribeCapacityProviders_ResponseSyntax) **   <a name="ECS-DescribeCapacityProviders-response-capacityProviders"></a>
The list of capacity providers.  
Type: Array of [CapacityProvider](API_CapacityProvider.md) objects

 ** [failures](#API_DescribeCapacityProviders_ResponseSyntax) **   <a name="ECS-DescribeCapacityProviders-response-failures"></a>
Any failures associated with the call.  
Type: Array of [Failure](API_Failure.md) objects

 ** [nextToken](#API_DescribeCapacityProviders_ResponseSyntax) **   <a name="ECS-DescribeCapacityProviders-response-nextToken"></a>
The `nextToken` value to include in a future `DescribeCapacityProviders` request. When the results of a `DescribeCapacityProviders` request exceed `maxResults`, this value can be used to retrieve the next page of results. This value is `null` when there are no more results to return.  
Type: String

## Errors


For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** ClientException **   
These errors are usually caused by a client action. This client action might be using an action or resource on behalf of a user that doesn't have permissions to use the action or resource. Or, it might be specifying an identifier that isn't valid.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ClusterNotFoundException **   
The specified cluster wasn't found. You can view your available clusters with [ListClusters](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_ListClusters.html). Amazon ECS clusters are Region specific.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** InvalidParameterException **   
The specified parameter isn't valid. Review the available parameters for the API request.  
For more information about service event errors, see [Amazon ECS service event messages](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/service-event-messages-list.html).     
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ServerException **   
These errors are usually caused by a server issue.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 500

 ** UnsupportedFeatureException **   
The specified task isn't supported in this Region.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

## See Also


For more information about using this API in one of the language-specific Amazon SDKs, see the following:
+  [Amazon Command Line Interface V2](https://docs.amazonaws.cn/goto/cli2/ecs-2014-11-13/DescribeCapacityProviders) 
+  [Amazon SDK for .NET V4](https://docs.amazonaws.cn/goto/DotNetSDKV4/ecs-2014-11-13/DescribeCapacityProviders) 
+  [Amazon SDK for C\$1\$1](https://docs.amazonaws.cn/goto/SdkForCpp/ecs-2014-11-13/DescribeCapacityProviders) 
+  [Amazon SDK for Go v2](https://docs.amazonaws.cn/goto/SdkForGoV2/ecs-2014-11-13/DescribeCapacityProviders) 
+  [Amazon SDK for Java V2](https://docs.amazonaws.cn/goto/SdkForJavaV2/ecs-2014-11-13/DescribeCapacityProviders) 
+  [Amazon SDK for JavaScript V3](https://docs.amazonaws.cn/goto/SdkForJavaScriptV3/ecs-2014-11-13/DescribeCapacityProviders) 
+  [Amazon SDK for Kotlin](https://docs.amazonaws.cn/goto/SdkForKotlin/ecs-2014-11-13/DescribeCapacityProviders) 
+  [Amazon SDK for PHP V3](https://docs.amazonaws.cn/goto/SdkForPHPV3/ecs-2014-11-13/DescribeCapacityProviders) 
+  [Amazon SDK for Python](https://docs.amazonaws.cn/goto/boto3/ecs-2014-11-13/DescribeCapacityProviders) 
+  [Amazon SDK for Ruby V3](https://docs.amazonaws.cn/goto/SdkForRubyV3/ecs-2014-11-13/DescribeCapacityProviders) 

# DescribeClusters


Describes one or more of your clusters.

 For Amazon CLI examples, see [describe-clusters.rst](https://github.com/aws/aws-cli/blob/develop/awscli/examples/ecs/describe-clusters.rst) on GitHub.

## Request Syntax


```
{
   "clusters": [ "string" ],
   "include": [ "string" ]
}
```

## Request Parameters


For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [clusters](#API_DescribeClusters_RequestSyntax) **   <a name="ECS-DescribeClusters-request-clusters"></a>
A list of up to 100 cluster names or full cluster Amazon Resource Name (ARN) entries. If you do not specify a cluster, the default cluster is assumed.  
Type: Array of strings  
Required: No

 ** [include](#API_DescribeClusters_RequestSyntax) **   <a name="ECS-DescribeClusters-request-include"></a>
Determines whether to include additional information about the clusters in the response. If this field is omitted, this information isn't included.  
If `ATTACHMENTS` is specified, the attachments for the container instances or tasks within the cluster are included, for example the capacity providers.  
If `SETTINGS` is specified, the settings for the cluster are included.  
If `CONFIGURATIONS` is specified, the configuration for the cluster is included.  
If `STATISTICS` is specified, the task and service count is included, separated by launch type.  
If `TAGS` is specified, the metadata tags associated with the cluster are included.  
Type: Array of strings  
Valid Values: `ATTACHMENTS | CONFIGURATIONS | SETTINGS | STATISTICS | TAGS`   
Required: No

## Response Syntax


```
{
   "clusters": [ 
      { 
         "activeServicesCount": number,
         "attachments": [ 
            { 
               "details": [ 
                  { 
                     "name": "string",
                     "value": "string"
                  }
               ],
               "id": "string",
               "status": "string",
               "type": "string"
            }
         ],
         "attachmentsStatus": "string",
         "capacityProviders": [ "string" ],
         "clusterArn": "string",
         "clusterName": "string",
         "configuration": { 
            "executeCommandConfiguration": { 
               "kmsKeyId": "string",
               "logConfiguration": { 
                  "cloudWatchEncryptionEnabled": boolean,
                  "cloudWatchLogGroupName": "string",
                  "s3BucketName": "string",
                  "s3EncryptionEnabled": boolean,
                  "s3KeyPrefix": "string"
               },
               "logging": "string"
            },
            "managedStorageConfiguration": { 
               "fargateEphemeralStorageKmsKeyId": "string",
               "kmsKeyId": "string"
            }
         },
         "defaultCapacityProviderStrategy": [ 
            { 
               "base": number,
               "capacityProvider": "string",
               "weight": number
            }
         ],
         "pendingTasksCount": number,
         "registeredContainerInstancesCount": number,
         "runningTasksCount": number,
         "serviceConnectDefaults": { 
            "namespace": "string"
         },
         "settings": [ 
            { 
               "name": "string",
               "value": "string"
            }
         ],
         "statistics": [ 
            { 
               "name": "string",
               "value": "string"
            }
         ],
         "status": "string",
         "tags": [ 
            { 
               "key": "string",
               "value": "string"
            }
         ]
      }
   ],
   "failures": [ 
      { 
         "arn": "string",
         "detail": "string",
         "reason": "string"
      }
   ]
}
```

## 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.

 ** [clusters](#API_DescribeClusters_ResponseSyntax) **   <a name="ECS-DescribeClusters-response-clusters"></a>
The list of clusters.  
Type: Array of [Cluster](API_Cluster.md) objects

 ** [failures](#API_DescribeClusters_ResponseSyntax) **   <a name="ECS-DescribeClusters-response-failures"></a>
Any failures associated with the call.  
Type: Array of [Failure](API_Failure.md) objects

## Errors


For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** ClientException **   
These errors are usually caused by a client action. This client action might be using an action or resource on behalf of a user that doesn't have permissions to use the action or resource. Or, it might be specifying an identifier that isn't valid.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** InvalidParameterException **   
The specified parameter isn't valid. Review the available parameters for the API request.  
For more information about service event errors, see [Amazon ECS service event messages](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/service-event-messages-list.html).     
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ServerException **   
These errors are usually caused by a server issue.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 500

## Examples


In the following example or examples, the Authorization header contents (`AUTHPARAMS`) must be replaced with an Amazon Signature Version 4 signature. For more information, see [Signature Version 4 Signing Process](https://docs.amazonaws.cn/general/latest/gr/signature-version-4.html) in the * Amazon General Reference*.

You only need to learn how to sign HTTP requests if you intend to create them manually. When you use the [Amazon Command Line Interface](http://www.amazonaws.cn/cli/) or one of the [Amazon SDKs](http://www.amazonaws.cn/tools/) to make requests to Amazon, these tools automatically sign the requests for you, with the access key that you specify when you configure the tools. When you use these tools, you don't have to sign requests yourself.

### Example


This example request provides descriptive information about the default cluster.

#### Sample Request


```
POST / HTTP/1.1
Host: ecs.us-east-1.amazonaws.com
Accept-Encoding: identity
Content-Length: 25
X-Amz-Target: AmazonEC2ContainerServiceV20141113.DescribeClusters
X-Amz-Date: 20150429T185014Z
Content-Type: application/x-amz-json-1.1
Authorization: AUTHPARAMS

{
  "clusters": [
    "default"
  ]
}
```

#### Sample Response


```
HTTP/1.1 200 OK
Server: Server
Date: Wed, 29 Apr 2015 18:50:14 GMT
Content-Type: application/x-amz-json-1.1
Content-Length: 220
Connection: keep-alive
x-amzn-RequestId: 123a4b56-7c89-01d2-3ef4-example5678f

{
  "clusters": [
    {
      "activeServicesCount": 1,
      "clusterArn": "arn:aws:ecs:us-east-1:012345678910:cluster/default",
      "clusterName": "default",
      "pendingTasksCount": 0,
      "registeredContainerInstancesCount": 0,
      "runningTasksCount": 0,
      "status": "ACTIVE"
    }
  ],
  "failures": []
}
```

### Example


This example request provides descriptive information about a cluster that has an associated capacity provider with managed scaling turned on. The capacity provider and the scaling policy that Amazon ECS creates on your behalf are included as attachments in the response.

#### Sample Request


```
POST / HTTP/1.1
Host: ecs.us-east-1.amazonaws.com
Accept-Encoding: identity
Content-Length: 25
X-Amz-Target: AmazonEC2ContainerServiceV20141113.DescribeClusters
X-Amz-Date: 20220429T185014Z
Content-Type: application/x-amz-json-1.1
Authorization: AUTHPARAMS

{
  "clusters": [
    "cluster-with-capacity-provider",
    "include": ["ATTACHMENTS"]
  ]
}
```

#### Sample Response


```
HTTP/1.1 200 OK
Server: Server
Date: Wed, 29 Apr 2022 18:50:14 GMT
Content-Type: application/x-amz-json-1.1
Content-Length: 220
Connection: keep-alive
x-amzn-RequestId: 123a4b56-7c89-01d2-3ef4-example5678f

{
    "clusters": [
        {
            "clusterArn": "arn:aws:ecs:us-west-2:012345678910:cluster/cluster-with-capacity-provider",
            "clusterName": "cluster-with-capacity-provider",
            "status": "ACTIVE",
            "registeredContainerInstancesCount": 0,
            "runningTasksCount": 0,
            "pendingTasksCount": 0,
            "activeServicesCount": 0,
            "statistics": [],
            "tags": [],
            "settings": [],
            "capacityProviders": [
                "FARGATE",
                "FARGATE_SPOT",
                "Infra-ECS-Cluster-45ff394c-615f-4496-a336-8019a3b38d7a-EC2CapacityProvider-EXAMPLE"
            ],
            "defaultCapacityProviderStrategy": [],
            "attachments": [
                {
                    "id": "bf5ecfe0-f813-4356-b862-1dbe6025c57f",
                    "type": "as_policy",
                    "status": "CREATED",
                    "details": [
                        {
                            "name": "capacityProviderName",
                            "value": "Infra-ECS-Cluster-45ff394c-615f-4496-a336-8019a3b38d7a-EC2CapacityProvider-EXAMPLE"
                        },
                        {
                            "name": "scalingPolicyName",
                            "value": "ECSManagedAutoScalingPolicy-55c67464-7691-4310-a725-EXAMPLE"
                        }
                    ]
                }
            ],
            "attachmentsStatus": "UPDATE_COMPLETE"
        }
    ],
    "failures": []
}
```

## See Also


For more information about using this API in one of the language-specific Amazon SDKs, see the following:
+  [Amazon Command Line Interface V2](https://docs.amazonaws.cn/goto/cli2/ecs-2014-11-13/DescribeClusters) 
+  [Amazon SDK for .NET V4](https://docs.amazonaws.cn/goto/DotNetSDKV4/ecs-2014-11-13/DescribeClusters) 
+  [Amazon SDK for C\$1\$1](https://docs.amazonaws.cn/goto/SdkForCpp/ecs-2014-11-13/DescribeClusters) 
+  [Amazon SDK for Go v2](https://docs.amazonaws.cn/goto/SdkForGoV2/ecs-2014-11-13/DescribeClusters) 
+  [Amazon SDK for Java V2](https://docs.amazonaws.cn/goto/SdkForJavaV2/ecs-2014-11-13/DescribeClusters) 
+  [Amazon SDK for JavaScript V3](https://docs.amazonaws.cn/goto/SdkForJavaScriptV3/ecs-2014-11-13/DescribeClusters) 
+  [Amazon SDK for Kotlin](https://docs.amazonaws.cn/goto/SdkForKotlin/ecs-2014-11-13/DescribeClusters) 
+  [Amazon SDK for PHP V3](https://docs.amazonaws.cn/goto/SdkForPHPV3/ecs-2014-11-13/DescribeClusters) 
+  [Amazon SDK for Python](https://docs.amazonaws.cn/goto/boto3/ecs-2014-11-13/DescribeClusters) 
+  [Amazon SDK for Ruby V3](https://docs.amazonaws.cn/goto/SdkForRubyV3/ecs-2014-11-13/DescribeClusters) 

# DescribeContainerInstances


Describes one or more container instances. Returns metadata about each container instance requested.

## Request Syntax


```
{
   "cluster": "string",
   "containerInstances": [ "string" ],
   "include": [ "string" ]
}
```

## Request Parameters


For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [cluster](#API_DescribeContainerInstances_RequestSyntax) **   <a name="ECS-DescribeContainerInstances-request-cluster"></a>
The short name or full Amazon Resource Name (ARN) of the cluster that hosts the container instances to describe. If you do not specify a cluster, the default cluster is assumed. This parameter is required if the container instance or container instances you are describing were launched in any cluster other than the default cluster.  
Type: String  
Required: No

 ** [containerInstances](#API_DescribeContainerInstances_RequestSyntax) **   <a name="ECS-DescribeContainerInstances-request-containerInstances"></a>
A list of up to 100 container instance IDs or full Amazon Resource Name (ARN) entries.  
Type: Array of strings  
Required: Yes

 ** [include](#API_DescribeContainerInstances_RequestSyntax) **   <a name="ECS-DescribeContainerInstances-request-include"></a>
Specifies whether you want to see the resource tags for the container instance. If `TAGS` is specified, the tags are included in the response. If `CONTAINER_INSTANCE_HEALTH` is specified, the container instance health is included in the response. If this field is omitted, tags and container instance health status aren't included in the response.  
Type: Array of strings  
Valid Values: `TAGS | CONTAINER_INSTANCE_HEALTH`   
Required: No

## Response Syntax


```
{
   "containerInstances": [ 
      { 
         "agentConnected": boolean,
         "agentUpdateStatus": "string",
         "attachments": [ 
            { 
               "details": [ 
                  { 
                     "name": "string",
                     "value": "string"
                  }
               ],
               "id": "string",
               "status": "string",
               "type": "string"
            }
         ],
         "attributes": [ 
            { 
               "name": "string",
               "targetId": "string",
               "targetType": "string",
               "value": "string"
            }
         ],
         "capacityProviderName": "string",
         "containerInstanceArn": "string",
         "ec2InstanceId": "string",
         "healthStatus": { 
            "details": [ 
               { 
                  "lastStatusChange": number,
                  "lastUpdated": number,
                  "status": "string",
                  "type": "string"
               }
            ],
            "overallStatus": "string"
         },
         "pendingTasksCount": number,
         "registeredAt": number,
         "registeredResources": [ 
            { 
               "doubleValue": number,
               "integerValue": number,
               "longValue": number,
               "name": "string",
               "stringSetValue": [ "string" ],
               "type": "string"
            }
         ],
         "remainingResources": [ 
            { 
               "doubleValue": number,
               "integerValue": number,
               "longValue": number,
               "name": "string",
               "stringSetValue": [ "string" ],
               "type": "string"
            }
         ],
         "runningTasksCount": number,
         "status": "string",
         "statusReason": "string",
         "tags": [ 
            { 
               "key": "string",
               "value": "string"
            }
         ],
         "version": number,
         "versionInfo": { 
            "agentHash": "string",
            "agentVersion": "string",
            "dockerVersion": "string"
         }
      }
   ],
   "failures": [ 
      { 
         "arn": "string",
         "detail": "string",
         "reason": "string"
      }
   ]
}
```

## 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.

 ** [containerInstances](#API_DescribeContainerInstances_ResponseSyntax) **   <a name="ECS-DescribeContainerInstances-response-containerInstances"></a>
The list of container instances.  
Type: Array of [ContainerInstance](API_ContainerInstance.md) objects

 ** [failures](#API_DescribeContainerInstances_ResponseSyntax) **   <a name="ECS-DescribeContainerInstances-response-failures"></a>
Any failures associated with the call.  
Type: Array of [Failure](API_Failure.md) objects

## Errors


For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** ClientException **   
These errors are usually caused by a client action. This client action might be using an action or resource on behalf of a user that doesn't have permissions to use the action or resource. Or, it might be specifying an identifier that isn't valid.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ClusterNotFoundException **   
The specified cluster wasn't found. You can view your available clusters with [ListClusters](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_ListClusters.html). Amazon ECS clusters are Region specific.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** InvalidParameterException **   
The specified parameter isn't valid. Review the available parameters for the API request.  
For more information about service event errors, see [Amazon ECS service event messages](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/service-event-messages-list.html).     
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ServerException **   
These errors are usually caused by a server issue.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 500

## Examples


In the following example or examples, the Authorization header contents (`AUTHPARAMS`) must be replaced with an Amazon Signature Version 4 signature. For more information, see [Signature Version 4 Signing Process](https://docs.amazonaws.cn/general/latest/gr/signature-version-4.html) in the * Amazon General Reference*.

You only need to learn how to sign HTTP requests if you intend to create them manually. When you use the [Amazon Command Line Interface](http://www.amazonaws.cn/cli/) or one of the [Amazon SDKs](http://www.amazonaws.cn/tools/) to make requests to Amazon, these tools automatically sign the requests for you, with the access key that you specify when you configure the tools. When you use these tools, you don't have to sign requests yourself.

### Example


This example request provides descriptive information about a container instance with an ID of `f9cc75bb-0c94-46b9-bf6d-49d320bc1551` in the `default` cluster.

#### Sample Request


```
POST / HTTP/1.1
Host: ecs.us-west-2.amazonaws.com
Accept-Encoding: identity
Content-Length: 64
X-Amz-Target: AmazonEC2ContainerServiceV20141113.DescribeContainerInstances
X-Amz-Date: 20160520T171518Z
User-Agent: aws-cli/1.10.30 Python/2.7.11 Darwin/15.4.0 botocore/1.4.17
Content-Type: application/x-amz-json-1.1
Authorization: AUTHPARAMS

{
    "containerInstances": [
        "f9cc75bb-0c94-46b9-bf6d-49d320bc1551"
    ]
}
```

#### Sample Response


```
{
    "containerInstances": [
        {
            "agentConnected": true,
            "attributes": [
                {
                    "name": "com.amazonaws.ecs.capability.privileged-container"
                },
                {
                    "name": "com.amazonaws.ecs.capability.docker-remote-api.1.17"
                },
                {
                    "name": "com.amazonaws.ecs.capability.docker-remote-api.1.18"
                },
                {
                    "name": "com.amazonaws.ecs.capability.docker-remote-api.1.19"
                },
                {
                    "name": "com.amazonaws.ecs.capability.docker-remote-api.1.20"
                },
                {
                    "name": "com.amazonaws.ecs.capability.docker-remote-api.1.21"
                },
                {
                    "name": "com.amazonaws.ecs.capability.logging-driver.json-file"
                },
                {
                    "name": "com.amazonaws.ecs.capability.logging-driver.syslog"
                },
                {
                    "name": "com.amazonaws.ecs.capability.logging-driver.awslogs"
                },
                {
                    "name": "com.amazonaws.ecs.capability.ecr-auth"
                }
            ],
            "containerInstanceArn": "arn:aws:ecs:us-west-2:012345678910:container-instance/default/f9cc75bb-0c94-46b9-bf6d-49d320bc1551",
            "ec2InstanceId": "i-042f39dc",
            "pendingTasksCount": 0,
            "registeredResources": [
                {
                    "doubleValue": 0,
                    "integerValue": 1024,
                    "longValue": 0,
                    "name": "CPU",
                    "type": "INTEGER"
                },
                {
                    "doubleValue": 0,
                    "integerValue": 995,
                    "longValue": 0,
                    "name": "MEMORY",
                    "type": "INTEGER"
                },
                {
                    "doubleValue": 0,
                    "integerValue": 0,
                    "longValue": 0,
                    "name": "PORTS",
                    "stringSetValue": [
                        "22",
                        "2376",
                        "2375",
                        "51678"
                    ],
                    "type": "STRINGSET"
                },
                {
                    "doubleValue": 0,
                    "integerValue": 0,
                    "longValue": 0,
                    "name": "PORTS_UDP",
                    "stringSetValue": [],
                    "type": "STRINGSET"
                }
            ],
            "remainingResources": [
                {
                    "doubleValue": 0,
                    "integerValue": 1024,
                    "longValue": 0,
                    "name": "CPU",
                    "type": "INTEGER"
                },
                {
                    "doubleValue": 0,
                    "integerValue": 995,
                    "longValue": 0,
                    "name": "MEMORY",
                    "type": "INTEGER"
                },
                {
                    "doubleValue": 0,
                    "integerValue": 0,
                    "longValue": 0,
                    "name": "PORTS",
                    "stringSetValue": [
                        "22",
                        "2376",
                        "2375",
                        "51678"
                    ],
                    "type": "STRINGSET"
                },
                {
                    "doubleValue": 0,
                    "integerValue": 0,
                    "longValue": 0,
                    "name": "PORTS_UDP",
                    "stringSetValue": [],
                    "type": "STRINGSET"
                }
            ],
            "runningTasksCount": 0,
            "status": "ACTIVE",
            "version": 850,
            "versionInfo": {
                "agentHash": "0931217",
                "agentVersion": "1.9.0",
                "dockerVersion": "DockerVersion: 1.9.1"
            }
        }
    ],
    "failures": []
}
```

## See Also


For more information about using this API in one of the language-specific Amazon SDKs, see the following:
+  [Amazon Command Line Interface V2](https://docs.amazonaws.cn/goto/cli2/ecs-2014-11-13/DescribeContainerInstances) 
+  [Amazon SDK for .NET V4](https://docs.amazonaws.cn/goto/DotNetSDKV4/ecs-2014-11-13/DescribeContainerInstances) 
+  [Amazon SDK for C\$1\$1](https://docs.amazonaws.cn/goto/SdkForCpp/ecs-2014-11-13/DescribeContainerInstances) 
+  [Amazon SDK for Go v2](https://docs.amazonaws.cn/goto/SdkForGoV2/ecs-2014-11-13/DescribeContainerInstances) 
+  [Amazon SDK for Java V2](https://docs.amazonaws.cn/goto/SdkForJavaV2/ecs-2014-11-13/DescribeContainerInstances) 
+  [Amazon SDK for JavaScript V3](https://docs.amazonaws.cn/goto/SdkForJavaScriptV3/ecs-2014-11-13/DescribeContainerInstances) 
+  [Amazon SDK for Kotlin](https://docs.amazonaws.cn/goto/SdkForKotlin/ecs-2014-11-13/DescribeContainerInstances) 
+  [Amazon SDK for PHP V3](https://docs.amazonaws.cn/goto/SdkForPHPV3/ecs-2014-11-13/DescribeContainerInstances) 
+  [Amazon SDK for Python](https://docs.amazonaws.cn/goto/boto3/ecs-2014-11-13/DescribeContainerInstances) 
+  [Amazon SDK for Ruby V3](https://docs.amazonaws.cn/goto/SdkForRubyV3/ecs-2014-11-13/DescribeContainerInstances) 

# DescribeDaemon


Describes the specified daemon.

## Request Syntax


```
{
   "daemonArn": "string"
}
```

## Request Parameters


For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [daemonArn](#API_DescribeDaemon_RequestSyntax) **   <a name="ECS-DescribeDaemon-request-daemonArn"></a>
The Amazon Resource Name (ARN) of the daemon to describe.  
Type: String  
Required: Yes

## Response Syntax


```
{
   "daemon": { 
      "clusterArn": "string",
      "createdAt": number,
      "currentRevisions": [ 
         { 
            "arn": "string",
            "capacityProviders": [ 
               { 
                  "arn": "string",
                  "runningCount": number
               }
            ],
            "totalRunningCount": number
         }
      ],
      "daemonArn": "string",
      "deploymentArn": "string",
      "status": "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.

 ** [daemon](#API_DescribeDaemon_ResponseSyntax) **   <a name="ECS-DescribeDaemon-response-daemon"></a>
The full description of the daemon, including the current revisions, deployment ARN, cluster, and status information.  
Type: [DaemonDetail](API_DaemonDetail.md) object

## Errors


For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** AccessDeniedException **   
You don't have authorization to perform the requested action.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ClientException **   
These errors are usually caused by a client action. This client action might be using an action or resource on behalf of a user that doesn't have permissions to use the action or resource. Or, it might be specifying an identifier that isn't valid.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ClusterNotFoundException **   
The specified cluster wasn't found. You can view your available clusters with [ListClusters](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_ListClusters.html). Amazon ECS clusters are Region specific.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** DaemonNotFoundException **   
The specified daemon wasn't found. You can view your available daemons with [ListDaemons](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_ListDaemons.html). Amazon ECS daemons are cluster specific and Region specific.  
HTTP Status Code: 400

 ** InvalidParameterException **   
The specified parameter isn't valid. Review the available parameters for the API request.  
For more information about service event errors, see [Amazon ECS service event messages](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/service-event-messages-list.html).     
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ServerException **   
These errors are usually caused by a server issue.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 500

 ** UnsupportedFeatureException **   
The specified task isn't supported in this Region.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

## Examples


In the following example or examples, the Authorization header contents (`AUTHPARAMS`) must be replaced with an Amazon Signature Version 4 signature. For more information, see [Signature Version 4 Signing Process](https://docs.amazonaws.cn/general/latest/gr/signature-version-4.html) in the * Amazon General Reference*.

You only need to learn how to sign HTTP requests if you intend to create them manually. When you use the [Amazon Command Line Interface](http://www.amazonaws.cn/cli/) or one of the [Amazon SDKs](http://www.amazonaws.cn/tools/) to make requests to Amazon, these tools automatically sign the requests for you, with the access key that you specify when you configure the tools. When you use these tools, you don't have to sign requests yourself.

### Example


This example describes the my-monitoring-daemon daemon.

#### Sample Request


```
POST / HTTP/1.1
Host: ecs.us-east-1.amazonaws.com
Accept-Encoding: identity
Content-Length: 94
X-Amz-Target: AmazonEC2ContainerServiceV20141113.DescribeDaemon
X-Amz-Date: 20250320T160000Z
Content-Type: application/x-amz-json-1.1
Authorization: AUTHPARAMS

{
  "daemonArn": "arn:aws:ecs:us-east-1:123456789012:daemon/my-cluster/my-monitoring-daemon"
}
```

#### Sample Response


```
HTTP/1.1 200 OK
Server: Server
Date: Thu, 20 Mar 2025 16:00:00 GMT
Content-Type: application/x-amz-json-1.1
Content-Length: 822
Connection: keep-alive
x-amzn-RequestId: 123a4b56-7c89-01d2-3ef4-example5678f

{
  "daemon": {
    "daemonArn": "arn:aws:ecs:us-east-1:123456789012:daemon/my-cluster/my-monitoring-daemon",
    "clusterArn": "arn:aws:ecs:us-east-1:123456789012:cluster/my-cluster",
    "status": "ACTIVE",
    "currentRevisions": [
      {
        "arn": "arn:aws:ecs:us-east-1:123456789012:daemon-revision/my-cluster/my-monitoring-daemon/4980306466373577095",
        "capacityProviders": [
          {
            "arn": "arn:aws:ecs:us-east-1:123456789012:capacity-provider/my-capacity-provider",
            "runningCount": 3
          }
        ],
        "totalRunningCount": 3
      }
    ],
    "deploymentArn": "arn:aws:ecs:us-east-1:123456789012:daemon-deployment/my-cluster/my-monitoring-daemon/aB1cD2eF3gH4iJ5k",
    "createdAt": "2025-03-15T12:00:00.000Z",
    "updatedAt": "2025-03-20T15:30:00.000Z"
  }
}
```

## See Also


For more information about using this API in one of the language-specific Amazon SDKs, see the following:
+  [Amazon Command Line Interface V2](https://docs.amazonaws.cn/goto/cli2/ecs-2014-11-13/DescribeDaemon) 
+  [Amazon SDK for .NET V4](https://docs.amazonaws.cn/goto/DotNetSDKV4/ecs-2014-11-13/DescribeDaemon) 
+  [Amazon SDK for C\$1\$1](https://docs.amazonaws.cn/goto/SdkForCpp/ecs-2014-11-13/DescribeDaemon) 
+  [Amazon SDK for Go v2](https://docs.amazonaws.cn/goto/SdkForGoV2/ecs-2014-11-13/DescribeDaemon) 
+  [Amazon SDK for Java V2](https://docs.amazonaws.cn/goto/SdkForJavaV2/ecs-2014-11-13/DescribeDaemon) 
+  [Amazon SDK for JavaScript V3](https://docs.amazonaws.cn/goto/SdkForJavaScriptV3/ecs-2014-11-13/DescribeDaemon) 
+  [Amazon SDK for Kotlin](https://docs.amazonaws.cn/goto/SdkForKotlin/ecs-2014-11-13/DescribeDaemon) 
+  [Amazon SDK for PHP V3](https://docs.amazonaws.cn/goto/SdkForPHPV3/ecs-2014-11-13/DescribeDaemon) 
+  [Amazon SDK for Python](https://docs.amazonaws.cn/goto/boto3/ecs-2014-11-13/DescribeDaemon) 
+  [Amazon SDK for Ruby V3](https://docs.amazonaws.cn/goto/SdkForRubyV3/ecs-2014-11-13/DescribeDaemon) 

# DescribeDaemonDeployments


Describes one or more of your daemon deployments.

A daemon deployment orchestrates the progressive rollout of daemon task updates across container instances managed by the daemon's capacity providers. Each deployment includes circuit breaker and alarm-based rollback capabilities.

## Request Syntax


```
{
   "daemonDeploymentArns": [ "string" ]
}
```

## Request Parameters


For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [daemonDeploymentArns](#API_DescribeDaemonDeployments_RequestSyntax) **   <a name="ECS-DescribeDaemonDeployments-request-daemonDeploymentArns"></a>
The ARN of the daemon deployments to describe. You can specify up to 20 ARNs.  
Type: Array of strings  
Required: Yes

## Response Syntax


```
{
   "daemonDeployments": [ 
      { 
         "alarms": { 
            "alarmNames": [ "string" ],
            "status": "string",
            "triggeredAlarmNames": [ "string" ]
         },
         "circuitBreaker": { 
            "failureCount": number,
            "status": "string",
            "threshold": number
         },
         "clusterArn": "string",
         "createdAt": number,
         "daemonDeploymentArn": "string",
         "deploymentConfiguration": { 
            "alarms": { 
               "alarmNames": [ "string" ],
               "enable": boolean
            },
            "bakeTimeInMinutes": number,
            "drainPercent": number
         },
         "finishedAt": number,
         "rollback": { 
            "reason": "string",
            "rollbackCapacityProviders": [ "string" ],
            "rollbackTargetDaemonRevisionArn": "string",
            "startedAt": number
         },
         "sourceDaemonRevisions": [ 
            { 
               "arn": "string",
               "capacityProviders": [ 
                  { 
                     "arn": "string",
                     "drainingInstanceCount": number,
                     "runningInstanceCount": number
                  }
               ],
               "totalDrainingInstanceCount": number,
               "totalRunningInstanceCount": number
            }
         ],
         "startedAt": number,
         "status": "string",
         "statusReason": "string",
         "stoppedAt": number,
         "targetDaemonRevision": { 
            "arn": "string",
            "capacityProviders": [ 
               { 
                  "arn": "string",
                  "drainingInstanceCount": number,
                  "runningInstanceCount": number
               }
            ],
            "totalDrainingInstanceCount": number,
            "totalRunningInstanceCount": number
         }
      }
   ],
   "failures": [ 
      { 
         "arn": "string",
         "detail": "string",
         "reason": "string"
      }
   ]
}
```

## 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.

 ** [daemonDeployments](#API_DescribeDaemonDeployments_ResponseSyntax) **   <a name="ECS-DescribeDaemonDeployments-response-daemonDeployments"></a>
The list of daemon deployments.  
Type: Array of [DaemonDeployment](API_DaemonDeployment.md) objects

 ** [failures](#API_DescribeDaemonDeployments_ResponseSyntax) **   <a name="ECS-DescribeDaemonDeployments-response-failures"></a>
Any failures associated with the call.  
Type: Array of [Failure](API_Failure.md) objects

## Errors


For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** AccessDeniedException **   
You don't have authorization to perform the requested action.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ClientException **   
These errors are usually caused by a client action. This client action might be using an action or resource on behalf of a user that doesn't have permissions to use the action or resource. Or, it might be specifying an identifier that isn't valid.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ClusterNotFoundException **   
The specified cluster wasn't found. You can view your available clusters with [ListClusters](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_ListClusters.html). Amazon ECS clusters are Region specific.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** InvalidParameterException **   
The specified parameter isn't valid. Review the available parameters for the API request.  
For more information about service event errors, see [Amazon ECS service event messages](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/service-event-messages-list.html).     
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ServerException **   
These errors are usually caused by a server issue.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 500

 ** UnsupportedFeatureException **   
The specified task isn't supported in this Region.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

## Examples


In the following example or examples, the Authorization header contents (`AUTHPARAMS`) must be replaced with an Amazon Signature Version 4 signature. For more information, see [Signature Version 4 Signing Process](https://docs.amazonaws.cn/general/latest/gr/signature-version-4.html) in the * Amazon General Reference*.

You only need to learn how to sign HTTP requests if you intend to create them manually. When you use the [Amazon Command Line Interface](http://www.amazonaws.cn/cli/) or one of the [Amazon SDKs](http://www.amazonaws.cn/tools/) to make requests to Amazon, these tools automatically sign the requests for you, with the access key that you specify when you configure the tools. When you use these tools, you don't have to sign requests yourself.

### Example


This example describes a daemon deployment for the my-monitoring-daemon daemon.

#### Sample Request


```
POST / HTTP/1.1
Host: ecs.us-east-1.amazonaws.com
Accept-Encoding: identity
Content-Length: 143
X-Amz-Target: AmazonEC2ContainerServiceV20141113.DescribeDaemonDeployments
X-Amz-Date: 20250320T161500Z
Content-Type: application/x-amz-json-1.1
Authorization: AUTHPARAMS

{
  "daemonDeploymentArns": [
    "arn:aws:ecs:us-east-1:123456789012:daemon-deployment/my-cluster/my-monitoring-daemon/aB1cD2eF3gH4iJ5k"
  ]
}
```

#### Sample Response


```
HTTP/1.1 200 OK
Server: Server
Date: Thu, 20 Mar 2025 16:15:00 GMT
Content-Type: application/x-amz-json-1.1
Content-Length: 1455
Connection: keep-alive
x-amzn-RequestId: 123a4b56-7c89-01d2-3ef4-example5678f

{
  "daemonDeployments": [
    {
      "daemonDeploymentArn": "arn:aws:ecs:us-east-1:123456789012:daemon-deployment/my-cluster/my-monitoring-daemon/aB1cD2eF3gH4iJ5k",
      "clusterArn": "arn:aws:ecs:us-east-1:123456789012:cluster/my-cluster",
      "status": "SUCCESSFUL",
      "statusReason": "Deployment completed successfully.",
      "targetDaemonRevision": {
        "arn": "arn:aws:ecs:us-east-1:123456789012:daemon-revision/my-cluster/my-monitoring-daemon/4980306466373577095",
        "capacityProviders": [
          {
            "arn": "arn:aws:ecs:us-east-1:123456789012:capacity-provider/my-capacity-provider",
            "runningInstanceCount": 3,
            "drainingInstanceCount": 0
          }
        ],
        "totalRunningInstanceCount": 3,
        "totalDrainingInstanceCount": 0
      },
      "sourceDaemonRevisions": [],
      "circuitBreaker": {
        "failureCount": 0,
        "status": "MONITORING_COMPLETE",
        "threshold": 10
      },
      "alarms": {
        "status": "DISABLED",
        "alarmNames": [],
        "triggeredAlarmNames": []
      },
      "deploymentConfiguration": {
        "drainPercent": 10.0,
        "bakeTimeInMinutes": 5,
        "alarms": {
          "alarmNames": [],
          "enable": false
        }
      },
      "createdAt": "2025-03-15T12:00:00.000Z",
      "startedAt": "2025-03-15T12:00:05.000Z",
      "finishedAt": "2025-03-15T12:15:00.000Z"
    }
  ],
  "failures": []
}
```

## See Also


For more information about using this API in one of the language-specific Amazon SDKs, see the following:
+  [Amazon Command Line Interface V2](https://docs.amazonaws.cn/goto/cli2/ecs-2014-11-13/DescribeDaemonDeployments) 
+  [Amazon SDK for .NET V4](https://docs.amazonaws.cn/goto/DotNetSDKV4/ecs-2014-11-13/DescribeDaemonDeployments) 
+  [Amazon SDK for C\$1\$1](https://docs.amazonaws.cn/goto/SdkForCpp/ecs-2014-11-13/DescribeDaemonDeployments) 
+  [Amazon SDK for Go v2](https://docs.amazonaws.cn/goto/SdkForGoV2/ecs-2014-11-13/DescribeDaemonDeployments) 
+  [Amazon SDK for Java V2](https://docs.amazonaws.cn/goto/SdkForJavaV2/ecs-2014-11-13/DescribeDaemonDeployments) 
+  [Amazon SDK for JavaScript V3](https://docs.amazonaws.cn/goto/SdkForJavaScriptV3/ecs-2014-11-13/DescribeDaemonDeployments) 
+  [Amazon SDK for Kotlin](https://docs.amazonaws.cn/goto/SdkForKotlin/ecs-2014-11-13/DescribeDaemonDeployments) 
+  [Amazon SDK for PHP V3](https://docs.amazonaws.cn/goto/SdkForPHPV3/ecs-2014-11-13/DescribeDaemonDeployments) 
+  [Amazon SDK for Python](https://docs.amazonaws.cn/goto/boto3/ecs-2014-11-13/DescribeDaemonDeployments) 
+  [Amazon SDK for Ruby V3](https://docs.amazonaws.cn/goto/SdkForRubyV3/ecs-2014-11-13/DescribeDaemonDeployments) 

# DescribeDaemonRevisions


Describes one or more of your daemon revisions.

A daemon revision is a snapshot of a daemon's configuration at the time a deployment was initiated. It captures the daemon task definition, container images, tag propagation, and execute command settings. Daemon revisions are immutable.

## Request Syntax


```
{
   "daemonRevisionArns": [ "string" ]
}
```

## Request Parameters


For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [daemonRevisionArns](#API_DescribeDaemonRevisions_RequestSyntax) **   <a name="ECS-DescribeDaemonRevisions-request-daemonRevisionArns"></a>
The ARN of the daemon revisions to describe. You can specify up to 20 ARNs.  
Type: Array of strings  
Required: Yes

## Response Syntax


```
{
   "daemonRevisions": [ 
      { 
         "clusterArn": "string",
         "containerImages": [ 
            { 
               "containerName": "string",
               "image": "string",
               "imageDigest": "string"
            }
         ],
         "createdAt": number,
         "daemonArn": "string",
         "daemonRevisionArn": "string",
         "daemonTaskDefinitionArn": "string",
         "enableECSManagedTags": boolean,
         "enableExecuteCommand": boolean,
         "propagateTags": "string"
      }
   ],
   "failures": [ 
      { 
         "arn": "string",
         "detail": "string",
         "reason": "string"
      }
   ]
}
```

## 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.

 ** [daemonRevisions](#API_DescribeDaemonRevisions_ResponseSyntax) **   <a name="ECS-DescribeDaemonRevisions-response-daemonRevisions"></a>
The list of daemon revisions.  
Type: Array of [DaemonRevision](API_DaemonRevision.md) objects

 ** [failures](#API_DescribeDaemonRevisions_ResponseSyntax) **   <a name="ECS-DescribeDaemonRevisions-response-failures"></a>
Any failures associated with the call.  
Type: Array of [Failure](API_Failure.md) objects

## Errors


For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** AccessDeniedException **   
You don't have authorization to perform the requested action.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ClientException **   
These errors are usually caused by a client action. This client action might be using an action or resource on behalf of a user that doesn't have permissions to use the action or resource. Or, it might be specifying an identifier that isn't valid.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ClusterNotFoundException **   
The specified cluster wasn't found. You can view your available clusters with [ListClusters](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_ListClusters.html). Amazon ECS clusters are Region specific.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** InvalidParameterException **   
The specified parameter isn't valid. Review the available parameters for the API request.  
For more information about service event errors, see [Amazon ECS service event messages](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/service-event-messages-list.html).     
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ServerException **   
These errors are usually caused by a server issue.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 500

 ** UnsupportedFeatureException **   
The specified task isn't supported in this Region.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

## Examples


In the following example or examples, the Authorization header contents (`AUTHPARAMS`) must be replaced with an Amazon Signature Version 4 signature. For more information, see [Signature Version 4 Signing Process](https://docs.amazonaws.cn/general/latest/gr/signature-version-4.html) in the * Amazon General Reference*.

You only need to learn how to sign HTTP requests if you intend to create them manually. When you use the [Amazon Command Line Interface](http://www.amazonaws.cn/cli/) or one of the [Amazon SDKs](http://www.amazonaws.cn/tools/) to make requests to Amazon, these tools automatically sign the requests for you, with the access key that you specify when you configure the tools. When you use these tools, you don't have to sign requests yourself.

### Example


This example describes a daemon revision for the my-monitoring-daemon daemon.

#### Sample Request


```
POST / HTTP/1.1
Host: ecs.us-east-1.amazonaws.com
Accept-Encoding: identity
Content-Length: 142
X-Amz-Target: AmazonEC2ContainerServiceV20141113.DescribeDaemonRevisions
X-Amz-Date: 20250320T161000Z
Content-Type: application/x-amz-json-1.1
Authorization: AUTHPARAMS

{
  "daemonRevisionArns": [
    "arn:aws:ecs:us-east-1:123456789012:daemon-revision/my-cluster/my-monitoring-daemon/4980306466373577095"
  ]
}
```

#### Sample Response


```
HTTP/1.1 200 OK
Server: Server
Date: Thu, 20 Mar 2025 16:10:00 GMT
Content-Type: application/x-amz-json-1.1
Content-Length: 910
Connection: keep-alive
x-amzn-RequestId: 123a4b56-7c89-01d2-3ef4-example5678f

{
  "daemonRevisions": [
    {
      "daemonRevisionArn": "arn:aws:ecs:us-east-1:123456789012:daemon-revision/my-cluster/my-monitoring-daemon/4980306466373577095",
      "clusterArn": "arn:aws:ecs:us-east-1:123456789012:cluster/my-cluster",
      "daemonArn": "arn:aws:ecs:us-east-1:123456789012:daemon/my-cluster/my-monitoring-daemon",
      "daemonTaskDefinitionArn": "arn:aws:ecs:us-east-1:123456789012:daemon-task-definition/monitoring-agent:1",
      "createdAt": "2025-03-15T12:00:00.000Z",
      "containerImages": [
        {
          "containerName": "cloudwatch-agent",
          "imageDigest": "sha256:a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2",
          "image": "public.ecr.aws/cloudwatch-agent/cloudwatch-agent:latest"
        }
      ],
      "propagateTags": "NONE",
      "enableECSManagedTags": false,
      "enableExecuteCommand": false
    }
  ],
  "failures": []
}
```

## See Also


For more information about using this API in one of the language-specific Amazon SDKs, see the following:
+  [Amazon Command Line Interface V2](https://docs.amazonaws.cn/goto/cli2/ecs-2014-11-13/DescribeDaemonRevisions) 
+  [Amazon SDK for .NET V4](https://docs.amazonaws.cn/goto/DotNetSDKV4/ecs-2014-11-13/DescribeDaemonRevisions) 
+  [Amazon SDK for C\$1\$1](https://docs.amazonaws.cn/goto/SdkForCpp/ecs-2014-11-13/DescribeDaemonRevisions) 
+  [Amazon SDK for Go v2](https://docs.amazonaws.cn/goto/SdkForGoV2/ecs-2014-11-13/DescribeDaemonRevisions) 
+  [Amazon SDK for Java V2](https://docs.amazonaws.cn/goto/SdkForJavaV2/ecs-2014-11-13/DescribeDaemonRevisions) 
+  [Amazon SDK for JavaScript V3](https://docs.amazonaws.cn/goto/SdkForJavaScriptV3/ecs-2014-11-13/DescribeDaemonRevisions) 
+  [Amazon SDK for Kotlin](https://docs.amazonaws.cn/goto/SdkForKotlin/ecs-2014-11-13/DescribeDaemonRevisions) 
+  [Amazon SDK for PHP V3](https://docs.amazonaws.cn/goto/SdkForPHPV3/ecs-2014-11-13/DescribeDaemonRevisions) 
+  [Amazon SDK for Python](https://docs.amazonaws.cn/goto/boto3/ecs-2014-11-13/DescribeDaemonRevisions) 
+  [Amazon SDK for Ruby V3](https://docs.amazonaws.cn/goto/SdkForRubyV3/ecs-2014-11-13/DescribeDaemonRevisions) 

# DescribeDaemonTaskDefinition


Describes a daemon task definition. You can specify a `family` and `revision` to find information about a specific daemon task definition, or you can simply specify the family to find the latest `ACTIVE` revision in that family.

## Request Syntax


```
{
   "daemonTaskDefinition": "string"
}
```

## Request Parameters


For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [daemonTaskDefinition](#API_DescribeDaemonTaskDefinition_RequestSyntax) **   <a name="ECS-DescribeDaemonTaskDefinition-request-daemonTaskDefinition"></a>
The `family` for the latest `ACTIVE` revision, `family` and `revision` (`family:revision`) for a specific revision in the family, or full Amazon Resource Name (ARN) of the daemon task definition to describe.  
Type: String  
Required: Yes

## Response Syntax


```
{
   "daemonTaskDefinition": { 
      "containerDefinitions": [ 
         { 
            "command": [ "string" ],
            "cpu": number,
            "dependsOn": [ 
               { 
                  "condition": "string",
                  "containerName": "string"
               }
            ],
            "entryPoint": [ "string" ],
            "environment": [ 
               { 
                  "name": "string",
                  "value": "string"
               }
            ],
            "environmentFiles": [ 
               { 
                  "type": "string",
                  "value": "string"
               }
            ],
            "essential": boolean,
            "firelensConfiguration": { 
               "options": { 
                  "string" : "string" 
               },
               "type": "string"
            },
            "healthCheck": { 
               "command": [ "string" ],
               "interval": number,
               "retries": number,
               "startPeriod": number,
               "timeout": number
            },
            "image": "string",
            "interactive": boolean,
            "linuxParameters": { 
               "capabilities": { 
                  "add": [ "string" ],
                  "drop": [ "string" ]
               },
               "devices": [ 
                  { 
                     "containerPath": "string",
                     "hostPath": "string",
                     "permissions": [ "string" ]
                  }
               ],
               "initProcessEnabled": boolean,
               "tmpfs": [ 
                  { 
                     "containerPath": "string",
                     "mountOptions": [ "string" ],
                     "size": number
                  }
               ]
            },
            "logConfiguration": { 
               "logDriver": "string",
               "options": { 
                  "string" : "string" 
               },
               "secretOptions": [ 
                  { 
                     "name": "string",
                     "valueFrom": "string"
                  }
               ]
            },
            "memory": number,
            "memoryReservation": number,
            "mountPoints": [ 
               { 
                  "containerPath": "string",
                  "readOnly": boolean,
                  "sourceVolume": "string"
               }
            ],
            "name": "string",
            "privileged": boolean,
            "pseudoTerminal": boolean,
            "readonlyRootFilesystem": boolean,
            "repositoryCredentials": { 
               "credentialsParameter": "string"
            },
            "restartPolicy": { 
               "enabled": boolean,
               "ignoredExitCodes": [ number ],
               "restartAttemptPeriod": number
            },
            "secrets": [ 
               { 
                  "name": "string",
                  "valueFrom": "string"
               }
            ],
            "startTimeout": number,
            "stopTimeout": number,
            "systemControls": [ 
               { 
                  "namespace": "string",
                  "value": "string"
               }
            ],
            "ulimits": [ 
               { 
                  "hardLimit": number,
                  "name": "string",
                  "softLimit": number
               }
            ],
            "user": "string",
            "workingDirectory": "string"
         }
      ],
      "cpu": "string",
      "daemonTaskDefinitionArn": "string",
      "deleteRequestedAt": number,
      "executionRoleArn": "string",
      "family": "string",
      "memory": "string",
      "registeredAt": number,
      "registeredBy": "string",
      "revision": number,
      "status": "string",
      "taskRoleArn": "string",
      "volumes": [ 
         { 
            "host": { 
               "sourcePath": "string"
            },
            "name": "string"
         }
      ]
   }
}
```

## 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.

 ** [daemonTaskDefinition](#API_DescribeDaemonTaskDefinition_ResponseSyntax) **   <a name="ECS-DescribeDaemonTaskDefinition-response-daemonTaskDefinition"></a>
The full daemon task definition description.  
Type: [DaemonTaskDefinition](API_DaemonTaskDefinition.md) object

## Errors


For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** AccessDeniedException **   
You don't have authorization to perform the requested action.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ClientException **   
These errors are usually caused by a client action. This client action might be using an action or resource on behalf of a user that doesn't have permissions to use the action or resource. Or, it might be specifying an identifier that isn't valid.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** InvalidParameterException **   
The specified parameter isn't valid. Review the available parameters for the API request.  
For more information about service event errors, see [Amazon ECS service event messages](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/service-event-messages-list.html).     
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ServerException **   
These errors are usually caused by a server issue.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 500

## Examples


In the following example or examples, the Authorization header contents (`AUTHPARAMS`) must be replaced with an Amazon Signature Version 4 signature. For more information, see [Signature Version 4 Signing Process](https://docs.amazonaws.cn/general/latest/gr/signature-version-4.html) in the * Amazon General Reference*.

You only need to learn how to sign HTTP requests if you intend to create them manually. When you use the [Amazon Command Line Interface](http://www.amazonaws.cn/cli/) or one of the [Amazon SDKs](http://www.amazonaws.cn/tools/) to make requests to Amazon, these tools automatically sign the requests for you, with the access key that you specify when you configure the tools. When you use these tools, you don't have to sign requests yourself.

### Example


This example describes the first revision of the monitoring-agent daemon task definition.

#### Sample Request


```
POST / HTTP/1.1
Host: ecs.us-east-1.amazonaws.com
Accept-Encoding: identity
X-Amz-Target: AmazonEC2ContainerServiceV20141113.DescribeDaemonTaskDefinition
X-Amz-Date: 20250315T103000Z
Content-Type: application/x-amz-json-1.1
Authorization: AUTHPARAMS

{
  "daemonTaskDefinition": "monitoring-agent:1"
}
```

#### Sample Response


```
HTTP/1.1 200 OK
Server: Server
Date: Sat, 15 Mar 2025 10:30:00 GMT
Content-Type: application/x-amz-json-1.1
Content-Length: 679
Connection: keep-alive
x-amzn-RequestId: 123a4b56-7c89-01d2-3ef4-example5678f

{
  "daemonTaskDefinition": {
    "daemonTaskDefinitionArn": "arn:aws:ecs:us-east-1:123456789012:daemon-task-definition/monitoring-agent:1",
    "family": "monitoring-agent",
    "revision": 1,
    "containerDefinitions": [
      {
        "name": "cloudwatch-agent",
        "image": "public.ecr.aws/cloudwatch-agent/cloudwatch-agent:latest",
        "memory": 256,
        "cpu": 128,
        "essential": true,
        "logConfiguration": {
          "logDriver": "awslogs",
          "options": {
            "awslogs-group": "/ecs/daemon/monitoring-agent",
            "awslogs-region": "us-east-1",
            "awslogs-stream-prefix": "ecs"
          }
        },
        "environment": [
          {
            "name": "USE_DEFAULT_CONFIG",
            "value": "true"
          }
        ],
        "mountPoints": [],
        "secrets": []
      }
    ],
    "cpu": "128",
    "memory": "256",
    "executionRoleArn": "arn:aws:iam::123456789012:role/ecsTaskExecutionRole",
    "taskRoleArn": "arn:aws:iam::123456789012:role/ecsDaemonTaskRole",
    "volumes": [],
    "status": "ACTIVE",
    "registeredAt": "2025-03-15T10:30:00.000Z",
    "registeredBy": "arn:aws:iam::123456789012:user/admin"
  }
}
```

## See Also


For more information about using this API in one of the language-specific Amazon SDKs, see the following:
+  [Amazon Command Line Interface V2](https://docs.amazonaws.cn/goto/cli2/ecs-2014-11-13/DescribeDaemonTaskDefinition) 
+  [Amazon SDK for .NET V4](https://docs.amazonaws.cn/goto/DotNetSDKV4/ecs-2014-11-13/DescribeDaemonTaskDefinition) 
+  [Amazon SDK for C\$1\$1](https://docs.amazonaws.cn/goto/SdkForCpp/ecs-2014-11-13/DescribeDaemonTaskDefinition) 
+  [Amazon SDK for Go v2](https://docs.amazonaws.cn/goto/SdkForGoV2/ecs-2014-11-13/DescribeDaemonTaskDefinition) 
+  [Amazon SDK for Java V2](https://docs.amazonaws.cn/goto/SdkForJavaV2/ecs-2014-11-13/DescribeDaemonTaskDefinition) 
+  [Amazon SDK for JavaScript V3](https://docs.amazonaws.cn/goto/SdkForJavaScriptV3/ecs-2014-11-13/DescribeDaemonTaskDefinition) 
+  [Amazon SDK for Kotlin](https://docs.amazonaws.cn/goto/SdkForKotlin/ecs-2014-11-13/DescribeDaemonTaskDefinition) 
+  [Amazon SDK for PHP V3](https://docs.amazonaws.cn/goto/SdkForPHPV3/ecs-2014-11-13/DescribeDaemonTaskDefinition) 
+  [Amazon SDK for Python](https://docs.amazonaws.cn/goto/boto3/ecs-2014-11-13/DescribeDaemonTaskDefinition) 
+  [Amazon SDK for Ruby V3](https://docs.amazonaws.cn/goto/SdkForRubyV3/ecs-2014-11-13/DescribeDaemonTaskDefinition) 

# DescribeExpressGatewayService


Retrieves detailed information about an Express service, including current status, configuration, managed infrastructure, and service revisions.

Returns comprehensive service details, active service revisions, ingress paths with endpoints, and managed Amazon resource status including load balancers and auto-scaling policies.

Use the `include` parameter to retrieve additional information such as resource tags.

## Request Syntax


```
{
   "include": [ "string" ],
   "serviceArn": "string"
}
```

## Request Parameters


For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [include](#API_DescribeExpressGatewayService_RequestSyntax) **   <a name="ECS-DescribeExpressGatewayService-request-include"></a>
Specifies additional information to include in the response. Valid values are `TAGS` to include resource tags associated with the Express service.  
Type: Array of strings  
Valid Values: `TAGS`   
Required: No

 ** [serviceArn](#API_DescribeExpressGatewayService_RequestSyntax) **   <a name="ECS-DescribeExpressGatewayService-request-serviceArn"></a>
The Amazon Resource Name (ARN) of the Express service to describe. The ARN uniquely identifies the service within your Amazon account and region.  
Type: String  
Required: Yes

## Response Syntax


```
{
   "service": { 
      "activeConfigurations": [ 
         { 
            "cpu": "string",
            "createdAt": number,
            "executionRoleArn": "string",
            "healthCheckPath": "string",
            "ingressPaths": [ 
               { 
                  "accessType": "string",
                  "endpoint": "string"
               }
            ],
            "memory": "string",
            "networkConfiguration": { 
               "securityGroups": [ "string" ],
               "subnets": [ "string" ]
            },
            "primaryContainer": { 
               "awsLogsConfiguration": { 
                  "logGroup": "string",
                  "logStreamPrefix": "string"
               },
               "command": [ "string" ],
               "containerPort": number,
               "environment": [ 
                  { 
                     "name": "string",
                     "value": "string"
                  }
               ],
               "image": "string",
               "repositoryCredentials": { 
                  "credentialsParameter": "string"
               },
               "secrets": [ 
                  { 
                     "name": "string",
                     "valueFrom": "string"
                  }
               ]
            },
            "scalingTarget": { 
               "autoScalingMetric": "string",
               "autoScalingTargetValue": number,
               "maxTaskCount": number,
               "minTaskCount": number
            },
            "serviceRevisionArn": "string",
            "taskRoleArn": "string"
         }
      ],
      "cluster": "string",
      "createdAt": number,
      "currentDeployment": "string",
      "infrastructureRoleArn": "string",
      "serviceArn": "string",
      "serviceName": "string",
      "status": { 
         "statusCode": "string",
         "statusReason": "string"
      },
      "tags": [ 
         { 
            "key": "string",
            "value": "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.

 ** [service](#API_DescribeExpressGatewayService_ResponseSyntax) **   <a name="ECS-DescribeExpressGatewayService-response-service"></a>
The full description of the described express service.  
Type: [ECSExpressGatewayService](API_ECSExpressGatewayService.md) object

## Errors


For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** AccessDeniedException **   
You don't have authorization to perform the requested action.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ClientException **   
These errors are usually caused by a client action. This client action might be using an action or resource on behalf of a user that doesn't have permissions to use the action or resource. Or, it might be specifying an identifier that isn't valid.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ClusterNotFoundException **   
The specified cluster wasn't found. You can view your available clusters with [ListClusters](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_ListClusters.html). Amazon ECS clusters are Region specific.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** InvalidParameterException **   
The specified parameter isn't valid. Review the available parameters for the API request.  
For more information about service event errors, see [Amazon ECS service event messages](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/service-event-messages-list.html).     
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ResourceNotFoundException **   
The specified resource wasn't found.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ServerException **   
These errors are usually caused by a server issue.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 500

 ** UnsupportedFeatureException **   
The specified task isn't supported in this Region.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

## See Also


For more information about using this API in one of the language-specific Amazon SDKs, see the following:
+  [Amazon Command Line Interface V2](https://docs.amazonaws.cn/goto/cli2/ecs-2014-11-13/DescribeExpressGatewayService) 
+  [Amazon SDK for .NET V4](https://docs.amazonaws.cn/goto/DotNetSDKV4/ecs-2014-11-13/DescribeExpressGatewayService) 
+  [Amazon SDK for C\$1\$1](https://docs.amazonaws.cn/goto/SdkForCpp/ecs-2014-11-13/DescribeExpressGatewayService) 
+  [Amazon SDK for Go v2](https://docs.amazonaws.cn/goto/SdkForGoV2/ecs-2014-11-13/DescribeExpressGatewayService) 
+  [Amazon SDK for Java V2](https://docs.amazonaws.cn/goto/SdkForJavaV2/ecs-2014-11-13/DescribeExpressGatewayService) 
+  [Amazon SDK for JavaScript V3](https://docs.amazonaws.cn/goto/SdkForJavaScriptV3/ecs-2014-11-13/DescribeExpressGatewayService) 
+  [Amazon SDK for Kotlin](https://docs.amazonaws.cn/goto/SdkForKotlin/ecs-2014-11-13/DescribeExpressGatewayService) 
+  [Amazon SDK for PHP V3](https://docs.amazonaws.cn/goto/SdkForPHPV3/ecs-2014-11-13/DescribeExpressGatewayService) 
+  [Amazon SDK for Python](https://docs.amazonaws.cn/goto/boto3/ecs-2014-11-13/DescribeExpressGatewayService) 
+  [Amazon SDK for Ruby V3](https://docs.amazonaws.cn/goto/SdkForRubyV3/ecs-2014-11-13/DescribeExpressGatewayService) 

# DescribeServiceDeployments


Describes one or more of your service deployments.

A service deployment happens when you release a software update for the service. For more information, see [View service history using Amazon ECS service deployments](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/service-deployment.html).

## Request Syntax


```
{
   "serviceDeploymentArns": [ "string" ]
}
```

## Request Parameters


For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [serviceDeploymentArns](#API_DescribeServiceDeployments_RequestSyntax) **   <a name="ECS-DescribeServiceDeployments-request-serviceDeploymentArns"></a>
The ARN of the service deployment.  
You can specify a maximum of 20 ARNs.  
Type: Array of strings  
Required: Yes

## Response Syntax


```
{
   "failures": [ 
      { 
         "arn": "string",
         "detail": "string",
         "reason": "string"
      }
   ],
   "serviceDeployments": [ 
      { 
         "alarms": { 
            "alarmNames": [ "string" ],
            "status": "string",
            "triggeredAlarmNames": [ "string" ]
         },
         "clusterArn": "string",
         "createdAt": number,
         "deploymentCircuitBreaker": { 
            "failureCount": number,
            "status": "string",
            "threshold": number
         },
         "deploymentConfiguration": { 
            "alarms": { 
               "alarmNames": [ "string" ],
               "enable": boolean,
               "rollback": boolean
            },
            "bakeTimeInMinutes": number,
            "canaryConfiguration": { 
               "canaryBakeTimeInMinutes": number,
               "canaryPercent": number
            },
            "deploymentCircuitBreaker": { 
               "enable": boolean,
               "rollback": boolean
            },
            "lifecycleHooks": [ 
               { 
                  "hookDetails": JSON value,
                  "hookTargetArn": "string",
                  "lifecycleStages": [ "string" ],
                  "roleArn": "string"
               }
            ],
            "linearConfiguration": { 
               "stepBakeTimeInMinutes": number,
               "stepPercent": number
            },
            "maximumPercent": number,
            "minimumHealthyPercent": number,
            "strategy": "string"
         },
         "finishedAt": number,
         "lifecycleStage": "string",
         "rollback": { 
            "reason": "string",
            "serviceRevisionArn": "string",
            "startedAt": number
         },
         "serviceArn": "string",
         "serviceDeploymentArn": "string",
         "sourceServiceRevisions": [ 
            { 
               "arn": "string",
               "pendingTaskCount": number,
               "requestedProductionTrafficWeight": number,
               "requestedTaskCount": number,
               "requestedTestTrafficWeight": number,
               "runningTaskCount": number
            }
         ],
         "startedAt": number,
         "status": "string",
         "statusReason": "string",
         "stoppedAt": number,
         "targetServiceRevision": { 
            "arn": "string",
            "pendingTaskCount": number,
            "requestedProductionTrafficWeight": number,
            "requestedTaskCount": number,
            "requestedTestTrafficWeight": number,
            "runningTaskCount": number
         },
         "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.

 ** [failures](#API_DescribeServiceDeployments_ResponseSyntax) **   <a name="ECS-DescribeServiceDeployments-response-failures"></a>
Any failures associated with the call.  
If you decsribe a deployment with a service revision created before October 25, 2024, the call fails. The failure includes the service revision ARN and the reason set to `MISSING`.  
Type: Array of [Failure](API_Failure.md) objects

 ** [serviceDeployments](#API_DescribeServiceDeployments_ResponseSyntax) **   <a name="ECS-DescribeServiceDeployments-response-serviceDeployments"></a>
The list of service deployments described.  
Type: Array of [ServiceDeployment](API_ServiceDeployment.md) objects

## Errors


For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** AccessDeniedException **   
You don't have authorization to perform the requested action.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ClientException **   
These errors are usually caused by a client action. This client action might be using an action or resource on behalf of a user that doesn't have permissions to use the action or resource. Or, it might be specifying an identifier that isn't valid.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ClusterNotFoundException **   
The specified cluster wasn't found. You can view your available clusters with [ListClusters](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_ListClusters.html). Amazon ECS clusters are Region specific.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** InvalidParameterException **   
The specified parameter isn't valid. Review the available parameters for the API request.  
For more information about service event errors, see [Amazon ECS service event messages](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/service-event-messages-list.html).     
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ServerException **   
These errors are usually caused by a server issue.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 500

 ** ServiceNotFoundException **   
The specified service wasn't found. You can view your available services with [ListServices](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_ListServices.html). Amazon ECS services are cluster specific and Region specific.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** UnsupportedFeatureException **   
The specified task isn't supported in this Region.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

## Examples


### Example


This example request provides a full description of the service deployments for the `sd-example` service on the `example` cluster.

#### Sample Request


```
POST / HTTP/1.1
Host: ecs.us-west-2.amazonaws.com
Accept-Encoding: identity
Content-Length: 55
X-Amz-Target: AmazonEC2ContainerServiceV20141113.DescribeServiceDeployments
X-Amz-Date: 20150528T163859Z
User-Agent: aws-cli/2.17 Python/3.11.9 Darwin/14.3.0
Content-Type: application/x-amz-json-1.1
Authorization: AUTHPARAMS

{

  "serviceDeploymentArn": "arn:aws:ecs:us-west-2:123456789012:service-deployment/example/sd-example/NCWGC2ZR-taawPAYrIaU5"
}
```

#### Sample Response


```
HTTP/1.1 200 OK
Server: Server
Date: Tue, 10 Sep 2024 18:50:14 GMT
Content-Type: application/x-amz-json-1.1
Content-Length: 220
Connection: keep-alive
RequestId: 360c5551-123e-4e74-9914-7582d3a28807
{
    "serviceDeployments": [
        {
            "serviceDeploymentArn": "arn:aws:ecs:us-west-2:123456789012:service-deployment/example/sd-example/NCWGC2ZR-taawPAYrIaU5",
            "serviceArn": "arn:aws:ecs:us-west-2:123456789012:service/example/sd-example",
            "clusterArn": "arn:aws:ecs:us-west-2:123456789012:cluster/example",
            "updatedAt": "2024-09-10T16:49:35.57Z",
            "targetServiceRevision": {
                "arn": "arn:aws:ecs:us-west-2:123456789012:service-revision/example/sd-example/4980306466373577095",
                "requestedTaskCount": 0,
                "runningTaskCount": 0,
                "pendingTaskCount": 0
            },
            "status": "PENDING",
            "deploymentConfiguration": {
                "deploymentCircuitBreaker": {
                    "enable": false,
                    "rollback": false
                },
                "maximumPercent": 200,
                "minimumHealthyPercent": 100
            }
        }
    ],
    "failures": []
}
```

## See Also


For more information about using this API in one of the language-specific Amazon SDKs, see the following:
+  [Amazon Command Line Interface V2](https://docs.amazonaws.cn/goto/cli2/ecs-2014-11-13/DescribeServiceDeployments) 
+  [Amazon SDK for .NET V4](https://docs.amazonaws.cn/goto/DotNetSDKV4/ecs-2014-11-13/DescribeServiceDeployments) 
+  [Amazon SDK for C\$1\$1](https://docs.amazonaws.cn/goto/SdkForCpp/ecs-2014-11-13/DescribeServiceDeployments) 
+  [Amazon SDK for Go v2](https://docs.amazonaws.cn/goto/SdkForGoV2/ecs-2014-11-13/DescribeServiceDeployments) 
+  [Amazon SDK for Java V2](https://docs.amazonaws.cn/goto/SdkForJavaV2/ecs-2014-11-13/DescribeServiceDeployments) 
+  [Amazon SDK for JavaScript V3](https://docs.amazonaws.cn/goto/SdkForJavaScriptV3/ecs-2014-11-13/DescribeServiceDeployments) 
+  [Amazon SDK for Kotlin](https://docs.amazonaws.cn/goto/SdkForKotlin/ecs-2014-11-13/DescribeServiceDeployments) 
+  [Amazon SDK for PHP V3](https://docs.amazonaws.cn/goto/SdkForPHPV3/ecs-2014-11-13/DescribeServiceDeployments) 
+  [Amazon SDK for Python](https://docs.amazonaws.cn/goto/boto3/ecs-2014-11-13/DescribeServiceDeployments) 
+  [Amazon SDK for Ruby V3](https://docs.amazonaws.cn/goto/SdkForRubyV3/ecs-2014-11-13/DescribeServiceDeployments) 

# DescribeServiceRevisions


Describes one or more service revisions.

A service revision is a version of the service that includes the values for the Amazon ECS resources (for example, task definition) and the environment resources (for example, load balancers, subnets, and security groups). For more information, see [Amazon ECS service revisions](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/service-revision.html).

You can't describe a service revision that was created before October 25, 2024.

## Request Syntax


```
{
   "serviceRevisionArns": [ "string" ]
}
```

## Request Parameters


For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [serviceRevisionArns](#API_DescribeServiceRevisions_RequestSyntax) **   <a name="ECS-DescribeServiceRevisions-request-serviceRevisionArns"></a>
The ARN of the service revision.   
You can specify a maximum of 20 ARNs.  
You can call [ListServiceDeployments](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_ListServiceDeployments.html) to get the ARNs.  
Type: Array of strings  
Required: Yes

## Response Syntax


```
{
   "failures": [ 
      { 
         "arn": "string",
         "detail": "string",
         "reason": "string"
      }
   ],
   "serviceRevisions": [ 
      { 
         "capacityProviderStrategy": [ 
            { 
               "base": number,
               "capacityProvider": "string",
               "weight": number
            }
         ],
         "clusterArn": "string",
         "containerImages": [ 
            { 
               "containerName": "string",
               "image": "string",
               "imageDigest": "string"
            }
         ],
         "createdAt": number,
         "ecsManagedResources": { 
            "autoScaling": { 
               "applicationAutoScalingPolicies": [ 
                  { 
                     "arn": "string",
                     "metric": "string",
                     "policyType": "string",
                     "status": "string",
                     "statusReason": "string",
                     "targetValue": number,
                     "updatedAt": number
                  }
               ],
               "scalableTarget": { 
                  "arn": "string",
                  "maxCapacity": number,
                  "minCapacity": number,
                  "status": "string",
                  "statusReason": "string",
                  "updatedAt": number
               }
            },
            "ingressPaths": [ 
               { 
                  "accessType": "string",
                  "certificate": { 
                     "arn": "string",
                     "domainName": "string",
                     "status": "string",
                     "statusReason": "string",
                     "updatedAt": number
                  },
                  "endpoint": "string",
                  "listener": { 
                     "arn": "string",
                     "status": "string",
                     "statusReason": "string",
                     "updatedAt": number
                  },
                  "loadBalancer": { 
                     "arn": "string",
                     "scheme": "string",
                     "securityGroupIds": [ "string" ],
                     "status": "string",
                     "statusReason": "string",
                     "subnetIds": [ "string" ],
                     "updatedAt": number
                  },
                  "loadBalancerSecurityGroups": [ 
                     { 
                        "arn": "string",
                        "status": "string",
                        "statusReason": "string",
                        "updatedAt": number
                     }
                  ],
                  "rule": { 
                     "arn": "string",
                     "status": "string",
                     "statusReason": "string",
                     "updatedAt": number
                  },
                  "targetGroups": [ 
                     { 
                        "arn": "string",
                        "healthCheckPath": "string",
                        "healthCheckPort": number,
                        "port": number,
                        "status": "string",
                        "statusReason": "string",
                        "updatedAt": number
                     }
                  ]
               }
            ],
            "logGroups": [ 
               { 
                  "arn": "string",
                  "logGroupName": "string",
                  "status": "string",
                  "statusReason": "string",
                  "updatedAt": number
               }
            ],
            "metricAlarms": [ 
               { 
                  "arn": "string",
                  "status": "string",
                  "statusReason": "string",
                  "updatedAt": number
               }
            ],
            "serviceSecurityGroups": [ 
               { 
                  "arn": "string",
                  "status": "string",
                  "statusReason": "string",
                  "updatedAt": number
               }
            ]
         },
         "fargateEphemeralStorage": { 
            "kmsKeyId": "string"
         },
         "guardDutyEnabled": boolean,
         "launchType": "string",
         "loadBalancers": [ 
            { 
               "advancedConfiguration": { 
                  "alternateTargetGroupArn": "string",
                  "productionListenerRule": "string",
                  "roleArn": "string",
                  "testListenerRule": "string"
               },
               "containerName": "string",
               "containerPort": number,
               "loadBalancerName": "string",
               "targetGroupArn": "string"
            }
         ],
         "networkConfiguration": { 
            "awsvpcConfiguration": { 
               "assignPublicIp": "string",
               "securityGroups": [ "string" ],
               "subnets": [ "string" ]
            }
         },
         "platformFamily": "string",
         "platformVersion": "string",
         "resolvedConfiguration": { 
            "loadBalancers": [ 
               { 
                  "productionListenerRule": "string",
                  "targetGroupArn": "string"
               }
            ]
         },
         "serviceArn": "string",
         "serviceConnectConfiguration": { 
            "accessLogConfiguration": { 
               "format": "string",
               "includeQueryParameters": "string"
            },
            "enabled": boolean,
            "logConfiguration": { 
               "logDriver": "string",
               "options": { 
                  "string" : "string" 
               },
               "secretOptions": [ 
                  { 
                     "name": "string",
                     "valueFrom": "string"
                  }
               ]
            },
            "namespace": "string",
            "services": [ 
               { 
                  "clientAliases": [ 
                     { 
                        "dnsName": "string",
                        "port": number,
                        "testTrafficRules": { 
                           "header": { 
                              "name": "string",
                              "value": { 
                                 "exact": "string"
                              }
                           }
                        }
                     }
                  ],
                  "discoveryName": "string",
                  "ingressPortOverride": number,
                  "portName": "string",
                  "timeout": { 
                     "idleTimeoutSeconds": number,
                     "perRequestTimeoutSeconds": number
                  },
                  "tls": { 
                     "issuerCertificateAuthority": { 
                        "awsPcaAuthorityArn": "string"
                     },
                     "kmsKey": "string",
                     "roleArn": "string"
                  }
               }
            ]
         },
         "serviceRegistries": [ 
            { 
               "containerName": "string",
               "containerPort": number,
               "port": number,
               "registryArn": "string"
            }
         ],
         "serviceRevisionArn": "string",
         "taskDefinition": "string",
         "volumeConfigurations": [ 
            { 
               "managedEBSVolume": { 
                  "encrypted": boolean,
                  "filesystemType": "string",
                  "iops": number,
                  "kmsKeyId": "string",
                  "roleArn": "string",
                  "sizeInGiB": number,
                  "snapshotId": "string",
                  "tagSpecifications": [ 
                     { 
                        "propagateTags": "string",
                        "resourceType": "string",
                        "tags": [ 
                           { 
                              "key": "string",
                              "value": "string"
                           }
                        ]
                     }
                  ],
                  "throughput": number,
                  "volumeInitializationRate": number,
                  "volumeType": "string"
               },
               "name": "string"
            }
         ],
         "vpcLatticeConfigurations": [ 
            { 
               "portName": "string",
               "roleArn": "string",
               "targetGroupArn": "string"
            }
         ]
      }
   ]
}
```

## 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.

 ** [failures](#API_DescribeServiceRevisions_ResponseSyntax) **   <a name="ECS-DescribeServiceRevisions-response-failures"></a>
Any failures associated with the call.  
Type: Array of [Failure](API_Failure.md) objects

 ** [serviceRevisions](#API_DescribeServiceRevisions_ResponseSyntax) **   <a name="ECS-DescribeServiceRevisions-response-serviceRevisions"></a>
The list of service revisions described.  
Type: Array of [ServiceRevision](API_ServiceRevision.md) objects

## Errors


For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** AccessDeniedException **   
You don't have authorization to perform the requested action.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ClientException **   
These errors are usually caused by a client action. This client action might be using an action or resource on behalf of a user that doesn't have permissions to use the action or resource. Or, it might be specifying an identifier that isn't valid.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ClusterNotFoundException **   
The specified cluster wasn't found. You can view your available clusters with [ListClusters](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_ListClusters.html). Amazon ECS clusters are Region specific.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** InvalidParameterException **   
The specified parameter isn't valid. Review the available parameters for the API request.  
For more information about service event errors, see [Amazon ECS service event messages](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/service-event-messages-list.html).     
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ServerException **   
These errors are usually caused by a server issue.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 500

 ** ServiceNotFoundException **   
The specified service wasn't found. You can view your available services with [ListServices](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_ListServices.html). Amazon ECS services are cluster specific and Region specific.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** UnsupportedFeatureException **   
The specified task isn't supported in this Region.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

## Examples


### Example


This example request provides a full description of the service revision with the ARN `arn:aws:ecs:us-west-2:123456789012:service-revision/testc/sd1/4980306466373577095`.

#### Sample Request


```
POST / HTTP/1.1
Host: ecs.us-west-2.amazonaws.com
Accept-Encoding: identity
Content-Length: 55
X-Amz-Target: AmazonEC2ContainerServiceV20141113.DescribeServiceRevisions
X-Amz-Date: 20150528T163859Z
User-Agent: aws-cli/2.17 Python/3.11.9 Darwin/14.3.0
Content-Type: application/x-amz-json-1.1
Authorization: AUTHPARAMS

{

  "serviceRevisionArn": "arn:aws:ecs:us-west-2:123456789012:service-revision/testc/sd1/4980306466373577095"
}
```

#### Sample Response


```
HTTP/1.1 200 OK
Server: Server
Date: Tue, 10 Sep 2024 18:50:14 GMT
Content-Type: application/x-amz-json-1.1
Content-Length: 220
Connection: keep-alive
RequestId: 360c5551-123e-4e74-9914-7582d3a28807
{
    "serviceRevisions": [
        {
            "serviceRevisionArn": "arn:aws:ecs:us-west-2:123456789012:service-revision/example/sd-example/4980306466373577095",
            "serviceArn": "arn:aws:ecs:us-west-2:123456789012:service/example/sd-example",
            "clusterArn": "arn:aws:ecs:us-west-2:123456789012:cluster/example",
            "taskDefinition": "arn:aws:ecs:us-west-2:123456789012:task-definition/large-ngingx:1",
            "launchType": "FARGATE",
            "platformVersion": "1.4.0",
            "platformFamily": "DockerLinux",
            "networkConfiguration": {
                "awsvpcConfiguration": {
                    "subnets": [
                        "subnet-0a4040e73895f04e1"
                    ],
                    "securityGroups": [
                        "sg-09605d60a6bc1b296"
                    ],
                    "assignPublicIp": "ENABLED"
                }
            },
            "createdAt": "2024-09-10T16:49:26.39Z"
        }
    ],
    "failures": []
}
    ],
    "failures": []
}
```

## See Also


For more information about using this API in one of the language-specific Amazon SDKs, see the following:
+  [Amazon Command Line Interface V2](https://docs.amazonaws.cn/goto/cli2/ecs-2014-11-13/DescribeServiceRevisions) 
+  [Amazon SDK for .NET V4](https://docs.amazonaws.cn/goto/DotNetSDKV4/ecs-2014-11-13/DescribeServiceRevisions) 
+  [Amazon SDK for C\$1\$1](https://docs.amazonaws.cn/goto/SdkForCpp/ecs-2014-11-13/DescribeServiceRevisions) 
+  [Amazon SDK for Go v2](https://docs.amazonaws.cn/goto/SdkForGoV2/ecs-2014-11-13/DescribeServiceRevisions) 
+  [Amazon SDK for Java V2](https://docs.amazonaws.cn/goto/SdkForJavaV2/ecs-2014-11-13/DescribeServiceRevisions) 
+  [Amazon SDK for JavaScript V3](https://docs.amazonaws.cn/goto/SdkForJavaScriptV3/ecs-2014-11-13/DescribeServiceRevisions) 
+  [Amazon SDK for Kotlin](https://docs.amazonaws.cn/goto/SdkForKotlin/ecs-2014-11-13/DescribeServiceRevisions) 
+  [Amazon SDK for PHP V3](https://docs.amazonaws.cn/goto/SdkForPHPV3/ecs-2014-11-13/DescribeServiceRevisions) 
+  [Amazon SDK for Python](https://docs.amazonaws.cn/goto/boto3/ecs-2014-11-13/DescribeServiceRevisions) 
+  [Amazon SDK for Ruby V3](https://docs.amazonaws.cn/goto/SdkForRubyV3/ecs-2014-11-13/DescribeServiceRevisions) 

# DescribeServices


Describes the specified services running in your cluster.

## Request Syntax


```
{
   "cluster": "string",
   "include": [ "string" ],
   "services": [ "string" ]
}
```

## Request Parameters


For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [cluster](#API_DescribeServices_RequestSyntax) **   <a name="ECS-DescribeServices-request-cluster"></a>
The short name or full Amazon Resource Name (ARN)the cluster that hosts the service to describe. If you do not specify a cluster, the default cluster is assumed. This parameter is required if the service or services you are describing were launched in any cluster other than the default cluster.  
Type: String  
Required: No

 ** [include](#API_DescribeServices_RequestSyntax) **   <a name="ECS-DescribeServices-request-include"></a>
Determines whether you want to see the resource tags for the service. If `TAGS` is specified, the tags are included in the response. If this field is omitted, tags aren't included in the response.  
Type: Array of strings  
Valid Values: `TAGS`   
Required: No

 ** [services](#API_DescribeServices_RequestSyntax) **   <a name="ECS-DescribeServices-request-services"></a>
A list of services to describe. You may specify up to 10 services to describe in a single operation.  
Type: Array of strings  
Required: Yes

## Response Syntax


```
{
   "failures": [ 
      { 
         "arn": "string",
         "detail": "string",
         "reason": "string"
      }
   ],
   "services": [ 
      { 
         "availabilityZoneRebalancing": "string",
         "capacityProviderStrategy": [ 
            { 
               "base": number,
               "capacityProvider": "string",
               "weight": number
            }
         ],
         "clusterArn": "string",
         "createdAt": number,
         "createdBy": "string",
         "currentServiceDeployment": "string",
         "currentServiceRevisions": [ 
            { 
               "arn": "string",
               "pendingTaskCount": number,
               "requestedTaskCount": number,
               "runningTaskCount": number
            }
         ],
         "deploymentConfiguration": { 
            "alarms": { 
               "alarmNames": [ "string" ],
               "enable": boolean,
               "rollback": boolean
            },
            "bakeTimeInMinutes": number,
            "canaryConfiguration": { 
               "canaryBakeTimeInMinutes": number,
               "canaryPercent": number
            },
            "deploymentCircuitBreaker": { 
               "enable": boolean,
               "rollback": boolean
            },
            "lifecycleHooks": [ 
               { 
                  "hookDetails": JSON value,
                  "hookTargetArn": "string",
                  "lifecycleStages": [ "string" ],
                  "roleArn": "string"
               }
            ],
            "linearConfiguration": { 
               "stepBakeTimeInMinutes": number,
               "stepPercent": number
            },
            "maximumPercent": number,
            "minimumHealthyPercent": number,
            "strategy": "string"
         },
         "deploymentController": { 
            "type": "string"
         },
         "deployments": [ 
            { 
               "capacityProviderStrategy": [ 
                  { 
                     "base": number,
                     "capacityProvider": "string",
                     "weight": number
                  }
               ],
               "createdAt": number,
               "desiredCount": number,
               "failedTasks": number,
               "fargateEphemeralStorage": { 
                  "kmsKeyId": "string"
               },
               "id": "string",
               "launchType": "string",
               "networkConfiguration": { 
                  "awsvpcConfiguration": { 
                     "assignPublicIp": "string",
                     "securityGroups": [ "string" ],
                     "subnets": [ "string" ]
                  }
               },
               "pendingCount": number,
               "platformFamily": "string",
               "platformVersion": "string",
               "rolloutState": "string",
               "rolloutStateReason": "string",
               "runningCount": number,
               "serviceConnectConfiguration": { 
                  "accessLogConfiguration": { 
                     "format": "string",
                     "includeQueryParameters": "string"
                  },
                  "enabled": boolean,
                  "logConfiguration": { 
                     "logDriver": "string",
                     "options": { 
                        "string" : "string" 
                     },
                     "secretOptions": [ 
                        { 
                           "name": "string",
                           "valueFrom": "string"
                        }
                     ]
                  },
                  "namespace": "string",
                  "services": [ 
                     { 
                        "clientAliases": [ 
                           { 
                              "dnsName": "string",
                              "port": number,
                              "testTrafficRules": { 
                                 "header": { 
                                    "name": "string",
                                    "value": { 
                                       "exact": "string"
                                    }
                                 }
                              }
                           }
                        ],
                        "discoveryName": "string",
                        "ingressPortOverride": number,
                        "portName": "string",
                        "timeout": { 
                           "idleTimeoutSeconds": number,
                           "perRequestTimeoutSeconds": number
                        },
                        "tls": { 
                           "issuerCertificateAuthority": { 
                              "awsPcaAuthorityArn": "string"
                           },
                           "kmsKey": "string",
                           "roleArn": "string"
                        }
                     }
                  ]
               },
               "serviceConnectResources": [ 
                  { 
                     "discoveryArn": "string",
                     "discoveryName": "string"
                  }
               ],
               "status": "string",
               "taskDefinition": "string",
               "updatedAt": number,
               "volumeConfigurations": [ 
                  { 
                     "managedEBSVolume": { 
                        "encrypted": boolean,
                        "filesystemType": "string",
                        "iops": number,
                        "kmsKeyId": "string",
                        "roleArn": "string",
                        "sizeInGiB": number,
                        "snapshotId": "string",
                        "tagSpecifications": [ 
                           { 
                              "propagateTags": "string",
                              "resourceType": "string",
                              "tags": [ 
                                 { 
                                    "key": "string",
                                    "value": "string"
                                 }
                              ]
                           }
                        ],
                        "throughput": number,
                        "volumeInitializationRate": number,
                        "volumeType": "string"
                     },
                     "name": "string"
                  }
               ],
               "vpcLatticeConfigurations": [ 
                  { 
                     "portName": "string",
                     "roleArn": "string",
                     "targetGroupArn": "string"
                  }
               ]
            }
         ],
         "desiredCount": number,
         "enableECSManagedTags": boolean,
         "enableExecuteCommand": boolean,
         "events": [ 
            { 
               "createdAt": number,
               "id": "string",
               "message": "string"
            }
         ],
         "healthCheckGracePeriodSeconds": number,
         "launchType": "string",
         "loadBalancers": [ 
            { 
               "advancedConfiguration": { 
                  "alternateTargetGroupArn": "string",
                  "productionListenerRule": "string",
                  "roleArn": "string",
                  "testListenerRule": "string"
               },
               "containerName": "string",
               "containerPort": number,
               "loadBalancerName": "string",
               "targetGroupArn": "string"
            }
         ],
         "networkConfiguration": { 
            "awsvpcConfiguration": { 
               "assignPublicIp": "string",
               "securityGroups": [ "string" ],
               "subnets": [ "string" ]
            }
         },
         "pendingCount": number,
         "placementConstraints": [ 
            { 
               "expression": "string",
               "type": "string"
            }
         ],
         "placementStrategy": [ 
            { 
               "field": "string",
               "type": "string"
            }
         ],
         "platformFamily": "string",
         "platformVersion": "string",
         "propagateTags": "string",
         "resourceManagementType": "string",
         "roleArn": "string",
         "runningCount": number,
         "schedulingStrategy": "string",
         "serviceArn": "string",
         "serviceName": "string",
         "serviceRegistries": [ 
            { 
               "containerName": "string",
               "containerPort": number,
               "port": number,
               "registryArn": "string"
            }
         ],
         "status": "string",
         "tags": [ 
            { 
               "key": "string",
               "value": "string"
            }
         ],
         "taskDefinition": "string",
         "taskSets": [ 
            { 
               "capacityProviderStrategy": [ 
                  { 
                     "base": number,
                     "capacityProvider": "string",
                     "weight": number
                  }
               ],
               "clusterArn": "string",
               "computedDesiredCount": number,
               "createdAt": number,
               "externalId": "string",
               "fargateEphemeralStorage": { 
                  "kmsKeyId": "string"
               },
               "id": "string",
               "launchType": "string",
               "loadBalancers": [ 
                  { 
                     "advancedConfiguration": { 
                        "alternateTargetGroupArn": "string",
                        "productionListenerRule": "string",
                        "roleArn": "string",
                        "testListenerRule": "string"
                     },
                     "containerName": "string",
                     "containerPort": number,
                     "loadBalancerName": "string",
                     "targetGroupArn": "string"
                  }
               ],
               "networkConfiguration": { 
                  "awsvpcConfiguration": { 
                     "assignPublicIp": "string",
                     "securityGroups": [ "string" ],
                     "subnets": [ "string" ]
                  }
               },
               "pendingCount": number,
               "platformFamily": "string",
               "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",
               "tags": [ 
                  { 
                     "key": "string",
                     "value": "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.

 ** [failures](#API_DescribeServices_ResponseSyntax) **   <a name="ECS-DescribeServices-response-failures"></a>
Any failures associated with the call.  
Type: Array of [Failure](API_Failure.md) objects

 ** [services](#API_DescribeServices_ResponseSyntax) **   <a name="ECS-DescribeServices-response-services"></a>
The list of services described.  
Type: Array of [Service](API_Service.md) objects

## Errors


For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** ClientException **   
These errors are usually caused by a client action. This client action might be using an action or resource on behalf of a user that doesn't have permissions to use the action or resource. Or, it might be specifying an identifier that isn't valid.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ClusterNotFoundException **   
The specified cluster wasn't found. You can view your available clusters with [ListClusters](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_ListClusters.html). Amazon ECS clusters are Region specific.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** InvalidParameterException **   
The specified parameter isn't valid. Review the available parameters for the API request.  
For more information about service event errors, see [Amazon ECS service event messages](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/service-event-messages-list.html).     
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ServerException **   
These errors are usually caused by a server issue.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 500

## Examples


In the following example or examples, the Authorization header contents (`AUTHPARAMS`) must be replaced with an Amazon Signature Version 4 signature. For more information, see [Signature Version 4 Signing Process](https://docs.amazonaws.cn/general/latest/gr/signature-version-4.html) in the * Amazon General Reference*.

You only need to learn how to sign HTTP requests if you intend to create them manually. When you use the [Amazon Command Line Interface](http://www.amazonaws.cn/cli/) or one of the [Amazon SDKs](http://www.amazonaws.cn/tools/) to make requests to Amazon, these tools automatically sign the requests for you, with the access key that you specify when you configure the tools. When you use these tools, you don't have to sign requests yourself.

### Example


This example request provides a full description of the `test-service` service in the `telemetry` cluster.

#### Sample Request


```
POST / HTTP/1.1
Host: ecs.us-west-2.amazonaws.com
Accept-Encoding: identity
Content-Length: 55
X-Amz-Target: AmazonEC2ContainerServiceV20141113.DescribeServices
X-Amz-Date: 20150528T163859Z
User-Agent: aws-cli/1.7.30 Python/2.7.9 Darwin/14.3.0
Content-Type: application/x-amz-json-1.1
Authorization: AUTHPARAMS

{
  "services": [
    "test-service"
  ],
  "cluster": "telemetry"
}
```

#### Sample Response


```
HTTP/1.1 200 OK
Server: Server
Date: Wed, 29 Apr 2015 19:02:59 GMT
Content-Type: application/x-amz-json-1.1
Content-Length: 2449
Connection: keep-alive
x-amzn-RequestId: 123a4b56-7c89-01d2-3ef4-example5678f

{
  "failures": [],
  "services": [
    {
      "clusterArn": "arn:aws:ecs:us-west-2:012345678910:cluster/telemetry",
      "deploymentConfiguration": {
          "maximumPercent": 200,
          "minimumHealthyPercent": 100
      },
      "deployments": [
        {
          "createdAt": 1432829320.611,
          "desiredCount": 4,
          "id": "ecs-svc/9223370604025455196",
          "pendingCount": 0,
          "runningCount": 4,
          "status": "PRIMARY",
          "taskDefinition": "arn:aws:ecs:us-west-2:012345678910:task-definition/hpcc-t2-medium:1",
          "updatedAt": 1432829320.611
        }
      ],
      "desiredCount": 4,
      "events": [],
      "loadBalancers": [],
      "pendingCount": 0,
      "runningCount": 4,
      "serviceArn": "arn:aws:ecs:us-west-2:012345678910:service/default/test-service",
      "serviceName": "test-service",
      "status": "ACTIVE",
      "taskDefinition": "arn:aws:ecs:us-west-2:012345678910:task-definition/hpcc-t2-medium:1"
    }
  ]
}
```

## See Also


For more information about using this API in one of the language-specific Amazon SDKs, see the following:
+  [Amazon Command Line Interface V2](https://docs.amazonaws.cn/goto/cli2/ecs-2014-11-13/DescribeServices) 
+  [Amazon SDK for .NET V4](https://docs.amazonaws.cn/goto/DotNetSDKV4/ecs-2014-11-13/DescribeServices) 
+  [Amazon SDK for C\$1\$1](https://docs.amazonaws.cn/goto/SdkForCpp/ecs-2014-11-13/DescribeServices) 
+  [Amazon SDK for Go v2](https://docs.amazonaws.cn/goto/SdkForGoV2/ecs-2014-11-13/DescribeServices) 
+  [Amazon SDK for Java V2](https://docs.amazonaws.cn/goto/SdkForJavaV2/ecs-2014-11-13/DescribeServices) 
+  [Amazon SDK for JavaScript V3](https://docs.amazonaws.cn/goto/SdkForJavaScriptV3/ecs-2014-11-13/DescribeServices) 
+  [Amazon SDK for Kotlin](https://docs.amazonaws.cn/goto/SdkForKotlin/ecs-2014-11-13/DescribeServices) 
+  [Amazon SDK for PHP V3](https://docs.amazonaws.cn/goto/SdkForPHPV3/ecs-2014-11-13/DescribeServices) 
+  [Amazon SDK for Python](https://docs.amazonaws.cn/goto/boto3/ecs-2014-11-13/DescribeServices) 
+  [Amazon SDK for Ruby V3](https://docs.amazonaws.cn/goto/SdkForRubyV3/ecs-2014-11-13/DescribeServices) 

# DescribeTaskDefinition


Describes a task definition. You can specify a `family` and `revision` to find information about a specific task definition, or you can simply specify the family to find the latest `ACTIVE` revision in that family.

**Note**  
You can only describe `INACTIVE` task definitions while an active task or service references them.

## Request Syntax


```
{
   "include": [ "string" ],
   "taskDefinition": "string"
}
```

## Request Parameters


For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [include](#API_DescribeTaskDefinition_RequestSyntax) **   <a name="ECS-DescribeTaskDefinition-request-include"></a>
Determines whether to see the resource tags for the task definition. If `TAGS` is specified, the tags are included in the response. If this field is omitted, tags aren't included in the response.  
Type: Array of strings  
Valid Values: `TAGS`   
Required: No

 ** [taskDefinition](#API_DescribeTaskDefinition_RequestSyntax) **   <a name="ECS-DescribeTaskDefinition-request-taskDefinition"></a>
The `family` for the latest `ACTIVE` revision, `family` and `revision` (`family:revision`) for a specific revision in the family, or full Amazon Resource Name (ARN) of the task definition to describe.  
Type: String  
Required: Yes

## Response Syntax


```
{
   "tags": [ 
      { 
         "key": "string",
         "value": "string"
      }
   ],
   "taskDefinition": { 
      "compatibilities": [ "string" ],
      "containerDefinitions": [ 
         { 
            "command": [ "string" ],
            "cpu": number,
            "credentialSpecs": [ "string" ],
            "dependsOn": [ 
               { 
                  "condition": "string",
                  "containerName": "string"
               }
            ],
            "disableNetworking": boolean,
            "dnsSearchDomains": [ "string" ],
            "dnsServers": [ "string" ],
            "dockerLabels": { 
               "string" : "string" 
            },
            "dockerSecurityOptions": [ "string" ],
            "entryPoint": [ "string" ],
            "environment": [ 
               { 
                  "name": "string",
                  "value": "string"
               }
            ],
            "environmentFiles": [ 
               { 
                  "type": "string",
                  "value": "string"
               }
            ],
            "essential": boolean,
            "extraHosts": [ 
               { 
                  "hostname": "string",
                  "ipAddress": "string"
               }
            ],
            "firelensConfiguration": { 
               "options": { 
                  "string" : "string" 
               },
               "type": "string"
            },
            "healthCheck": { 
               "command": [ "string" ],
               "interval": number,
               "retries": number,
               "startPeriod": number,
               "timeout": number
            },
            "hostname": "string",
            "image": "string",
            "interactive": boolean,
            "links": [ "string" ],
            "linuxParameters": { 
               "capabilities": { 
                  "add": [ "string" ],
                  "drop": [ "string" ]
               },
               "devices": [ 
                  { 
                     "containerPath": "string",
                     "hostPath": "string",
                     "permissions": [ "string" ]
                  }
               ],
               "initProcessEnabled": boolean,
               "maxSwap": number,
               "sharedMemorySize": number,
               "swappiness": number,
               "tmpfs": [ 
                  { 
                     "containerPath": "string",
                     "mountOptions": [ "string" ],
                     "size": number
                  }
               ]
            },
            "logConfiguration": { 
               "logDriver": "string",
               "options": { 
                  "string" : "string" 
               },
               "secretOptions": [ 
                  { 
                     "name": "string",
                     "valueFrom": "string"
                  }
               ]
            },
            "memory": number,
            "memoryReservation": number,
            "mountPoints": [ 
               { 
                  "containerPath": "string",
                  "readOnly": boolean,
                  "sourceVolume": "string"
               }
            ],
            "name": "string",
            "portMappings": [ 
               { 
                  "appProtocol": "string",
                  "containerPort": number,
                  "containerPortRange": "string",
                  "hostPort": number,
                  "name": "string",
                  "protocol": "string"
               }
            ],
            "privileged": boolean,
            "pseudoTerminal": boolean,
            "readonlyRootFilesystem": boolean,
            "repositoryCredentials": { 
               "credentialsParameter": "string"
            },
            "resourceRequirements": [ 
               { 
                  "type": "string",
                  "value": "string"
               }
            ],
            "restartPolicy": { 
               "enabled": boolean,
               "ignoredExitCodes": [ number ],
               "restartAttemptPeriod": number
            },
            "secrets": [ 
               { 
                  "name": "string",
                  "valueFrom": "string"
               }
            ],
            "startTimeout": number,
            "stopTimeout": number,
            "systemControls": [ 
               { 
                  "namespace": "string",
                  "value": "string"
               }
            ],
            "ulimits": [ 
               { 
                  "hardLimit": number,
                  "name": "string",
                  "softLimit": number
               }
            ],
            "user": "string",
            "versionConsistency": "string",
            "volumesFrom": [ 
               { 
                  "readOnly": boolean,
                  "sourceContainer": "string"
               }
            ],
            "workingDirectory": "string"
         }
      ],
      "cpu": "string",
      "deleteRequestedAt": number,
      "deregisteredAt": number,
      "enableFaultInjection": boolean,
      "ephemeralStorage": { 
         "sizeInGiB": number
      },
      "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"
      },
      "registeredAt": number,
      "registeredBy": "string",
      "requiresAttributes": [ 
         { 
            "name": "string",
            "targetId": "string",
            "targetType": "string",
            "value": "string"
         }
      ],
      "requiresCompatibilities": [ "string" ],
      "revision": number,
      "runtimePlatform": { 
         "cpuArchitecture": "string",
         "operatingSystemFamily": "string"
      },
      "status": "string",
      "taskDefinitionArn": "string",
      "taskRoleArn": "string",
      "volumes": [ 
         { 
            "configuredAtLaunch": boolean,
            "dockerVolumeConfiguration": { 
               "autoprovision": boolean,
               "driver": "string",
               "driverOpts": { 
                  "string" : "string" 
               },
               "labels": { 
                  "string" : "string" 
               },
               "scope": "string"
            },
            "efsVolumeConfiguration": { 
               "authorizationConfig": { 
                  "accessPointId": "string",
                  "iam": "string"
               },
               "fileSystemId": "string",
               "rootDirectory": "string",
               "transitEncryption": "string",
               "transitEncryptionPort": number
            },
            "fsxWindowsFileServerVolumeConfiguration": { 
               "authorizationConfig": { 
                  "credentialsParameter": "string",
                  "domain": "string"
               },
               "fileSystemId": "string",
               "rootDirectory": "string"
            },
            "host": { 
               "sourcePath": "string"
            },
            "name": "string"
         }
      ]
   }
}
```

## 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.

 ** [tags](#API_DescribeTaskDefinition_ResponseSyntax) **   <a name="ECS-DescribeTaskDefinition-response-tags"></a>
The metadata that's applied to the task definition 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 Amazon 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.
Type: Array of [Tag](API_Tag.md) objects  
Array Members: Minimum number of 0 items. Maximum number of 50 items.

 ** [taskDefinition](#API_DescribeTaskDefinition_ResponseSyntax) **   <a name="ECS-DescribeTaskDefinition-response-taskDefinition"></a>
The full task definition description.  
Type: [TaskDefinition](API_TaskDefinition.md) object

## Errors


For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** ClientException **   
These errors are usually caused by a client action. This client action might be using an action or resource on behalf of a user that doesn't have permissions to use the action or resource. Or, it might be specifying an identifier that isn't valid.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** InvalidParameterException **   
The specified parameter isn't valid. Review the available parameters for the API request.  
For more information about service event errors, see [Amazon ECS service event messages](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/service-event-messages-list.html).     
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ServerException **   
These errors are usually caused by a server issue.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 500

## Examples


In the following example or examples, the Authorization header contents (`AUTHPARAMS`) must be replaced with an Amazon Signature Version 4 signature. For more information, see [Signature Version 4 Signing Process](https://docs.amazonaws.cn/general/latest/gr/signature-version-4.html) in the * Amazon General Reference*.

You only need to learn how to sign HTTP requests if you intend to create them manually. When you use the [Amazon Command Line Interface](http://www.amazonaws.cn/cli/) or one of the [Amazon SDKs](http://www.amazonaws.cn/tools/) to make requests to Amazon, these tools automatically sign the requests for you, with the access key that you specify when you configure the tools. When you use these tools, you don't have to sign requests yourself.

### Example


This example request provides descriptive information about the 10th revision of a task definition in the `hello_world` family.

#### Sample Request


```
POST / HTTP/1.1
Host: ecs.us-east-1.amazonaws.com
Accept-Encoding: identity
Content-Length: 36
X-Amz-Target: AmazonEC2ContainerServiceV20141113.DescribeTaskDefinition
X-Amz-Date: 20150429T190902Z
Content-Type: application/x-amz-json-1.1
Authorization: AUTHPARAMS

{
  "taskDefinition": "hello_world:10"
}
```

#### Sample Response


```
HTTP/1.1 200 OK
Server: Server
Date: Wed, 29 Apr 2015 19:09:03 GMT
Content-Type: application/x-amz-json-1.1
Content-Length: 574
Connection: keep-alive
x-amzn-RequestId: 123a4b56-7c89-01d2-3ef4-example5678f

{
  "taskDefinition": {
    "containerDefinitions": [
      {
        "cpu": 10,
        "environment": [],
        "essential": true,
        "image": "public.ecr.aws/docker/library/wordpress:latest",
        "links": [
          "mysql"
        ],
        "memory": 500,
        "mountPoints": [],
        "name": "wordpress",
        "portMappings": [
          {
            "containerPort": 80,
            "hostPort": 80
          }
        ],
        "volumesFrom": []
      },
      {
        "cpu": 10,
        "environment": [
          {
            "name": "MYSQL_ROOT_PASSWORD",
            "value": "password"
          }
        ],
        "essential": true,
        "image": "public.ecr.aws/docker/library/mysql:latest",
        "memory": 500,
        "mountPoints": [],
        "name": "mysql",
        "portMappings": [],
        "volumesFrom": []
      }
    ],
    "family": "hello_world",
    "revision": 10,
    "taskDefinitionArn": "arn:aws:ecs:us-east-1:012345678910:task-definition/hello_world:10",
    "volumes": []
  }
}
```

## See Also


For more information about using this API in one of the language-specific Amazon SDKs, see the following:
+  [Amazon Command Line Interface V2](https://docs.amazonaws.cn/goto/cli2/ecs-2014-11-13/DescribeTaskDefinition) 
+  [Amazon SDK for .NET V4](https://docs.amazonaws.cn/goto/DotNetSDKV4/ecs-2014-11-13/DescribeTaskDefinition) 
+  [Amazon SDK for C\$1\$1](https://docs.amazonaws.cn/goto/SdkForCpp/ecs-2014-11-13/DescribeTaskDefinition) 
+  [Amazon SDK for Go v2](https://docs.amazonaws.cn/goto/SdkForGoV2/ecs-2014-11-13/DescribeTaskDefinition) 
+  [Amazon SDK for Java V2](https://docs.amazonaws.cn/goto/SdkForJavaV2/ecs-2014-11-13/DescribeTaskDefinition) 
+  [Amazon SDK for JavaScript V3](https://docs.amazonaws.cn/goto/SdkForJavaScriptV3/ecs-2014-11-13/DescribeTaskDefinition) 
+  [Amazon SDK for Kotlin](https://docs.amazonaws.cn/goto/SdkForKotlin/ecs-2014-11-13/DescribeTaskDefinition) 
+  [Amazon SDK for PHP V3](https://docs.amazonaws.cn/goto/SdkForPHPV3/ecs-2014-11-13/DescribeTaskDefinition) 
+  [Amazon SDK for Python](https://docs.amazonaws.cn/goto/boto3/ecs-2014-11-13/DescribeTaskDefinition) 
+  [Amazon SDK for Ruby V3](https://docs.amazonaws.cn/goto/SdkForRubyV3/ecs-2014-11-13/DescribeTaskDefinition) 

# DescribeTasks


Describes a specified task or tasks.

Currently, stopped tasks appear in the returned results for at least one hour.

If you have tasks with tags, and then delete the cluster, the tagged tasks are returned in the response. If you create a new cluster with the same name as the deleted cluster, the tagged tasks are not included in the response.

## Request Syntax


```
{
   "cluster": "string",
   "include": [ "string" ],
   "tasks": [ "string" ]
}
```

## Request Parameters


For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [cluster](#API_DescribeTasks_RequestSyntax) **   <a name="ECS-DescribeTasks-request-cluster"></a>
The short name or full Amazon Resource Name (ARN) of the cluster that hosts the task or tasks to describe. If you do not specify a cluster, the default cluster is assumed.  
Type: String  
Required: No

 ** [include](#API_DescribeTasks_RequestSyntax) **   <a name="ECS-DescribeTasks-request-include"></a>
Specifies whether you want to see the resource tags for the task. If `TAGS` is specified, the tags are included in the response. If this field is omitted, tags aren't included in the response.  
Type: Array of strings  
Valid Values: `TAGS`   
Required: No

 ** [tasks](#API_DescribeTasks_RequestSyntax) **   <a name="ECS-DescribeTasks-request-tasks"></a>
A list of up to 100 task IDs or full ARN entries.  
Type: Array of strings  
Required: Yes

## Response Syntax


```
{
   "failures": [ 
      { 
         "arn": "string",
         "detail": "string",
         "reason": "string"
      }
   ],
   "tasks": [ 
      { 
         "attachments": [ 
            { 
               "details": [ 
                  { 
                     "name": "string",
                     "value": "string"
                  }
               ],
               "id": "string",
               "status": "string",
               "type": "string"
            }
         ],
         "attributes": [ 
            { 
               "name": "string",
               "targetId": "string",
               "targetType": "string",
               "value": "string"
            }
         ],
         "availabilityZone": "string",
         "capacityProviderName": "string",
         "clusterArn": "string",
         "connectivity": "string",
         "connectivityAt": number,
         "containerInstanceArn": "string",
         "containers": [ 
            { 
               "containerArn": "string",
               "cpu": "string",
               "exitCode": number,
               "gpuIds": [ "string" ],
               "healthStatus": "string",
               "image": "string",
               "imageDigest": "string",
               "lastStatus": "string",
               "managedAgents": [ 
                  { 
                     "lastStartedAt": number,
                     "lastStatus": "string",
                     "name": "string",
                     "reason": "string"
                  }
               ],
               "memory": "string",
               "memoryReservation": "string",
               "name": "string",
               "networkBindings": [ 
                  { 
                     "bindIP": "string",
                     "containerPort": number,
                     "containerPortRange": "string",
                     "hostPort": number,
                     "hostPortRange": "string",
                     "protocol": "string"
                  }
               ],
               "networkInterfaces": [ 
                  { 
                     "attachmentId": "string",
                     "ipv6Address": "string",
                     "privateIpv4Address": "string"
                  }
               ],
               "reason": "string",
               "runtimeId": "string",
               "taskArn": "string"
            }
         ],
         "cpu": "string",
         "createdAt": number,
         "desiredStatus": "string",
         "enableExecuteCommand": boolean,
         "ephemeralStorage": { 
            "sizeInGiB": number
         },
         "executionStoppedAt": number,
         "fargateEphemeralStorage": { 
            "kmsKeyId": "string",
            "sizeInGiB": number
         },
         "group": "string",
         "healthStatus": "string",
         "inferenceAccelerators": [ 
            { 
               "deviceName": "string",
               "deviceType": "string"
            }
         ],
         "lastStatus": "string",
         "launchType": "string",
         "memory": "string",
         "overrides": { 
            "containerOverrides": [ 
               { 
                  "command": [ "string" ],
                  "cpu": number,
                  "environment": [ 
                     { 
                        "name": "string",
                        "value": "string"
                     }
                  ],
                  "environmentFiles": [ 
                     { 
                        "type": "string",
                        "value": "string"
                     }
                  ],
                  "memory": number,
                  "memoryReservation": number,
                  "name": "string",
                  "resourceRequirements": [ 
                     { 
                        "type": "string",
                        "value": "string"
                     }
                  ]
               }
            ],
            "cpu": "string",
            "ephemeralStorage": { 
               "sizeInGiB": number
            },
            "executionRoleArn": "string",
            "inferenceAcceleratorOverrides": [ 
               { 
                  "deviceName": "string",
                  "deviceType": "string"
               }
            ],
            "memory": "string",
            "taskRoleArn": "string"
         },
         "platformFamily": "string",
         "platformVersion": "string",
         "pullStartedAt": number,
         "pullStoppedAt": number,
         "startedAt": number,
         "startedBy": "string",
         "stopCode": "string",
         "stoppedAt": number,
         "stoppedReason": "string",
         "stoppingAt": number,
         "tags": [ 
            { 
               "key": "string",
               "value": "string"
            }
         ],
         "taskArn": "string",
         "taskDefinitionArn": "string",
         "version": 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.

 ** [failures](#API_DescribeTasks_ResponseSyntax) **   <a name="ECS-DescribeTasks-response-failures"></a>
Any failures associated with the call.  
Type: Array of [Failure](API_Failure.md) objects

 ** [tasks](#API_DescribeTasks_ResponseSyntax) **   <a name="ECS-DescribeTasks-response-tasks"></a>
The list of tasks.  
Type: Array of [Task](API_Task.md) objects

## Errors


For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** ClientException **   
These errors are usually caused by a client action. This client action might be using an action or resource on behalf of a user that doesn't have permissions to use the action or resource. Or, it might be specifying an identifier that isn't valid.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ClusterNotFoundException **   
The specified cluster wasn't found. You can view your available clusters with [ListClusters](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_ListClusters.html). Amazon ECS clusters are Region specific.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** InvalidParameterException **   
The specified parameter isn't valid. Review the available parameters for the API request.  
For more information about service event errors, see [Amazon ECS service event messages](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/service-event-messages-list.html).     
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ServerException **   
These errors are usually caused by a server issue.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 500

## Examples


In the following example or examples, the Authorization header contents (`AUTHPARAMS`) must be replaced with an Amazon Signature Version 4 signature. For more information, see [Signature Version 4 Signing Process](https://docs.amazonaws.cn/general/latest/gr/signature-version-4.html) in the * Amazon General Reference*.

You only need to learn how to sign HTTP requests if you intend to create them manually. When you use the [Amazon Command Line Interface](http://www.amazonaws.cn/cli/) or one of the [Amazon SDKs](http://www.amazonaws.cn/tools/) to make requests to Amazon, these tools automatically sign the requests for you, with the access key that you specify when you configure the tools. When you use these tools, you don't have to sign requests yourself.

### Example


This example request provides descriptive information about a task with an ARN of `arn:aws:ecs:us-east-1:123456789012:cluster/default` in the `default` cluster.

#### Sample Request


```
POST / HTTP/1.1
Host: ecs.us-east-1.amazonaws.com
Accept-Encoding: identity
Content-Length: 51
X-Amz-Target: AmazonEC2ContainerServiceV20141113.DescribeTasks
X-Amz-Date: 20250212T181908Z
User-Agent: aws-cli/2.2.26 Python/2.7.12 Darwin/16.1.0 botocore/1.4.66
Content-Type: application/x-amz-json-1.1
Authorization: AUTHPARAMS

{
  "tasks": [
    "arn:aws:ecs:us-east-1:1234567890:cluster/default"
  ]
}
```

#### Sample Response


```
HTTP/1.1 200 OK
Server: Server
Date: Mon, 21 Nov 2016 21:49:16 GMT
Content-Type: application/x-amz-json-1.1
Content-Length: 1238
Connection: keep-alive

x-amzn-RequestId: 123a4b56-7c89-01d2-3ef4-example5678f

{
    "tasks": [
        {
            "attachments": [
                {
                    "id": "39888c47-dd47-482b-b6b5-1ea60b6633e7",
                    "type": "ElasticNetworkInterface",
                    "status": "ATTACHED",
                    "details": [
                        {
                            "name": "subnetId",
                            "value": "subnet-0db5010045995c2d5"
                        },
                        {
                            "name": "networkInterfaceId",
                            "value": "eni-0800851957d7918fa"
                        },
                        {
                            "name": "macAddress",
                            "value": "0a:ff:cc:73:2e:b7"
                        },
                        {
                            "name": "privateDnsName",
                            "value": "ip-10-0-0-250.ec2.internal"
                        },
                        {
                            "name": "privateIPv4Address",
                            "value": "10.0.0.250"
                        }
                    ]
                }
            ],
            "attributes": [
                {
                    "name": "ecs.cpu-architecture",
                    "value": "x86_64"
                }
            ],
            "availabilityZone": "us-east-1a",
            "capacityProviderName": "FARGATE",
            "clusterArn": "arn:aws:ecs:us-east-1:123456789012:cluster/default",
            "connectivity": "CONNECTED",
            "connectivityAt": "2025-02-03T16:01:58.863000-05:00",
            "containers": [
                {
                    "containerArn": "arn:aws:ecs:us-east-1:123456789012:container/default/154bdb1df5b446b280fe900d12c452a1/417f6954-30e9-4e60-84e5-bad3743617ab",
                    "taskArn": "arn:aws:ecs:us-east-1:123456789012:task/default/154bdb1df5b446b280fe900d12c452a1",
                    "name": "aws-otel-collector",
                    "image": "public.ecr.aws/aws-observability/aws-otel-collector:v0.32.0",
                    "imageDigest": "sha256:7a1b3560655071bcacd66902c20ebe9a69470d5691fe3bd36baace7c2f3c4640",
                    "runtimeId": "154bdb1df5b446b280fe900d12c452a1-4027662657",
                    "lastStatus": "RUNNING",
                    "networkBindings": [],
                    "networkInterfaces": [
                        {
                            "attachmentId": "39888c47-dd47-482b-b6b5-1ea60b6633e7",
                            "privateIpv4Address": "10.0.0.250"
                        }
                    ],
                    "healthStatus": "UNKNOWN",
                    "cpu": "0"
                },
                {
                    "containerArn": "arn:aws:ecs:us-east-1:123456789012:container/default/154bdb1df5b446b280fe900d12c452a1/52c6b197-710b-4860-9d52-262a56550b6a",
                    "taskArn": "arn:aws:ecs:us-east-1:123456789012:task/default/154bdb1df5b446b280fe900d12c452a1",
                    "name": "web",
                    "image": "nginx",
                    "imageDigest": "sha256:0a399eb16751829e1af26fea27b20c3ec28d7ab1fb72182879dcae1cca21206a",
                    "runtimeId": "154bdb1df5b446b280fe900d12c452a1-0265927825",
                    "lastStatus": "RUNNING",
                    "networkBindings": [],
                    "networkInterfaces": [
                        {
                            "attachmentId": "39888c47-dd47-482b-b6b5-1ea60b6633e7",
                            "privateIpv4Address": "10.0.0.250"
                        }
                    ],
                    "healthStatus": "HEALTHY",
                    "cpu": "99",
                    "memory": "100"
                }
            ],
            "cpu": "256",
            "createdAt": "2025-02-03T16:01:55.201000-05:00",
            "desiredStatus": "RUNNING",
            "enableExecuteCommand": false,
            "group": "family:webserver",
            "healthStatus": "HEALTHY",
            "lastStatus": "RUNNING",
            "launchType": "FARGATE",
            "memory": "512",
            "overrides": {
                "containerOverrides": [
                    {
                        "name": "aws-otel-collector"
                    },
                    {
                        "name": "web"
                    }
                ],
                "inferenceAcceleratorOverrides": []
            },
            "platformVersion": "1.4.0",
            "platformFamily": "Linux",
            "pullStartedAt": "2025-02-03T16:02:10.727000-05:00",
            "pullStoppedAt": "2025-02-03T16:02:17.868000-05:00",
            "startedAt": "2025-02-03T16:02:17.978000-05:00",
            "tags": [],
            "taskArn": "arn:aws:ecs:us-east-1:123456789012:task/default/154bdb1df5b446b280fe900d12c452a1",
            "taskDefinitionArn": "arn:aws:ecs:us-east-1:123456789012:task-definition/webserver:5",
            "version": 4,
            "ephemeralStorage": {
                "sizeInGiB": 20
            },
            "fargateEphemeralStorage": {
                "sizeInGiB": 20
            }
        }
    ],
    "failures": []
}
```

## See Also


For more information about using this API in one of the language-specific Amazon SDKs, see the following:
+  [Amazon Command Line Interface V2](https://docs.amazonaws.cn/goto/cli2/ecs-2014-11-13/DescribeTasks) 
+  [Amazon SDK for .NET V4](https://docs.amazonaws.cn/goto/DotNetSDKV4/ecs-2014-11-13/DescribeTasks) 
+  [Amazon SDK for C\$1\$1](https://docs.amazonaws.cn/goto/SdkForCpp/ecs-2014-11-13/DescribeTasks) 
+  [Amazon SDK for Go v2](https://docs.amazonaws.cn/goto/SdkForGoV2/ecs-2014-11-13/DescribeTasks) 
+  [Amazon SDK for Java V2](https://docs.amazonaws.cn/goto/SdkForJavaV2/ecs-2014-11-13/DescribeTasks) 
+  [Amazon SDK for JavaScript V3](https://docs.amazonaws.cn/goto/SdkForJavaScriptV3/ecs-2014-11-13/DescribeTasks) 
+  [Amazon SDK for Kotlin](https://docs.amazonaws.cn/goto/SdkForKotlin/ecs-2014-11-13/DescribeTasks) 
+  [Amazon SDK for PHP V3](https://docs.amazonaws.cn/goto/SdkForPHPV3/ecs-2014-11-13/DescribeTasks) 
+  [Amazon SDK for Python](https://docs.amazonaws.cn/goto/boto3/ecs-2014-11-13/DescribeTasks) 
+  [Amazon SDK for Ruby V3](https://docs.amazonaws.cn/goto/SdkForRubyV3/ecs-2014-11-13/DescribeTasks) 

# DescribeTaskSets


Describes the task sets 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.amazonaws.cn/AmazonECS/latest/developerguide/deployment-types.html) in the *Amazon Elastic Container Service Developer Guide*.

## Request Syntax


```
{
   "cluster": "string",
   "include": [ "string" ],
   "service": "string",
   "taskSets": [ "string" ]
}
```

## Request Parameters


For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [cluster](#API_DescribeTaskSets_RequestSyntax) **   <a name="ECS-DescribeTaskSets-request-cluster"></a>
The short name or full Amazon Resource Name (ARN) of the cluster that hosts the service that the task sets exist in.  
Type: String  
Required: Yes

 ** [include](#API_DescribeTaskSets_RequestSyntax) **   <a name="ECS-DescribeTaskSets-request-include"></a>
Specifies whether to see the resource tags for the task set. If `TAGS` is specified, the tags are included in the response. If this field is omitted, tags aren't included in the response.  
Type: Array of strings  
Valid Values: `TAGS`   
Required: No

 ** [service](#API_DescribeTaskSets_RequestSyntax) **   <a name="ECS-DescribeTaskSets-request-service"></a>
The short name or full Amazon Resource Name (ARN) of the service that the task sets exist in.  
Type: String  
Required: Yes

 ** [taskSets](#API_DescribeTaskSets_RequestSyntax) **   <a name="ECS-DescribeTaskSets-request-taskSets"></a>
The ID or full Amazon Resource Name (ARN) of task sets to describe.  
Type: Array of strings  
Required: No

## Response Syntax


```
{
   "failures": [ 
      { 
         "arn": "string",
         "detail": "string",
         "reason": "string"
      }
   ],
   "taskSets": [ 
      { 
         "capacityProviderStrategy": [ 
            { 
               "base": number,
               "capacityProvider": "string",
               "weight": number
            }
         ],
         "clusterArn": "string",
         "computedDesiredCount": number,
         "createdAt": number,
         "externalId": "string",
         "fargateEphemeralStorage": { 
            "kmsKeyId": "string"
         },
         "id": "string",
         "launchType": "string",
         "loadBalancers": [ 
            { 
               "advancedConfiguration": { 
                  "alternateTargetGroupArn": "string",
                  "productionListenerRule": "string",
                  "roleArn": "string",
                  "testListenerRule": "string"
               },
               "containerName": "string",
               "containerPort": number,
               "loadBalancerName": "string",
               "targetGroupArn": "string"
            }
         ],
         "networkConfiguration": { 
            "awsvpcConfiguration": { 
               "assignPublicIp": "string",
               "securityGroups": [ "string" ],
               "subnets": [ "string" ]
            }
         },
         "pendingCount": number,
         "platformFamily": "string",
         "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",
         "tags": [ 
            { 
               "key": "string",
               "value": "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.

 ** [failures](#API_DescribeTaskSets_ResponseSyntax) **   <a name="ECS-DescribeTaskSets-response-failures"></a>
Any failures associated with the call.  
Type: Array of [Failure](API_Failure.md) objects

 ** [taskSets](#API_DescribeTaskSets_ResponseSyntax) **   <a name="ECS-DescribeTaskSets-response-taskSets"></a>
The list of task sets described.  
Type: Array of [TaskSet](API_TaskSet.md) objects

## Errors


For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** AccessDeniedException **   
You don't have authorization to perform the requested action.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ClientException **   
These errors are usually caused by a client action. This client action might be using an action or resource on behalf of a user that doesn't have permissions to use the action or resource. Or, it might be specifying an identifier that isn't valid.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ClusterNotFoundException **   
The specified cluster wasn't found. You can view your available clusters with [ListClusters](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_ListClusters.html). Amazon ECS clusters are Region specific.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** InvalidParameterException **   
The specified parameter isn't valid. Review the available parameters for the API request.  
For more information about service event errors, see [Amazon ECS service event messages](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/service-event-messages-list.html).     
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ServerException **   
These errors are usually caused by a server issue.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 500

 ** ServiceNotActiveException **   
The specified service isn't active. You can't update a service that's inactive. If you have previously deleted a service, you can re-create it with [CreateService](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_CreateService.html).    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ServiceNotFoundException **   
The specified service wasn't found. You can view your available services with [ListServices](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_ListServices.html). Amazon ECS services are cluster specific and Region specific.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** UnsupportedFeatureException **   
The specified task isn't supported in this Region.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

## See Also


For more information about using this API in one of the language-specific Amazon SDKs, see the following:
+  [Amazon Command Line Interface V2](https://docs.amazonaws.cn/goto/cli2/ecs-2014-11-13/DescribeTaskSets) 
+  [Amazon SDK for .NET V4](https://docs.amazonaws.cn/goto/DotNetSDKV4/ecs-2014-11-13/DescribeTaskSets) 
+  [Amazon SDK for C\$1\$1](https://docs.amazonaws.cn/goto/SdkForCpp/ecs-2014-11-13/DescribeTaskSets) 
+  [Amazon SDK for Go v2](https://docs.amazonaws.cn/goto/SdkForGoV2/ecs-2014-11-13/DescribeTaskSets) 
+  [Amazon SDK for Java V2](https://docs.amazonaws.cn/goto/SdkForJavaV2/ecs-2014-11-13/DescribeTaskSets) 
+  [Amazon SDK for JavaScript V3](https://docs.amazonaws.cn/goto/SdkForJavaScriptV3/ecs-2014-11-13/DescribeTaskSets) 
+  [Amazon SDK for Kotlin](https://docs.amazonaws.cn/goto/SdkForKotlin/ecs-2014-11-13/DescribeTaskSets) 
+  [Amazon SDK for PHP V3](https://docs.amazonaws.cn/goto/SdkForPHPV3/ecs-2014-11-13/DescribeTaskSets) 
+  [Amazon SDK for Python](https://docs.amazonaws.cn/goto/boto3/ecs-2014-11-13/DescribeTaskSets) 
+  [Amazon SDK for Ruby V3](https://docs.amazonaws.cn/goto/SdkForRubyV3/ecs-2014-11-13/DescribeTaskSets) 

# DiscoverPollEndpoint


**Note**  
This action is only used by the Amazon ECS agent, and it is not intended for use outside of the agent.

Returns an endpoint for the Amazon ECS agent to poll for updates.

## Request Syntax


```
{
   "cluster": "string",
   "containerInstance": "string"
}
```

## Request Parameters


For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [cluster](#API_DiscoverPollEndpoint_RequestSyntax) **   <a name="ECS-DiscoverPollEndpoint-request-cluster"></a>
The short name or full Amazon Resource Name (ARN) of the cluster that the container instance belongs to.  
Type: String  
Required: No

 ** [containerInstance](#API_DiscoverPollEndpoint_RequestSyntax) **   <a name="ECS-DiscoverPollEndpoint-request-containerInstance"></a>
The container instance ID or full ARN of the container instance. For more information about the ARN format, see [Amazon Resource Name (ARN)](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/ecs-account-settings.html#ecs-resource-ids) in the *Amazon ECS Developer Guide*.  
Type: String  
Required: No

## Response Syntax


```
{
   "endpoint": "string",
   "serviceConnectEndpoint": "string",
   "telemetryEndpoint": "string"
}
```

## 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.

 ** [endpoint](#API_DiscoverPollEndpoint_ResponseSyntax) **   <a name="ECS-DiscoverPollEndpoint-response-endpoint"></a>
The endpoint for the Amazon ECS agent to poll.  
Type: String

 ** [serviceConnectEndpoint](#API_DiscoverPollEndpoint_ResponseSyntax) **   <a name="ECS-DiscoverPollEndpoint-response-serviceConnectEndpoint"></a>
The endpoint for the Amazon ECS agent to poll for Service Connect configuration. For more information, see [Service Connect](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/service-connect.html) in the *Amazon Elastic Container Service Developer Guide*.  
Type: String

 ** [telemetryEndpoint](#API_DiscoverPollEndpoint_ResponseSyntax) **   <a name="ECS-DiscoverPollEndpoint-response-telemetryEndpoint"></a>
The telemetry endpoint for the Amazon ECS agent.  
Type: String

## Errors


For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** ClientException **   
These errors are usually caused by a client action. This client action might be using an action or resource on behalf of a user that doesn't have permissions to use the action or resource. Or, it might be specifying an identifier that isn't valid.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ServerException **   
These errors are usually caused by a server issue.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 500

## See Also


For more information about using this API in one of the language-specific Amazon SDKs, see the following:
+  [Amazon Command Line Interface V2](https://docs.amazonaws.cn/goto/cli2/ecs-2014-11-13/DiscoverPollEndpoint) 
+  [Amazon SDK for .NET V4](https://docs.amazonaws.cn/goto/DotNetSDKV4/ecs-2014-11-13/DiscoverPollEndpoint) 
+  [Amazon SDK for C\$1\$1](https://docs.amazonaws.cn/goto/SdkForCpp/ecs-2014-11-13/DiscoverPollEndpoint) 
+  [Amazon SDK for Go v2](https://docs.amazonaws.cn/goto/SdkForGoV2/ecs-2014-11-13/DiscoverPollEndpoint) 
+  [Amazon SDK for Java V2](https://docs.amazonaws.cn/goto/SdkForJavaV2/ecs-2014-11-13/DiscoverPollEndpoint) 
+  [Amazon SDK for JavaScript V3](https://docs.amazonaws.cn/goto/SdkForJavaScriptV3/ecs-2014-11-13/DiscoverPollEndpoint) 
+  [Amazon SDK for Kotlin](https://docs.amazonaws.cn/goto/SdkForKotlin/ecs-2014-11-13/DiscoverPollEndpoint) 
+  [Amazon SDK for PHP V3](https://docs.amazonaws.cn/goto/SdkForPHPV3/ecs-2014-11-13/DiscoverPollEndpoint) 
+  [Amazon SDK for Python](https://docs.amazonaws.cn/goto/boto3/ecs-2014-11-13/DiscoverPollEndpoint) 
+  [Amazon SDK for Ruby V3](https://docs.amazonaws.cn/goto/SdkForRubyV3/ecs-2014-11-13/DiscoverPollEndpoint) 

# ExecuteCommand


Runs a command remotely on a container within a task.

If you use a condition key in your IAM policy to refine the conditions for the policy statement, for example limit the actions to a specific cluster, you receive an `AccessDeniedException` when there is a mismatch between the condition key value and the corresponding parameter value.

For information about required permissions and considerations, see [Using Amazon ECS Exec for debugging](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/ecs-exec.html) in the *Amazon ECS Developer Guide*. 

## Request Syntax


```
{
   "cluster": "string",
   "command": "string",
   "container": "string",
   "interactive": boolean,
   "task": "string"
}
```

## Request Parameters


For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [cluster](#API_ExecuteCommand_RequestSyntax) **   <a name="ECS-ExecuteCommand-request-cluster"></a>
The Amazon Resource Name (ARN) or short name of the cluster the task is running in. If you do not specify a cluster, the default cluster is assumed.  
Type: String  
Required: No

 ** [command](#API_ExecuteCommand_RequestSyntax) **   <a name="ECS-ExecuteCommand-request-command"></a>
The command to run on the container.  
Type: String  
Required: Yes

 ** [container](#API_ExecuteCommand_RequestSyntax) **   <a name="ECS-ExecuteCommand-request-container"></a>
The name of the container to execute the command on. A container name only needs to be specified for tasks containing multiple containers.  
Type: String  
Required: No

 ** [interactive](#API_ExecuteCommand_RequestSyntax) **   <a name="ECS-ExecuteCommand-request-interactive"></a>
Use this flag to run your command in interactive mode.  
Type: Boolean  
Required: Yes

 ** [task](#API_ExecuteCommand_RequestSyntax) **   <a name="ECS-ExecuteCommand-request-task"></a>
The Amazon Resource Name (ARN) or ID of the task the container is part of.  
Type: String  
Required: Yes

## Response Syntax


```
{
   "clusterArn": "string",
   "containerArn": "string",
   "containerName": "string",
   "interactive": boolean,
   "session": { 
      "sessionId": "string",
      "streamUrl": "string",
      "tokenValue": "string"
   },
   "taskArn": "string"
}
```

## 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.

 ** [clusterArn](#API_ExecuteCommand_ResponseSyntax) **   <a name="ECS-ExecuteCommand-response-clusterArn"></a>
The Amazon Resource Name (ARN) of the cluster.  
Type: String

 ** [containerArn](#API_ExecuteCommand_ResponseSyntax) **   <a name="ECS-ExecuteCommand-response-containerArn"></a>
The Amazon Resource Name (ARN) of the container.  
Type: String

 ** [containerName](#API_ExecuteCommand_ResponseSyntax) **   <a name="ECS-ExecuteCommand-response-containerName"></a>
The name of the container.  
Type: String

 ** [interactive](#API_ExecuteCommand_ResponseSyntax) **   <a name="ECS-ExecuteCommand-response-interactive"></a>
Determines whether the execute command session is running in interactive mode. Amazon ECS only supports initiating interactive sessions, so you must specify `true` for this value.  
Type: Boolean

 ** [session](#API_ExecuteCommand_ResponseSyntax) **   <a name="ECS-ExecuteCommand-response-session"></a>
The details of the SSM session that was created for this instance of execute-command.  
Type: [Session](API_Session.md) object

 ** [taskArn](#API_ExecuteCommand_ResponseSyntax) **   <a name="ECS-ExecuteCommand-response-taskArn"></a>
The Amazon Resource Name (ARN) of the task.  
Type: String

## Errors


For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** AccessDeniedException **   
You don't have authorization to perform the requested action.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ClientException **   
These errors are usually caused by a client action. This client action might be using an action or resource on behalf of a user that doesn't have permissions to use the action or resource. Or, it might be specifying an identifier that isn't valid.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ClusterNotFoundException **   
The specified cluster wasn't found. You can view your available clusters with [ListClusters](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_ListClusters.html). Amazon ECS clusters are Region specific.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** InvalidParameterException **   
The specified parameter isn't valid. Review the available parameters for the API request.  
For more information about service event errors, see [Amazon ECS service event messages](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/service-event-messages-list.html).     
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ServerException **   
These errors are usually caused by a server issue.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 500

 ** TargetNotConnectedException **   
The execute command cannot run. This error can be caused by any of the following configuration issues:  
+ Incorrect IAM permissions
+ The SSM agent is not installed or is not running
+  There is an interface Amazon VPC endpoint for Amazon ECS, but there is not one for Systems Manager Session Manager
For information about how to troubleshoot the issues, see [Troubleshooting issues with ECS Exec](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/ecs-exec.html) in the *Amazon Elastic Container Service Developer Guide*.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

## See Also


For more information about using this API in one of the language-specific Amazon SDKs, see the following:
+  [Amazon Command Line Interface V2](https://docs.amazonaws.cn/goto/cli2/ecs-2014-11-13/ExecuteCommand) 
+  [Amazon SDK for .NET V4](https://docs.amazonaws.cn/goto/DotNetSDKV4/ecs-2014-11-13/ExecuteCommand) 
+  [Amazon SDK for C\$1\$1](https://docs.amazonaws.cn/goto/SdkForCpp/ecs-2014-11-13/ExecuteCommand) 
+  [Amazon SDK for Go v2](https://docs.amazonaws.cn/goto/SdkForGoV2/ecs-2014-11-13/ExecuteCommand) 
+  [Amazon SDK for Java V2](https://docs.amazonaws.cn/goto/SdkForJavaV2/ecs-2014-11-13/ExecuteCommand) 
+  [Amazon SDK for JavaScript V3](https://docs.amazonaws.cn/goto/SdkForJavaScriptV3/ecs-2014-11-13/ExecuteCommand) 
+  [Amazon SDK for Kotlin](https://docs.amazonaws.cn/goto/SdkForKotlin/ecs-2014-11-13/ExecuteCommand) 
+  [Amazon SDK for PHP V3](https://docs.amazonaws.cn/goto/SdkForPHPV3/ecs-2014-11-13/ExecuteCommand) 
+  [Amazon SDK for Python](https://docs.amazonaws.cn/goto/boto3/ecs-2014-11-13/ExecuteCommand) 
+  [Amazon SDK for Ruby V3](https://docs.amazonaws.cn/goto/SdkForRubyV3/ecs-2014-11-13/ExecuteCommand) 

# GetTaskProtection


Retrieves the protection status of tasks in an Amazon ECS service.

## Request Syntax


```
{
   "cluster": "string",
   "tasks": [ "string" ]
}
```

## Request Parameters


For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [cluster](#API_GetTaskProtection_RequestSyntax) **   <a name="ECS-GetTaskProtection-request-cluster"></a>
The short name or full Amazon Resource Name (ARN) of the cluster that hosts the service that the task sets exist in.  
Type: String  
Required: Yes

 ** [tasks](#API_GetTaskProtection_RequestSyntax) **   <a name="ECS-GetTaskProtection-request-tasks"></a>
A list of up to 100 task IDs or full ARN entries.  
Type: Array of strings  
Required: No

## Response Syntax


```
{
   "failures": [ 
      { 
         "arn": "string",
         "detail": "string",
         "reason": "string"
      }
   ],
   "protectedTasks": [ 
      { 
         "expirationDate": number,
         "protectionEnabled": boolean,
         "taskArn": "string"
      }
   ]
}
```

## 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.

 ** [failures](#API_GetTaskProtection_ResponseSyntax) **   <a name="ECS-GetTaskProtection-response-failures"></a>
Any failures associated with the call.  
Type: Array of [Failure](API_Failure.md) objects

 ** [protectedTasks](#API_GetTaskProtection_ResponseSyntax) **   <a name="ECS-GetTaskProtection-response-protectedTasks"></a>
A list of tasks with the following information.  
+  `taskArn`: The task ARN.
+  `protectionEnabled`: The protection status of the task. If scale-in protection is turned on for a task, the value is `true`. Otherwise, it is `false`.
+  `expirationDate`: The epoch time when protection for the task will expire.
Type: Array of [ProtectedTask](API_ProtectedTask.md) objects

## Errors


For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** AccessDeniedException **   
You don't have authorization to perform the requested action.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ClientException **   
These errors are usually caused by a client action. This client action might be using an action or resource on behalf of a user that doesn't have permissions to use the action or resource. Or, it might be specifying an identifier that isn't valid.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ClusterNotFoundException **   
The specified cluster wasn't found. You can view your available clusters with [ListClusters](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_ListClusters.html). Amazon ECS clusters are Region specific.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** InvalidParameterException **   
The specified parameter isn't valid. Review the available parameters for the API request.  
For more information about service event errors, see [Amazon ECS service event messages](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/service-event-messages-list.html).     
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ResourceNotFoundException **   
The specified resource wasn't found.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ServerException **   
These errors are usually caused by a server issue.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 500

 ** UnsupportedFeatureException **   
The specified task isn't supported in this Region.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

## Examples


In the following example or examples, the Authorization header contents (`AUTHPARAMS`) must be replaced with an Amazon Signature Version 4 signature. For more information, see [Signature Version 4 Signing Process](https://docs.amazonaws.cn/general/latest/gr/signature-version-4.html) in the * Amazon General Reference*.

You only need to learn how to sign HTTP requests if you intend to create them manually. When you use the [Amazon Command Line Interface](http://www.amazonaws.cn/cli/) or one of the [Amazon SDKs](http://www.amazonaws.cn/tools/) to make requests to Amazon, these tools automatically sign the requests for you, with the access key that you specify when you configure the tools. When you use these tools, you don't have to sign requests yourself.

### Example


This example request gets the protection status for a task.

#### Sample Request


```
POST / HTTP/1.1
Host: ecs.us-west-2.amazonaws.com 
Accept-Encoding: identity 
Content-Length:81
X-Amz-Target: AmazonEC2ContainerServiceV20141113.GetTaskProtection 
X-Amz-Date: 20221102T190406Z 
Content-Type: application/x-amz-json-1.1 
Authorization: AUTHPARAMS 

{
    "cluster": "test-task-protection",
    "tasks": [
        "b8b1cf532d0e46ba8d44a40d1de16772"
    ]
}
```

#### Sample Response


```
HTTP/1.1 200 OK 
Server: Server 
Date: Wed, 02 Nov 2022 19:04:06 GMT 
Content-Type: application/x-amz-json-1.1 
Content-Length:177
Connection: keep-alive
x-amzn-RequestId: 123a4b56-7c89-01d2-3ef4-example5678f

{
    "protectedTasks": [
        {
            "taskArn": "arn:aws:ecs:us-west-2:012345678910:task/b8b1cf532d0e46ba8d44a40d1de16772",
            "protectionEnabled": true,
            "expirationDate": 1667416437.0
        }
    ],
    "failures": []
}
```

## See Also


For more information about using this API in one of the language-specific Amazon SDKs, see the following:
+  [Amazon Command Line Interface V2](https://docs.amazonaws.cn/goto/cli2/ecs-2014-11-13/GetTaskProtection) 
+  [Amazon SDK for .NET V4](https://docs.amazonaws.cn/goto/DotNetSDKV4/ecs-2014-11-13/GetTaskProtection) 
+  [Amazon SDK for C\$1\$1](https://docs.amazonaws.cn/goto/SdkForCpp/ecs-2014-11-13/GetTaskProtection) 
+  [Amazon SDK for Go v2](https://docs.amazonaws.cn/goto/SdkForGoV2/ecs-2014-11-13/GetTaskProtection) 
+  [Amazon SDK for Java V2](https://docs.amazonaws.cn/goto/SdkForJavaV2/ecs-2014-11-13/GetTaskProtection) 
+  [Amazon SDK for JavaScript V3](https://docs.amazonaws.cn/goto/SdkForJavaScriptV3/ecs-2014-11-13/GetTaskProtection) 
+  [Amazon SDK for Kotlin](https://docs.amazonaws.cn/goto/SdkForKotlin/ecs-2014-11-13/GetTaskProtection) 
+  [Amazon SDK for PHP V3](https://docs.amazonaws.cn/goto/SdkForPHPV3/ecs-2014-11-13/GetTaskProtection) 
+  [Amazon SDK for Python](https://docs.amazonaws.cn/goto/boto3/ecs-2014-11-13/GetTaskProtection) 
+  [Amazon SDK for Ruby V3](https://docs.amazonaws.cn/goto/SdkForRubyV3/ecs-2014-11-13/GetTaskProtection) 

# ListAccountSettings


Lists the account settings for a specified principal.

## Request Syntax


```
{
   "effectiveSettings": boolean,
   "maxResults": number,
   "name": "string",
   "nextToken": "string",
   "principalArn": "string",
   "value": "string"
}
```

## Request Parameters


For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [effectiveSettings](#API_ListAccountSettings_RequestSyntax) **   <a name="ECS-ListAccountSettings-request-effectiveSettings"></a>
Determines whether to return the effective settings. If `true`, the account settings for the root user or the default setting for the `principalArn` are returned. If `false`, the account settings for the `principalArn` are returned if they're set. Otherwise, no account settings are returned.  
Type: Boolean  
Required: No

 ** [maxResults](#API_ListAccountSettings_RequestSyntax) **   <a name="ECS-ListAccountSettings-request-maxResults"></a>
The maximum number of account setting results returned by `ListAccountSettings` in paginated output. When this parameter is used, `ListAccountSettings` only returns `maxResults` results in a single page along with a `nextToken` response element. The remaining results of the initial request can be seen by sending another `ListAccountSettings` request with the returned `nextToken` value. This value can be between 1 and 10. If this parameter isn't used, then `ListAccountSettings` returns up to 10 results and a `nextToken` value if applicable.  
Type: Integer  
Required: No

 ** [name](#API_ListAccountSettings_RequestSyntax) **   <a name="ECS-ListAccountSettings-request-name"></a>
The name of the account setting you want to list the settings for.  
Type: String  
Valid Values: `serviceLongArnFormat | taskLongArnFormat | containerInstanceLongArnFormat | awsvpcTrunking | containerInsights | fargateFIPSMode | tagResourceAuthorization | fargateTaskRetirementWaitPeriod | guardDutyActivate | defaultLogDriverMode | fargateEventWindows`   
Required: No

 ** [nextToken](#API_ListAccountSettings_RequestSyntax) **   <a name="ECS-ListAccountSettings-request-nextToken"></a>
The `nextToken` value returned from a `ListAccountSettings` request indicating that more results are available to fulfill the request and further calls will be needed. If `maxResults` was provided, it's possible the number of results to be fewer than `maxResults`.  
This token should be treated as an opaque identifier that is only used to retrieve the next items in a list and not for other programmatic purposes.
Type: String  
Required: No

 ** [principalArn](#API_ListAccountSettings_RequestSyntax) **   <a name="ECS-ListAccountSettings-request-principalArn"></a>
The ARN of the principal, which can be a user, role, or the root user. If this field is omitted, the account settings are listed only for the authenticated user.  
In order to use this parameter, you must be the root user, or the principal.  
Federated users assume the account setting of the root user and can't have explicit account settings set for them.
Type: String  
Required: No

 ** [value](#API_ListAccountSettings_RequestSyntax) **   <a name="ECS-ListAccountSettings-request-value"></a>
The value of the account settings to filter results with. You must also specify an account setting name to use this parameter.  
Type: String  
Required: No

## Response Syntax


```
{
   "nextToken": "string",
   "settings": [ 
      { 
         "name": "string",
         "principalArn": "string",
         "type": "string",
         "value": "string"
      }
   ]
}
```

## 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.

 ** [nextToken](#API_ListAccountSettings_ResponseSyntax) **   <a name="ECS-ListAccountSettings-response-nextToken"></a>
The `nextToken` value to include in a future `ListAccountSettings` request. When the results of a `ListAccountSettings` request exceed `maxResults`, this value can be used to retrieve the next page of results. This value is `null` when there are no more results to return.  
Type: String

 ** [settings](#API_ListAccountSettings_ResponseSyntax) **   <a name="ECS-ListAccountSettings-response-settings"></a>
The account settings for the resource.  
Type: Array of [Setting](API_Setting.md) objects

## Errors


For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** ClientException **   
These errors are usually caused by a client action. This client action might be using an action or resource on behalf of a user that doesn't have permissions to use the action or resource. Or, it might be specifying an identifier that isn't valid.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** InvalidParameterException **   
The specified parameter isn't valid. Review the available parameters for the API request.  
For more information about service event errors, see [Amazon ECS service event messages](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/service-event-messages-list.html).     
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ServerException **   
These errors are usually caused by a server issue.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 500

## See Also


For more information about using this API in one of the language-specific Amazon SDKs, see the following:
+  [Amazon Command Line Interface V2](https://docs.amazonaws.cn/goto/cli2/ecs-2014-11-13/ListAccountSettings) 
+  [Amazon SDK for .NET V4](https://docs.amazonaws.cn/goto/DotNetSDKV4/ecs-2014-11-13/ListAccountSettings) 
+  [Amazon SDK for C\$1\$1](https://docs.amazonaws.cn/goto/SdkForCpp/ecs-2014-11-13/ListAccountSettings) 
+  [Amazon SDK for Go v2](https://docs.amazonaws.cn/goto/SdkForGoV2/ecs-2014-11-13/ListAccountSettings) 
+  [Amazon SDK for Java V2](https://docs.amazonaws.cn/goto/SdkForJavaV2/ecs-2014-11-13/ListAccountSettings) 
+  [Amazon SDK for JavaScript V3](https://docs.amazonaws.cn/goto/SdkForJavaScriptV3/ecs-2014-11-13/ListAccountSettings) 
+  [Amazon SDK for Kotlin](https://docs.amazonaws.cn/goto/SdkForKotlin/ecs-2014-11-13/ListAccountSettings) 
+  [Amazon SDK for PHP V3](https://docs.amazonaws.cn/goto/SdkForPHPV3/ecs-2014-11-13/ListAccountSettings) 
+  [Amazon SDK for Python](https://docs.amazonaws.cn/goto/boto3/ecs-2014-11-13/ListAccountSettings) 
+  [Amazon SDK for Ruby V3](https://docs.amazonaws.cn/goto/SdkForRubyV3/ecs-2014-11-13/ListAccountSettings) 

# ListAttributes


Lists the attributes for Amazon ECS resources within a specified target type and cluster. When you specify a target type and cluster, `ListAttributes` returns a list of attribute objects, one for each attribute on each resource. You can filter the list of results to a single attribute name to only return results that have that name. You can also filter the results by attribute name and value. You can do this, for example, to see which container instances in a cluster are running a Linux AMI (`ecs.os-type=linux`). 

## Request Syntax


```
{
   "attributeName": "string",
   "attributeValue": "string",
   "cluster": "string",
   "maxResults": number,
   "nextToken": "string",
   "targetType": "string"
}
```

## Request Parameters


For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [attributeName](#API_ListAttributes_RequestSyntax) **   <a name="ECS-ListAttributes-request-attributeName"></a>
The name of the attribute to filter the results with.   
Type: String  
Required: No

 ** [attributeValue](#API_ListAttributes_RequestSyntax) **   <a name="ECS-ListAttributes-request-attributeValue"></a>
The value of the attribute to filter results with. You must also specify an attribute name to use this parameter.  
Type: String  
Required: No

 ** [cluster](#API_ListAttributes_RequestSyntax) **   <a name="ECS-ListAttributes-request-cluster"></a>
The short name or full Amazon Resource Name (ARN) of the cluster to list attributes. If you do not specify a cluster, the default cluster is assumed.  
Type: String  
Required: No

 ** [maxResults](#API_ListAttributes_RequestSyntax) **   <a name="ECS-ListAttributes-request-maxResults"></a>
The maximum number of cluster results that `ListAttributes` returned in paginated output. When this parameter is used, `ListAttributes` only returns `maxResults` results in a single page along with a `nextToken` response element. The remaining results of the initial request can be seen by sending another `ListAttributes` request with the returned `nextToken` value. This value can be between 1 and 100. If this parameter isn't used, then `ListAttributes` returns up to 100 results and a `nextToken` value if applicable.  
Type: Integer  
Required: No

 ** [nextToken](#API_ListAttributes_RequestSyntax) **   <a name="ECS-ListAttributes-request-nextToken"></a>
The `nextToken` value returned from a `ListAttributes` request indicating that more results are available to fulfill the request and further calls are needed. If `maxResults` was provided, it's possible the number of results to be fewer than `maxResults`.  
This token should be treated as an opaque identifier that is only used to retrieve the next items in a list and not for other programmatic purposes.
Type: String  
Required: No

 ** [targetType](#API_ListAttributes_RequestSyntax) **   <a name="ECS-ListAttributes-request-targetType"></a>
The type of the target to list attributes with.  
Type: String  
Valid Values: `container-instance`   
Required: Yes

## Response Syntax


```
{
   "attributes": [ 
      { 
         "name": "string",
         "targetId": "string",
         "targetType": "string",
         "value": "string"
      }
   ],
   "nextToken": "string"
}
```

## 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.

 ** [attributes](#API_ListAttributes_ResponseSyntax) **   <a name="ECS-ListAttributes-response-attributes"></a>
A list of attribute objects that meet the criteria of the request.  
Type: Array of [Attribute](API_Attribute.md) objects

 ** [nextToken](#API_ListAttributes_ResponseSyntax) **   <a name="ECS-ListAttributes-response-nextToken"></a>
The `nextToken` value to include in a future `ListAttributes` request. When the results of a `ListAttributes` request exceed `maxResults`, this value can be used to retrieve the next page of results. This value is `null` when there are no more results to return.  
Type: String

## Errors


For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** ClusterNotFoundException **   
The specified cluster wasn't found. You can view your available clusters with [ListClusters](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_ListClusters.html). Amazon ECS clusters are Region specific.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** InvalidParameterException **   
The specified parameter isn't valid. Review the available parameters for the API request.  
For more information about service event errors, see [Amazon ECS service event messages](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/service-event-messages-list.html).     
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

## Examples


In the following example or examples, the Authorization header contents (`AUTHPARAMS`) must be replaced with an Amazon Signature Version 4 signature. For more information, see [Signature Version 4 Signing Process](https://docs.amazonaws.cn/general/latest/gr/signature-version-4.html) in the * Amazon General Reference*.

You only need to learn how to sign HTTP requests if you intend to create them manually. When you use the [Amazon Command Line Interface](http://www.amazonaws.cn/cli/) or one of the [Amazon SDKs](http://www.amazonaws.cn/tools/) to make requests to Amazon, these tools automatically sign the requests for you, with the access key that you specify when you configure the tools. When you use these tools, you don't have to sign requests yourself.

### Example


This example lists the attributes for container instances that have the `stack=production` attribute in the default cluster.

#### Sample Request


```
POST / HTTP/1.1
Host: ecs.us-west-2.amazonaws.com
Accept-Encoding: identity
Content-Length: 122
X-Amz-Target: AmazonEC2ContainerServiceV20141113.ListAttributes
X-Amz-Date: 20161222T181559Z
User-Agent: aws-cli/1.11.30 Python/2.7.12 Darwin/16.3.0 botocore/1.4.87
Content-Type: application/x-amz-json-1.1
Authorization: AUTHPARAMS

{
  "cluster": "default",
  "attributeName": "stack",
  "attributeValue": "production",
  "targetType": "container-instance"
}
```

#### Sample Response


```
HTTP/1.1 200 OK
Server: Server
Date: Thu, 22 Dec 2016 18:16:00 GMT
Content-Type: application/x-amz-json-1.1
Content-Length: 158
Connection: keep-alive
x-amzn-RequestId: b0eb3407-c872-11e6-a3b0-295902c79de2

{
  "attributes": [
    {
      "name": "stack",
      "targetId": "arn:aws:ecs:us-west-2:123456789012:container-instance/1c3be8ed-df30-47b4-8f1e-6e68ebd01f34",
      "value": "production"
    }
  ]
}
```

## See Also


For more information about using this API in one of the language-specific Amazon SDKs, see the following:
+  [Amazon Command Line Interface V2](https://docs.amazonaws.cn/goto/cli2/ecs-2014-11-13/ListAttributes) 
+  [Amazon SDK for .NET V4](https://docs.amazonaws.cn/goto/DotNetSDKV4/ecs-2014-11-13/ListAttributes) 
+  [Amazon SDK for C\$1\$1](https://docs.amazonaws.cn/goto/SdkForCpp/ecs-2014-11-13/ListAttributes) 
+  [Amazon SDK for Go v2](https://docs.amazonaws.cn/goto/SdkForGoV2/ecs-2014-11-13/ListAttributes) 
+  [Amazon SDK for Java V2](https://docs.amazonaws.cn/goto/SdkForJavaV2/ecs-2014-11-13/ListAttributes) 
+  [Amazon SDK for JavaScript V3](https://docs.amazonaws.cn/goto/SdkForJavaScriptV3/ecs-2014-11-13/ListAttributes) 
+  [Amazon SDK for Kotlin](https://docs.amazonaws.cn/goto/SdkForKotlin/ecs-2014-11-13/ListAttributes) 
+  [Amazon SDK for PHP V3](https://docs.amazonaws.cn/goto/SdkForPHPV3/ecs-2014-11-13/ListAttributes) 
+  [Amazon SDK for Python](https://docs.amazonaws.cn/goto/boto3/ecs-2014-11-13/ListAttributes) 
+  [Amazon SDK for Ruby V3](https://docs.amazonaws.cn/goto/SdkForRubyV3/ecs-2014-11-13/ListAttributes) 

# ListClusters


Returns a list of existing clusters.

## Request Syntax


```
{
   "maxResults": number,
   "nextToken": "string"
}
```

## Request Parameters


For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [maxResults](#API_ListClusters_RequestSyntax) **   <a name="ECS-ListClusters-request-maxResults"></a>
The maximum number of cluster results that `ListClusters` returned in paginated output. When this parameter is used, `ListClusters` only returns `maxResults` results in a single page along with a `nextToken` response element. The remaining results of the initial request can be seen by sending another `ListClusters` request with the returned `nextToken` value. This value can be between 1 and 100. If this parameter isn't used, then `ListClusters` returns up to 100 results and a `nextToken` value if applicable.  
Type: Integer  
Required: No

 ** [nextToken](#API_ListClusters_RequestSyntax) **   <a name="ECS-ListClusters-request-nextToken"></a>
The `nextToken` value returned from a `ListClusters` request indicating that more results are available to fulfill the request and further calls are needed. If `maxResults` was provided, it's possible the number of results to be fewer than `maxResults`.  
This token should be treated as an opaque identifier that is only used to retrieve the next items in a list and not for other programmatic purposes.
Type: String  
Required: No

## Response Syntax


```
{
   "clusterArns": [ "string" ],
   "nextToken": "string"
}
```

## 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.

 ** [clusterArns](#API_ListClusters_ResponseSyntax) **   <a name="ECS-ListClusters-response-clusterArns"></a>
The list of full Amazon Resource Name (ARN) entries for each cluster that's associated with your account.  
Type: Array of strings

 ** [nextToken](#API_ListClusters_ResponseSyntax) **   <a name="ECS-ListClusters-response-nextToken"></a>
The `nextToken` value to include in a future `ListClusters` request. When the results of a `ListClusters` request exceed `maxResults`, this value can be used to retrieve the next page of results. This value is `null` when there are no more results to return.  
Type: String

## Errors


For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** ClientException **   
These errors are usually caused by a client action. This client action might be using an action or resource on behalf of a user that doesn't have permissions to use the action or resource. Or, it might be specifying an identifier that isn't valid.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** InvalidParameterException **   
The specified parameter isn't valid. Review the available parameters for the API request.  
For more information about service event errors, see [Amazon ECS service event messages](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/service-event-messages-list.html).     
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ServerException **   
These errors are usually caused by a server issue.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 500

## Examples


In the following example or examples, the Authorization header contents (`AUTHPARAMS`) must be replaced with an Amazon Signature Version 4 signature. For more information, see [Signature Version 4 Signing Process](https://docs.amazonaws.cn/general/latest/gr/signature-version-4.html) in the * Amazon General Reference*.

You only need to learn how to sign HTTP requests if you intend to create them manually. When you use the [Amazon Command Line Interface](http://www.amazonaws.cn/cli/) or one of the [Amazon SDKs](http://www.amazonaws.cn/tools/) to make requests to Amazon, these tools automatically sign the requests for you, with the access key that you specify when you configure the tools. When you use these tools, you don't have to sign requests yourself.

### Example


This example request lists the clusters for your account.

#### Sample Request


```
POST / HTTP/1.1
Host: ecs.us-east-1.amazonaws.com
Accept-Encoding: identity
Content-Length: 2
X-Amz-Target: AmazonEC2ContainerServiceV20141113.ListClusters
X-Amz-Date: 20150429T170621Z
Content-Type: application/x-amz-json-1.1
Authorization: AUTHPARAMS

{}
```

#### Sample Response


```
HTTP/1.1 200 OK
Server: Server
Date: Wed, 29 Apr 2015 17:06:21 GMT
Content-Type: application/x-amz-json-1.1
Content-Length: 126
Connection: keep-alive
x-amzn-RequestId: 123a4b56-7c89-01d2-3ef4-example5678f

{
  "clusterArns": [
    "arn:aws:ecs:us-east-1:012345678910:cluster/My-cluster",
    "arn:aws:ecs:us-east-1:012345678910:cluster/default"
  ]
}
```

## See Also


For more information about using this API in one of the language-specific Amazon SDKs, see the following:
+  [Amazon Command Line Interface V2](https://docs.amazonaws.cn/goto/cli2/ecs-2014-11-13/ListClusters) 
+  [Amazon SDK for .NET V4](https://docs.amazonaws.cn/goto/DotNetSDKV4/ecs-2014-11-13/ListClusters) 
+  [Amazon SDK for C\$1\$1](https://docs.amazonaws.cn/goto/SdkForCpp/ecs-2014-11-13/ListClusters) 
+  [Amazon SDK for Go v2](https://docs.amazonaws.cn/goto/SdkForGoV2/ecs-2014-11-13/ListClusters) 
+  [Amazon SDK for Java V2](https://docs.amazonaws.cn/goto/SdkForJavaV2/ecs-2014-11-13/ListClusters) 
+  [Amazon SDK for JavaScript V3](https://docs.amazonaws.cn/goto/SdkForJavaScriptV3/ecs-2014-11-13/ListClusters) 
+  [Amazon SDK for Kotlin](https://docs.amazonaws.cn/goto/SdkForKotlin/ecs-2014-11-13/ListClusters) 
+  [Amazon SDK for PHP V3](https://docs.amazonaws.cn/goto/SdkForPHPV3/ecs-2014-11-13/ListClusters) 
+  [Amazon SDK for Python](https://docs.amazonaws.cn/goto/boto3/ecs-2014-11-13/ListClusters) 
+  [Amazon SDK for Ruby V3](https://docs.amazonaws.cn/goto/SdkForRubyV3/ecs-2014-11-13/ListClusters) 

# ListContainerInstances


Returns a list of container instances in a specified cluster. You can filter the results of a `ListContainerInstances` operation with cluster query language statements inside the `filter` parameter. For more information, see [Cluster Query Language](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/cluster-query-language.html) in the *Amazon Elastic Container Service Developer Guide*.

## Request Syntax


```
{
   "cluster": "string",
   "filter": "string",
   "maxResults": number,
   "nextToken": "string",
   "status": "string"
}
```

## Request Parameters


For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [cluster](#API_ListContainerInstances_RequestSyntax) **   <a name="ECS-ListContainerInstances-request-cluster"></a>
The short name or full Amazon Resource Name (ARN) of the cluster that hosts the container instances to list. If you do not specify a cluster, the default cluster is assumed.  
Type: String  
Required: No

 ** [filter](#API_ListContainerInstances_RequestSyntax) **   <a name="ECS-ListContainerInstances-request-filter"></a>
You can filter the results of a `ListContainerInstances` operation with cluster query language statements. For more information, see [Cluster Query Language](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/cluster-query-language.html) in the *Amazon Elastic Container Service Developer Guide*.  
Type: String  
Required: No

 ** [maxResults](#API_ListContainerInstances_RequestSyntax) **   <a name="ECS-ListContainerInstances-request-maxResults"></a>
The maximum number of container instance results that `ListContainerInstances` returned in paginated output. When this parameter is used, `ListContainerInstances` only returns `maxResults` results in a single page along with a `nextToken` response element. The remaining results of the initial request can be seen by sending another `ListContainerInstances` request with the returned `nextToken` value. This value can be between 1 and 100. If this parameter isn't used, then `ListContainerInstances` returns up to 100 results and a `nextToken` value if applicable.  
Type: Integer  
Required: No

 ** [nextToken](#API_ListContainerInstances_RequestSyntax) **   <a name="ECS-ListContainerInstances-request-nextToken"></a>
The `nextToken` value returned from a `ListContainerInstances` request indicating that more results are available to fulfill the request and further calls are needed. If `maxResults` was provided, it's possible the number of results to be fewer than `maxResults`.  
This token should be treated as an opaque identifier that is only used to retrieve the next items in a list and not for other programmatic purposes.
Type: String  
Required: No

 ** [status](#API_ListContainerInstances_RequestSyntax) **   <a name="ECS-ListContainerInstances-request-status"></a>
Filters the container instances by status. For example, if you specify the `DRAINING` status, the results include only container instances that have been set to `DRAINING` using [UpdateContainerInstancesState](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_UpdateContainerInstancesState.html). If you don't specify this parameter, the The default is to include container instances set to all states other than `INACTIVE`.  
Type: String  
Valid Values: `ACTIVE | DRAINING | REGISTERING | DEREGISTERING | REGISTRATION_FAILED`   
Required: No

## Response Syntax


```
{
   "containerInstanceArns": [ "string" ],
   "nextToken": "string"
}
```

## 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.

 ** [containerInstanceArns](#API_ListContainerInstances_ResponseSyntax) **   <a name="ECS-ListContainerInstances-response-containerInstanceArns"></a>
The list of container instances with full ARN entries for each container instance associated with the specified cluster.  
Type: Array of strings

 ** [nextToken](#API_ListContainerInstances_ResponseSyntax) **   <a name="ECS-ListContainerInstances-response-nextToken"></a>
The `nextToken` value to include in a future `ListContainerInstances` request. When the results of a `ListContainerInstances` request exceed `maxResults`, this value can be used to retrieve the next page of results. This value is `null` when there are no more results to return.  
Type: String

## Errors


For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** ClientException **   
These errors are usually caused by a client action. This client action might be using an action or resource on behalf of a user that doesn't have permissions to use the action or resource. Or, it might be specifying an identifier that isn't valid.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ClusterNotFoundException **   
The specified cluster wasn't found. You can view your available clusters with [ListClusters](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_ListClusters.html). Amazon ECS clusters are Region specific.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** InvalidParameterException **   
The specified parameter isn't valid. Review the available parameters for the API request.  
For more information about service event errors, see [Amazon ECS service event messages](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/service-event-messages-list.html).     
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ServerException **   
These errors are usually caused by a server issue.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 500

## Examples


In the following example or examples, the Authorization header contents (`AUTHPARAMS`) must be replaced with an Amazon Signature Version 4 signature. For more information, see [Signature Version 4 Signing Process](https://docs.amazonaws.cn/general/latest/gr/signature-version-4.html) in the * Amazon General Reference*.

You only need to learn how to sign HTTP requests if you intend to create them manually. When you use the [Amazon Command Line Interface](http://www.amazonaws.cn/cli/) or one of the [Amazon SDKs](http://www.amazonaws.cn/tools/) to make requests to Amazon, these tools automatically sign the requests for you, with the access key that you specify when you configure the tools. When you use these tools, you don't have to sign requests yourself.

### Example


This example request lists the container instances in the "example" cluster.

#### Sample Request


```
POST / HTTP/1.1
Host: ecs.us-east-1.amazonaws.com
Accept-Encoding: identity
Content-Length: 2
X-Amz-Target: AmazonEC2ContainerServiceV20141113.ListContainerInstances
X-Amz-Date: 20150429T175306Z
Content-Type: application/x-amz-json-1.1
Authorization: AUTHPARAMS

{"containerInstanceArns":["arn:aws:ecs:us-east-1:012345678910:container-instance/example/1eb22c8ab33149b397dc769f68cc1319","arn:aws:ecs:us-east-1:012345678910:container-instance/example/5cf7e311a2b74d3882650353cf3b2214"]}
```

#### Sample Response


```
HTTP/1.1 200 OK
Server: Server
Date: Wed, 29 Apr 2015 17:53:06 GMT
Content-Type: application/x-amz-json-1.1
Content-Length: 492
Connection: keep-alive
x-amzn-RequestId: 123a4b56-7c89-01d2-3ef4-example5678f

{
  "containerInstanceArns": [
    "arn:aws:ecs:us-east-1:012345678910:container-instance/example/1eb22c8ab33149b397dc769f68cc1319",
    "arn:aws:ecs:us-east-1:012345678910:container-instance/example/5cf7e311a2b74d3882650353cf3b2214"
  ]
}
```

## See Also


For more information about using this API in one of the language-specific Amazon SDKs, see the following:
+  [Amazon Command Line Interface V2](https://docs.amazonaws.cn/goto/cli2/ecs-2014-11-13/ListContainerInstances) 
+  [Amazon SDK for .NET V4](https://docs.amazonaws.cn/goto/DotNetSDKV4/ecs-2014-11-13/ListContainerInstances) 
+  [Amazon SDK for C\$1\$1](https://docs.amazonaws.cn/goto/SdkForCpp/ecs-2014-11-13/ListContainerInstances) 
+  [Amazon SDK for Go v2](https://docs.amazonaws.cn/goto/SdkForGoV2/ecs-2014-11-13/ListContainerInstances) 
+  [Amazon SDK for Java V2](https://docs.amazonaws.cn/goto/SdkForJavaV2/ecs-2014-11-13/ListContainerInstances) 
+  [Amazon SDK for JavaScript V3](https://docs.amazonaws.cn/goto/SdkForJavaScriptV3/ecs-2014-11-13/ListContainerInstances) 
+  [Amazon SDK for Kotlin](https://docs.amazonaws.cn/goto/SdkForKotlin/ecs-2014-11-13/ListContainerInstances) 
+  [Amazon SDK for PHP V3](https://docs.amazonaws.cn/goto/SdkForPHPV3/ecs-2014-11-13/ListContainerInstances) 
+  [Amazon SDK for Python](https://docs.amazonaws.cn/goto/boto3/ecs-2014-11-13/ListContainerInstances) 
+  [Amazon SDK for Ruby V3](https://docs.amazonaws.cn/goto/SdkForRubyV3/ecs-2014-11-13/ListContainerInstances) 

# ListDaemonDeployments


Returns a list of daemon deployments for a specified daemon. You can filter the results by status or creation time.

## Request Syntax


```
{
   "createdAt": { 
      "after": number,
      "before": number
   },
   "daemonArn": "string",
   "maxResults": number,
   "nextToken": "string",
   "status": [ "string" ]
}
```

## Request Parameters


For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [createdAt](#API_ListDaemonDeployments_RequestSyntax) **   <a name="ECS-ListDaemonDeployments-request-createdAt"></a>
An optional filter to narrow the `ListDaemonDeployments` results by creation time. If you don't specify a time range, all deployments are returned.  
Type: [CreatedAt](API_CreatedAt.md) object  
Required: No

 ** [daemonArn](#API_ListDaemonDeployments_RequestSyntax) **   <a name="ECS-ListDaemonDeployments-request-daemonArn"></a>
The Amazon Resource Name (ARN) of the daemon to list deployments for.  
Type: String  
Required: Yes

 ** [maxResults](#API_ListDaemonDeployments_RequestSyntax) **   <a name="ECS-ListDaemonDeployments-request-maxResults"></a>
The maximum number of daemon deployment results that `ListDaemonDeployments` returned in paginated output. When this parameter is used, `ListDaemonDeployments` only returns `maxResults` results in a single page along with a `nextToken` response element. The remaining results of the initial request can be seen by sending another `ListDaemonDeployments` request with the returned `nextToken` value. This value can be between 1 and 100. If this parameter isn't used, then `ListDaemonDeployments` returns up to 20 results and a `nextToken` value if applicable.  
Type: Integer  
Required: No

 ** [nextToken](#API_ListDaemonDeployments_RequestSyntax) **   <a name="ECS-ListDaemonDeployments-request-nextToken"></a>
The `nextToken` value returned from a `ListDaemonDeployments` request indicating that more results are available to fulfill the request and further calls will be needed. If `maxResults` was provided, it's possible for the number of results to be fewer than `maxResults`.  
This token should be treated as an opaque identifier that is only used to retrieve the next items in a list and not for other programmatic purposes.
Type: String  
Required: No

 ** [status](#API_ListDaemonDeployments_RequestSyntax) **   <a name="ECS-ListDaemonDeployments-request-status"></a>
An optional filter to narrow the `ListDaemonDeployments` results by deployment status. If you don't specify a status, all deployments are returned.  
Type: Array of strings  
Valid Values: `PENDING | SUCCESSFUL | STOPPED | STOP_REQUESTED | IN_PROGRESS | ROLLBACK_IN_PROGRESS | ROLLBACK_SUCCESSFUL | ROLLBACK_FAILED`   
Required: No

## Response Syntax


```
{
   "daemonDeployments": [ 
      { 
         "clusterArn": "string",
         "createdAt": number,
         "daemonArn": "string",
         "daemonDeploymentArn": "string",
         "finishedAt": number,
         "startedAt": number,
         "status": "string",
         "statusReason": "string",
         "stoppedAt": number,
         "targetDaemonRevisionArn": "string"
      }
   ],
   "nextToken": "string"
}
```

## 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.

 ** [daemonDeployments](#API_ListDaemonDeployments_ResponseSyntax) **   <a name="ECS-ListDaemonDeployments-response-daemonDeployments"></a>
The list of daemon deployment summaries.  
Type: Array of [DaemonDeploymentSummary](API_DaemonDeploymentSummary.md) objects

 ** [nextToken](#API_ListDaemonDeployments_ResponseSyntax) **   <a name="ECS-ListDaemonDeployments-response-nextToken"></a>
The `nextToken` value to include in a future `ListDaemonDeployments` request. When the results of a `ListDaemonDeployments` request exceed `maxResults`, this value can be used to retrieve the next page of results.  
Type: String

## Errors


For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** AccessDeniedException **   
You don't have authorization to perform the requested action.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ClientException **   
These errors are usually caused by a client action. This client action might be using an action or resource on behalf of a user that doesn't have permissions to use the action or resource. Or, it might be specifying an identifier that isn't valid.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ClusterNotFoundException **   
The specified cluster wasn't found. You can view your available clusters with [ListClusters](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_ListClusters.html). Amazon ECS clusters are Region specific.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** InvalidParameterException **   
The specified parameter isn't valid. Review the available parameters for the API request.  
For more information about service event errors, see [Amazon ECS service event messages](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/service-event-messages-list.html).     
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ServerException **   
These errors are usually caused by a server issue.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 500

 ** UnsupportedFeatureException **   
The specified task isn't supported in this Region.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

## Examples


In the following example or examples, the Authorization header contents (`AUTHPARAMS`) must be replaced with an Amazon Signature Version 4 signature. For more information, see [Signature Version 4 Signing Process](https://docs.amazonaws.cn/general/latest/gr/signature-version-4.html) in the * Amazon General Reference*.

You only need to learn how to sign HTTP requests if you intend to create them manually. When you use the [Amazon Command Line Interface](http://www.amazonaws.cn/cli/) or one of the [Amazon SDKs](http://www.amazonaws.cn/tools/) to make requests to Amazon, these tools automatically sign the requests for you, with the access key that you specify when you configure the tools. When you use these tools, you don't have to sign requests yourself.

### Example


This example lists all successful daemon deployments for the my-monitoring-daemon daemon.

#### Sample Request


```
POST / HTTP/1.1
Host: ecs.us-east-1.amazonaws.com
Accept-Encoding: identity
Content-Length: 130
X-Amz-Target: AmazonEC2ContainerServiceV20141113.ListDaemonDeployments
X-Amz-Date: 20250320T162000Z
Content-Type: application/x-amz-json-1.1
Authorization: AUTHPARAMS

{
  "daemonArn": "arn:aws:ecs:us-east-1:123456789012:daemon/my-cluster/my-monitoring-daemon",
  "status": [
    "SUCCESSFUL"
  ]
}
```

#### Sample Response


```
HTTP/1.1 200 OK
Server: Server
Date: Thu, 20 Mar 2025 16:20:00 GMT
Content-Type: application/x-amz-json-1.1
Content-Length: 721
Connection: keep-alive
x-amzn-RequestId: 123a4b56-7c89-01d2-3ef4-example5678f

{
  "daemonDeployments": [
    {
      "daemonDeploymentArn": "arn:aws:ecs:us-east-1:123456789012:daemon-deployment/my-cluster/my-monitoring-daemon/aB1cD2eF3gH4iJ5k",
      "daemonArn": "arn:aws:ecs:us-east-1:123456789012:daemon/my-cluster/my-monitoring-daemon",
      "clusterArn": "arn:aws:ecs:us-east-1:123456789012:cluster/my-cluster",
      "status": "SUCCESSFUL",
      "statusReason": "Deployment completed successfully.",
      "targetDaemonRevisionArn": "arn:aws:ecs:us-east-1:123456789012:daemon-revision/my-cluster/my-monitoring-daemon/4980306466373577095",
      "createdAt": "2025-03-15T12:00:00.000Z",
      "startedAt": "2025-03-15T12:00:05.000Z",
      "finishedAt": "2025-03-15T12:15:00.000Z"
    }
  ]
}
```

## See Also


For more information about using this API in one of the language-specific Amazon SDKs, see the following:
+  [Amazon Command Line Interface V2](https://docs.amazonaws.cn/goto/cli2/ecs-2014-11-13/ListDaemonDeployments) 
+  [Amazon SDK for .NET V4](https://docs.amazonaws.cn/goto/DotNetSDKV4/ecs-2014-11-13/ListDaemonDeployments) 
+  [Amazon SDK for C\$1\$1](https://docs.amazonaws.cn/goto/SdkForCpp/ecs-2014-11-13/ListDaemonDeployments) 
+  [Amazon SDK for Go v2](https://docs.amazonaws.cn/goto/SdkForGoV2/ecs-2014-11-13/ListDaemonDeployments) 
+  [Amazon SDK for Java V2](https://docs.amazonaws.cn/goto/SdkForJavaV2/ecs-2014-11-13/ListDaemonDeployments) 
+  [Amazon SDK for JavaScript V3](https://docs.amazonaws.cn/goto/SdkForJavaScriptV3/ecs-2014-11-13/ListDaemonDeployments) 
+  [Amazon SDK for Kotlin](https://docs.amazonaws.cn/goto/SdkForKotlin/ecs-2014-11-13/ListDaemonDeployments) 
+  [Amazon SDK for PHP V3](https://docs.amazonaws.cn/goto/SdkForPHPV3/ecs-2014-11-13/ListDaemonDeployments) 
+  [Amazon SDK for Python](https://docs.amazonaws.cn/goto/boto3/ecs-2014-11-13/ListDaemonDeployments) 
+  [Amazon SDK for Ruby V3](https://docs.amazonaws.cn/goto/SdkForRubyV3/ecs-2014-11-13/ListDaemonDeployments) 

# ListDaemons


Returns a list of daemons. You can filter the results by cluster or capacity provider.

## Request Syntax


```
{
   "capacityProviderArns": [ "string" ],
   "clusterArn": "string",
   "maxResults": number,
   "nextToken": "string"
}
```

## Request Parameters


For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [capacityProviderArns](#API_ListDaemons_RequestSyntax) **   <a name="ECS-ListDaemons-request-capacityProviderArns"></a>
The Amazon Resource Names (ARNs) of the capacity providers to filter daemons by. Only daemons associated with the specified capacity providers are returned.  
Type: Array of strings  
Required: No

 ** [clusterArn](#API_ListDaemons_RequestSyntax) **   <a name="ECS-ListDaemons-request-clusterArn"></a>
The Amazon Resource Name (ARN) of the cluster to filter daemons by. If not specified, daemons from all clusters are returned.  
Type: String  
Required: No

 ** [maxResults](#API_ListDaemons_RequestSyntax) **   <a name="ECS-ListDaemons-request-maxResults"></a>
The maximum number of daemon results that `ListDaemons` returned in paginated output. When this parameter is used, `ListDaemons` only returns `maxResults` results in a single page along with a `nextToken` response element. The remaining results of the initial request can be seen by sending another `ListDaemons` request with the returned `nextToken` value. This value can be between 1 and 100. If this parameter isn't used, then `ListDaemons` returns up to 100 results and a `nextToken` value if applicable.  
Type: Integer  
Required: No

 ** [nextToken](#API_ListDaemons_RequestSyntax) **   <a name="ECS-ListDaemons-request-nextToken"></a>
The `nextToken` value returned from a `ListDaemons` request indicating that more results are available to fulfill the request and further calls will be needed. If `maxResults` was provided, it's possible for the number of results to be fewer than `maxResults`.  
This token should be treated as an opaque identifier that is only used to retrieve the next items in a list and not for other programmatic purposes.
Type: String  
Required: No

## Response Syntax


```
{
   "daemonSummariesList": [ 
      { 
         "createdAt": number,
         "daemonArn": "string",
         "status": "string",
         "updatedAt": number
      }
   ],
   "nextToken": "string"
}
```

## 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.

 ** [daemonSummariesList](#API_ListDaemons_ResponseSyntax) **   <a name="ECS-ListDaemons-response-daemonSummariesList"></a>
The list of daemon summaries.  
Type: Array of [DaemonSummary](API_DaemonSummary.md) objects

 ** [nextToken](#API_ListDaemons_ResponseSyntax) **   <a name="ECS-ListDaemons-response-nextToken"></a>
The `nextToken` value to include in a future `ListDaemons` request. When the results of a `ListDaemons` request exceed `maxResults`, this value can be used to retrieve the next page of results.  
Type: String

## Errors


For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** AccessDeniedException **   
You don't have authorization to perform the requested action.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ClientException **   
These errors are usually caused by a client action. This client action might be using an action or resource on behalf of a user that doesn't have permissions to use the action or resource. Or, it might be specifying an identifier that isn't valid.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ClusterNotFoundException **   
The specified cluster wasn't found. You can view your available clusters with [ListClusters](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_ListClusters.html). Amazon ECS clusters are Region specific.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** InvalidParameterException **   
The specified parameter isn't valid. Review the available parameters for the API request.  
For more information about service event errors, see [Amazon ECS service event messages](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/service-event-messages-list.html).     
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ServerException **   
These errors are usually caused by a server issue.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 500

 ** UnsupportedFeatureException **   
The specified task isn't supported in this Region.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

## Examples


In the following example or examples, the Authorization header contents (`AUTHPARAMS`) must be replaced with an Amazon Signature Version 4 signature. For more information, see [Signature Version 4 Signing Process](https://docs.amazonaws.cn/general/latest/gr/signature-version-4.html) in the * Amazon General Reference*.

You only need to learn how to sign HTTP requests if you intend to create them manually. When you use the [Amazon Command Line Interface](http://www.amazonaws.cn/cli/) or one of the [Amazon SDKs](http://www.amazonaws.cn/tools/) to make requests to Amazon, these tools automatically sign the requests for you, with the access key that you specify when you configure the tools. When you use these tools, you don't have to sign requests yourself.

### Example


This example lists all daemons in the specified cluster.

#### Sample Request


```
POST / HTTP/1.1
Host: ecs.us-east-1.amazonaws.com
Accept-Encoding: identity
Content-Length: 75
X-Amz-Target: AmazonEC2ContainerServiceV20141113.ListDaemons
X-Amz-Date: 20250320T160500Z
Content-Type: application/x-amz-json-1.1
Authorization: AUTHPARAMS

{
  "clusterArn": "arn:aws:ecs:us-east-1:123456789012:cluster/my-cluster"
}
```

#### Sample Response


```
HTTP/1.1 200 OK
Server: Server
Date: Thu, 20 Mar 2025 16:05:00 GMT
Content-Type: application/x-amz-json-1.1
Content-Length: 486
Connection: keep-alive
x-amzn-RequestId: 123a4b56-7c89-01d2-3ef4-example5678f

{
  "daemonSummariesList": [
    {
      "daemonArn": "arn:aws:ecs:us-east-1:123456789012:daemon/my-cluster/my-monitoring-daemon",
      "status": "ACTIVE",
      "createdAt": "2025-03-15T12:00:00.000Z",
      "updatedAt": "2025-03-20T15:30:00.000Z"
    },
    {
      "daemonArn": "arn:aws:ecs:us-east-1:123456789012:daemon/my-cluster/my-logging-daemon",
      "status": "ACTIVE",
      "createdAt": "2025-03-16T09:00:00.000Z",
      "updatedAt": "2025-03-16T09:00:00.000Z"
    }
  ]
}
```

## See Also


For more information about using this API in one of the language-specific Amazon SDKs, see the following:
+  [Amazon Command Line Interface V2](https://docs.amazonaws.cn/goto/cli2/ecs-2014-11-13/ListDaemons) 
+  [Amazon SDK for .NET V4](https://docs.amazonaws.cn/goto/DotNetSDKV4/ecs-2014-11-13/ListDaemons) 
+  [Amazon SDK for C\$1\$1](https://docs.amazonaws.cn/goto/SdkForCpp/ecs-2014-11-13/ListDaemons) 
+  [Amazon SDK for Go v2](https://docs.amazonaws.cn/goto/SdkForGoV2/ecs-2014-11-13/ListDaemons) 
+  [Amazon SDK for Java V2](https://docs.amazonaws.cn/goto/SdkForJavaV2/ecs-2014-11-13/ListDaemons) 
+  [Amazon SDK for JavaScript V3](https://docs.amazonaws.cn/goto/SdkForJavaScriptV3/ecs-2014-11-13/ListDaemons) 
+  [Amazon SDK for Kotlin](https://docs.amazonaws.cn/goto/SdkForKotlin/ecs-2014-11-13/ListDaemons) 
+  [Amazon SDK for PHP V3](https://docs.amazonaws.cn/goto/SdkForPHPV3/ecs-2014-11-13/ListDaemons) 
+  [Amazon SDK for Python](https://docs.amazonaws.cn/goto/boto3/ecs-2014-11-13/ListDaemons) 
+  [Amazon SDK for Ruby V3](https://docs.amazonaws.cn/goto/SdkForRubyV3/ecs-2014-11-13/ListDaemons) 

# ListDaemonTaskDefinitions


Returns a list of daemon task definitions that are registered to your account. You can filter the results by family name, status, or both to find daemon task definitions that match your criteria.

## Request Syntax


```
{
   "family": "string",
   "familyPrefix": "string",
   "maxResults": number,
   "nextToken": "string",
   "revision": "string",
   "sort": "string",
   "status": "string"
}
```

## Request Parameters


For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [family](#API_ListDaemonTaskDefinitions_RequestSyntax) **   <a name="ECS-ListDaemonTaskDefinitions-request-family"></a>
The exact name of the daemon task definition family to filter results with.  
Type: String  
Required: No

 ** [familyPrefix](#API_ListDaemonTaskDefinitions_RequestSyntax) **   <a name="ECS-ListDaemonTaskDefinitions-request-familyPrefix"></a>
The full family name to filter the `ListDaemonTaskDefinitions` results with. Specifying a `familyPrefix` limits the listed daemon task definitions to daemon task definition families that start with the `familyPrefix` string.  
Type: String  
Required: No

 ** [maxResults](#API_ListDaemonTaskDefinitions_RequestSyntax) **   <a name="ECS-ListDaemonTaskDefinitions-request-maxResults"></a>
The maximum number of daemon task definition results that `ListDaemonTaskDefinitions` returned in paginated output. When this parameter is used, `ListDaemonTaskDefinitions` only returns `maxResults` results in a single page along with a `nextToken` response element. The remaining results of the initial request can be seen by sending another `ListDaemonTaskDefinitions` request with the returned `nextToken` value. This value can be between 1 and 100. If this parameter isn't used, then `ListDaemonTaskDefinitions` returns up to 100 results and a `nextToken` value if applicable.  
Type: Integer  
Required: No

 ** [nextToken](#API_ListDaemonTaskDefinitions_RequestSyntax) **   <a name="ECS-ListDaemonTaskDefinitions-request-nextToken"></a>
The `nextToken` value returned from a `ListDaemonTaskDefinitions` request indicating that more results are available to fulfill the request and further calls will be needed. If `maxResults` was provided, it's possible for the number of results to be fewer than `maxResults`.  
This token should be treated as an opaque identifier that is only used to retrieve the next items in a list and not for other programmatic purposes.
Type: String  
Required: No

 ** [revision](#API_ListDaemonTaskDefinitions_RequestSyntax) **   <a name="ECS-ListDaemonTaskDefinitions-request-revision"></a>
The revision filter to apply. Specify `LAST_REGISTERED` to return only the last registered revision for each daemon task definition family.  
Type: String  
Valid Values: `LAST_REGISTERED`   
Required: No

 ** [sort](#API_ListDaemonTaskDefinitions_RequestSyntax) **   <a name="ECS-ListDaemonTaskDefinitions-request-sort"></a>
The order to sort the results. Valid values are `ASC` and `DESC`. By default (`ASC`), daemon task definitions are listed in ascending order by family name and revision number.  
Type: String  
Valid Values: `ASC | DESC`   
Required: No

 ** [status](#API_ListDaemonTaskDefinitions_RequestSyntax) **   <a name="ECS-ListDaemonTaskDefinitions-request-status"></a>
The daemon task definition status to filter the `ListDaemonTaskDefinitions` results with. By default, only `ACTIVE` daemon task definitions are listed. If you set this parameter to `DELETE_IN_PROGRESS`, only daemon task definitions that are in the process of being deleted are listed. If you set this parameter to `ALL`, all daemon task definitions are listed regardless of status.  
Type: String  
Valid Values: `ACTIVE | DELETE_IN_PROGRESS | ALL`   
Required: No

## Response Syntax


```
{
   "daemonTaskDefinitions": [ 
      { 
         "arn": "string",
         "deleteRequestedAt": number,
         "registeredAt": number,
         "registeredBy": "string",
         "status": "string"
      }
   ],
   "nextToken": "string"
}
```

## 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.

 ** [daemonTaskDefinitions](#API_ListDaemonTaskDefinitions_ResponseSyntax) **   <a name="ECS-ListDaemonTaskDefinitions-response-daemonTaskDefinitions"></a>
The list of daemon task definition summaries.  
Type: Array of [DaemonTaskDefinitionSummary](API_DaemonTaskDefinitionSummary.md) objects

 ** [nextToken](#API_ListDaemonTaskDefinitions_ResponseSyntax) **   <a name="ECS-ListDaemonTaskDefinitions-response-nextToken"></a>
The `nextToken` value to include in a future `ListDaemonTaskDefinitions` request. When the results of a `ListDaemonTaskDefinitions` request exceed `maxResults`, this value can be used to retrieve the next page of results.  
Type: String

## Errors


For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** AccessDeniedException **   
You don't have authorization to perform the requested action.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ClientException **   
These errors are usually caused by a client action. This client action might be using an action or resource on behalf of a user that doesn't have permissions to use the action or resource. Or, it might be specifying an identifier that isn't valid.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** InvalidParameterException **   
The specified parameter isn't valid. Review the available parameters for the API request.  
For more information about service event errors, see [Amazon ECS service event messages](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/service-event-messages-list.html).     
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ServerException **   
These errors are usually caused by a server issue.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 500

## Examples


In the following example or examples, the Authorization header contents (`AUTHPARAMS`) must be replaced with an Amazon Signature Version 4 signature. For more information, see [Signature Version 4 Signing Process](https://docs.amazonaws.cn/general/latest/gr/signature-version-4.html) in the * Amazon General Reference*.

You only need to learn how to sign HTTP requests if you intend to create them manually. When you use the [Amazon Command Line Interface](http://www.amazonaws.cn/cli/) or one of the [Amazon SDKs](http://www.amazonaws.cn/tools/) to make requests to Amazon, these tools automatically sign the requests for you, with the access key that you specify when you configure the tools. When you use these tools, you don't have to sign requests yourself.

### Example


This example lists all daemon task definitions in your account that start with the monitoring prefix.

#### Sample Request


```
POST / HTTP/1.1
Host: ecs.us-east-1.amazonaws.com
Accept-Encoding: identity
X-Amz-Target: AmazonEC2ContainerServiceV20141113.ListDaemonTaskDefinitions
X-Amz-Date: 20250315T103000Z
Content-Type: application/x-amz-json-1.1
Authorization: AUTHPARAMS

{
  "familyPrefix": "monitoring"
}
```

#### Sample Response


```
HTTP/1.1 200 OK
Server: Server
Date: Sat, 15 Mar 2025 10:30:00 GMT
Content-Type: application/x-amz-json-1.1
Content-Length: 354
Connection: keep-alive
x-amzn-RequestId: 123a4b56-7c89-01d2-3ef4-example5678f

{
  "daemonTaskDefinitions": [
    {
      "arn": "arn:aws:ecs:us-east-1:123456789012:daemon-task-definition/monitoring-agent:2",
      "registeredAt": "2025-03-20T14:00:00.000Z",
      "registeredBy": "arn:aws:iam::123456789012:user/admin",
      "status": "ACTIVE"
    },
    {
      "arn": "arn:aws:ecs:us-east-1:123456789012:daemon-task-definition/monitoring-agent:1",
      "registeredAt": "2025-03-15T10:30:00.000Z",
      "registeredBy": "arn:aws:iam::123456789012:user/admin",
      "status": "ACTIVE"
    }
  ]
}
```

## See Also


For more information about using this API in one of the language-specific Amazon SDKs, see the following:
+  [Amazon Command Line Interface V2](https://docs.amazonaws.cn/goto/cli2/ecs-2014-11-13/ListDaemonTaskDefinitions) 
+  [Amazon SDK for .NET V4](https://docs.amazonaws.cn/goto/DotNetSDKV4/ecs-2014-11-13/ListDaemonTaskDefinitions) 
+  [Amazon SDK for C\$1\$1](https://docs.amazonaws.cn/goto/SdkForCpp/ecs-2014-11-13/ListDaemonTaskDefinitions) 
+  [Amazon SDK for Go v2](https://docs.amazonaws.cn/goto/SdkForGoV2/ecs-2014-11-13/ListDaemonTaskDefinitions) 
+  [Amazon SDK for Java V2](https://docs.amazonaws.cn/goto/SdkForJavaV2/ecs-2014-11-13/ListDaemonTaskDefinitions) 
+  [Amazon SDK for JavaScript V3](https://docs.amazonaws.cn/goto/SdkForJavaScriptV3/ecs-2014-11-13/ListDaemonTaskDefinitions) 
+  [Amazon SDK for Kotlin](https://docs.amazonaws.cn/goto/SdkForKotlin/ecs-2014-11-13/ListDaemonTaskDefinitions) 
+  [Amazon SDK for PHP V3](https://docs.amazonaws.cn/goto/SdkForPHPV3/ecs-2014-11-13/ListDaemonTaskDefinitions) 
+  [Amazon SDK for Python](https://docs.amazonaws.cn/goto/boto3/ecs-2014-11-13/ListDaemonTaskDefinitions) 
+  [Amazon SDK for Ruby V3](https://docs.amazonaws.cn/goto/SdkForRubyV3/ecs-2014-11-13/ListDaemonTaskDefinitions) 

# ListServiceDeployments


This operation lists all the service deployments that meet the specified filter criteria.

A service deployment happens when you release a software update for the service. You route traffic from the running service revisions to the new service revison and control the number of running tasks. 

This API returns the values that you use for the request parameters in [DescribeServiceRevisions](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_DescribeServiceRevisions.html).

## Request Syntax


```
{
   "cluster": "string",
   "createdAt": { 
      "after": number,
      "before": number
   },
   "maxResults": number,
   "nextToken": "string",
   "service": "string",
   "status": [ "string" ]
}
```

## Request Parameters


For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [cluster](#API_ListServiceDeployments_RequestSyntax) **   <a name="ECS-ListServiceDeployments-request-cluster"></a>
The cluster that hosts the service. This can either be the cluster name or ARN. 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. If you don't specify a cluster, `default` is used.  
Type: String  
Required: No

 ** [createdAt](#API_ListServiceDeployments_RequestSyntax) **   <a name="ECS-ListServiceDeployments-request-createdAt"></a>
An optional filter you can use to narrow the results by the service creation date. If you do not specify a value, the result includes all services created before the current time. The format is yyyy-MM-dd HH:mm:ss.SSSSSS.  
Type: [CreatedAt](API_CreatedAt.md) object  
Required: No

 ** [maxResults](#API_ListServiceDeployments_RequestSyntax) **   <a name="ECS-ListServiceDeployments-request-maxResults"></a>
The maximum number of service deployment results that `ListServiceDeployments` returned in paginated output. When this parameter is used, `ListServiceDeployments` only returns `maxResults` results in a single page along with a `nextToken` response element. The remaining results of the initial request can be seen by sending another `ListServiceDeployments` request with the returned `nextToken` value. This value can be between 1 and 100. If this parameter isn't used, then `ListServiceDeployments` returns up to 20 results and a `nextToken` value if applicable.  
Type: Integer  
Required: No

 ** [nextToken](#API_ListServiceDeployments_RequestSyntax) **   <a name="ECS-ListServiceDeployments-request-nextToken"></a>
The `nextToken` value returned from a `ListServiceDeployments` request indicating that more results are available to fulfill the request and further calls are needed. If you provided `maxResults`, it's possible the number of results is fewer than `maxResults`.  
Type: String  
Required: No

 ** [service](#API_ListServiceDeployments_RequestSyntax) **   <a name="ECS-ListServiceDeployments-request-service"></a>
The ARN or name of the service  
Type: String  
Required: Yes

 ** [status](#API_ListServiceDeployments_RequestSyntax) **   <a name="ECS-ListServiceDeployments-request-status"></a>
An optional filter you can use to narrow the results. If you do not specify a status, then all status values are included in the result.  
Type: Array of strings  
Valid Values: `PENDING | SUCCESSFUL | STOPPED | STOP_REQUESTED | IN_PROGRESS | ROLLBACK_REQUESTED | ROLLBACK_IN_PROGRESS | ROLLBACK_SUCCESSFUL | ROLLBACK_FAILED`   
Required: No

## Response Syntax


```
{
   "nextToken": "string",
   "serviceDeployments": [ 
      { 
         "clusterArn": "string",
         "createdAt": number,
         "finishedAt": number,
         "serviceArn": "string",
         "serviceDeploymentArn": "string",
         "startedAt": number,
         "status": "string",
         "statusReason": "string",
         "targetServiceRevisionArn": "string"
      }
   ]
}
```

## 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.

 ** [nextToken](#API_ListServiceDeployments_ResponseSyntax) **   <a name="ECS-ListServiceDeployments-response-nextToken"></a>
The `nextToken` value to include in a future `ListServiceDeployments` request. When the results of a `ListServiceDeployments` request exceed `maxResults`, this value can be used to retrieve the next page of results. This value is null when there are no more results to return.  
Type: String

 ** [serviceDeployments](#API_ListServiceDeployments_ResponseSyntax) **   <a name="ECS-ListServiceDeployments-response-serviceDeployments"></a>
An overview of the service deployment, including the following properties:  
+ The ARN of the service deployment.
+ The ARN of the service being deployed.
+ The ARN of the cluster that hosts the service in the service deployment.
+ The time that the service deployment started.
+ The time that the service deployment completed.
+ The service deployment status.
+ Information about why the service deployment is in the current state.
+ The ARN of the service revision that is being deployed.
Type: Array of [ServiceDeploymentBrief](API_ServiceDeploymentBrief.md) objects

## Errors


For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** AccessDeniedException **   
You don't have authorization to perform the requested action.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ClientException **   
These errors are usually caused by a client action. This client action might be using an action or resource on behalf of a user that doesn't have permissions to use the action or resource. Or, it might be specifying an identifier that isn't valid.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** InvalidParameterException **   
The specified parameter isn't valid. Review the available parameters for the API request.  
For more information about service event errors, see [Amazon ECS service event messages](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/service-event-messages-list.html).     
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ServerException **   
These errors are usually caused by a server issue.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 500

 ** ServiceNotFoundException **   
The specified service wasn't found. You can view your available services with [ListServices](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_ListServices.html). Amazon ECS services are cluster specific and Region specific.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** UnsupportedFeatureException **   
The specified task isn't supported in this Region.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

## Examples


### Example


This example request lists the service deployments for the `sd-example` service on the `example` cluster.

#### Sample Request


```
POST / HTTP/1.1
Host: ecs.us-west-2.amazonaws.com
Accept-Encoding: identity
Content-Length: 55
X-Amz-Target: AmazonEC2ContainerServiceV20141113.DescribeServiceDeployments
X-Amz-Date: 20150528T163859Z
User-Agent: aws-cli/2.17 Python/3.11.9 Darwin/14.3.0
Content-Type: application/x-amz-json-1.1
Authorization: AUTHPARAMS
{
  "cluster": "example",
  "service": "sd-example"
}
```

#### Sample Response


```
HTTP/1.1 200 OK
Server: Server
Date: Tue, 10 Sep 2024 18:50:14 GMT
Content-Type: application/x-amz-json-1.1
Content-Length: 220
Connection: keep-alive
RequestId: 360c5551-123e-4e74-9914-7582d3a28807
{
    "serviceDeployments": [
        {
            "serviceDeploymentArn": "arn:aws:ecs:us-west-2:123456789012:service-deployment/example/sd-example/NCWGC2ZR-taawPAYrIaU5",
            "serviceArn": "arn:aws:ecs:us-west-2:123456789012:service/example/sd-example",
            "clusterArn": "arn:aws:ecs:us-west-2:123456789012:cluster/example",
            "targetServiceRevisionArn": "arn:aws:ecs:us-west-2:123456789012:service-revision/example/sd-example/4980306466373577095",
            "status": "SUCCESSFUL"
        }
    ]
}
```

## See Also


For more information about using this API in one of the language-specific Amazon SDKs, see the following:
+  [Amazon Command Line Interface V2](https://docs.amazonaws.cn/goto/cli2/ecs-2014-11-13/ListServiceDeployments) 
+  [Amazon SDK for .NET V4](https://docs.amazonaws.cn/goto/DotNetSDKV4/ecs-2014-11-13/ListServiceDeployments) 
+  [Amazon SDK for C\$1\$1](https://docs.amazonaws.cn/goto/SdkForCpp/ecs-2014-11-13/ListServiceDeployments) 
+  [Amazon SDK for Go v2](https://docs.amazonaws.cn/goto/SdkForGoV2/ecs-2014-11-13/ListServiceDeployments) 
+  [Amazon SDK for Java V2](https://docs.amazonaws.cn/goto/SdkForJavaV2/ecs-2014-11-13/ListServiceDeployments) 
+  [Amazon SDK for JavaScript V3](https://docs.amazonaws.cn/goto/SdkForJavaScriptV3/ecs-2014-11-13/ListServiceDeployments) 
+  [Amazon SDK for Kotlin](https://docs.amazonaws.cn/goto/SdkForKotlin/ecs-2014-11-13/ListServiceDeployments) 
+  [Amazon SDK for PHP V3](https://docs.amazonaws.cn/goto/SdkForPHPV3/ecs-2014-11-13/ListServiceDeployments) 
+  [Amazon SDK for Python](https://docs.amazonaws.cn/goto/boto3/ecs-2014-11-13/ListServiceDeployments) 
+  [Amazon SDK for Ruby V3](https://docs.amazonaws.cn/goto/SdkForRubyV3/ecs-2014-11-13/ListServiceDeployments) 

# ListServices


Returns a list of services. You can filter the results by cluster, launch type, and scheduling strategy.

## Request Syntax


```
{
   "cluster": "string",
   "launchType": "string",
   "maxResults": number,
   "nextToken": "string",
   "resourceManagementType": "string",
   "schedulingStrategy": "string"
}
```

## Request Parameters


For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [cluster](#API_ListServices_RequestSyntax) **   <a name="ECS-ListServices-request-cluster"></a>
The short name or full Amazon Resource Name (ARN) of the cluster to use when filtering the `ListServices` results. If you do not specify a cluster, the default cluster is assumed.  
Type: String  
Required: No

 ** [launchType](#API_ListServices_RequestSyntax) **   <a name="ECS-ListServices-request-launchType"></a>
The launch type to use when filtering the `ListServices` results.  
Type: String  
Valid Values: `EC2 | FARGATE | EXTERNAL | MANAGED_INSTANCES`   
Required: No

 ** [maxResults](#API_ListServices_RequestSyntax) **   <a name="ECS-ListServices-request-maxResults"></a>
The maximum number of service results that `ListServices` returned in paginated output. When this parameter is used, `ListServices` only returns `maxResults` results in a single page along with a `nextToken` response element. The remaining results of the initial request can be seen by sending another `ListServices` request with the returned `nextToken` value. This value can be between 1 and 100. If this parameter isn't used, then `ListServices` returns up to 10 results and a `nextToken` value if applicable.  
Type: Integer  
Required: No

 ** [nextToken](#API_ListServices_RequestSyntax) **   <a name="ECS-ListServices-request-nextToken"></a>
The `nextToken` value returned from a `ListServices` request indicating that more results are available to fulfill the request and further calls will be needed. If `maxResults` was provided, it is possible the number of results to be fewer than `maxResults`.  
This token should be treated as an opaque identifier that is only used to retrieve the next items in a list and not for other programmatic purposes.
Type: String  
Required: No

 ** [resourceManagementType](#API_ListServices_RequestSyntax) **   <a name="ECS-ListServices-request-resourceManagementType"></a>
The resourceManagementType type to use when filtering the `ListServices` results.  
Type: String  
Valid Values: `CUSTOMER | ECS`   
Required: No

 ** [schedulingStrategy](#API_ListServices_RequestSyntax) **   <a name="ECS-ListServices-request-schedulingStrategy"></a>
The scheduling strategy to use when filtering the `ListServices` results.  
Type: String  
Valid Values: `REPLICA | DAEMON`   
Required: No

## Response Syntax


```
{
   "nextToken": "string",
   "serviceArns": [ "string" ]
}
```

## 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.

 ** [nextToken](#API_ListServices_ResponseSyntax) **   <a name="ECS-ListServices-response-nextToken"></a>
The `nextToken` value to include in a future `ListServices` request. When the results of a `ListServices` request exceed `maxResults`, this value can be used to retrieve the next page of results. This value is `null` when there are no more results to return.  
Type: String

 ** [serviceArns](#API_ListServices_ResponseSyntax) **   <a name="ECS-ListServices-response-serviceArns"></a>
The list of full ARN entries for each service that's associated with the specified cluster.  
Type: Array of strings

## Errors


For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** ClientException **   
These errors are usually caused by a client action. This client action might be using an action or resource on behalf of a user that doesn't have permissions to use the action or resource. Or, it might be specifying an identifier that isn't valid.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ClusterNotFoundException **   
The specified cluster wasn't found. You can view your available clusters with [ListClusters](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_ListClusters.html). Amazon ECS clusters are Region specific.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** InvalidParameterException **   
The specified parameter isn't valid. Review the available parameters for the API request.  
For more information about service event errors, see [Amazon ECS service event messages](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/service-event-messages-list.html).     
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ServerException **   
These errors are usually caused by a server issue.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 500

## Examples


In the following example or examples, the Authorization header contents (`AUTHPARAMS`) must be replaced with an Amazon Signature Version 4 signature. For more information, see [Signature Version 4 Signing Process](https://docs.amazonaws.cn/general/latest/gr/signature-version-4.html) in the * Amazon General Reference*.

You only need to learn how to sign HTTP requests if you intend to create them manually. When you use the [Amazon Command Line Interface](http://www.amazonaws.cn/cli/) or one of the [Amazon SDKs](http://www.amazonaws.cn/tools/) to make requests to Amazon, these tools automatically sign the requests for you, with the access key that you specify when you configure the tools. When you use these tools, you don't have to sign requests yourself.

### Example


This example request lists the services in the default cluster.

#### Sample Request


```
POST / HTTP/1.1
Host: ecs.us-east-1.amazonaws.com
Accept-Encoding: identity
Content-Length: 2
X-Amz-Target: AmazonEC2ContainerServiceV20141113.ListServices
X-Amz-Date: 20150429T191342Z
Content-Type: application/x-amz-json-1.1
Authorization: AUTHPARAMS

{}
```

#### Sample Response


```
HTTP/1.1 200 OK
Server: Server
Date: Wed, 29 Apr 2015 19:13:42 GMT
Content-Type: application/x-amz-json-1.1
Content-Length: 138
Connection: keep-alive
x-amzn-RequestId: 123a4b56-7c89-01d2-3ef4-example5678f

{
  "serviceArns": [
    "arn:aws:ecs:us-east-1:012345678910:service/hello_world",
    "arn:aws:ecs:us-east-1:012345678910:service/ecs-simple-service"
  ]
}
```

## See Also


For more information about using this API in one of the language-specific Amazon SDKs, see the following:
+  [Amazon Command Line Interface V2](https://docs.amazonaws.cn/goto/cli2/ecs-2014-11-13/ListServices) 
+  [Amazon SDK for .NET V4](https://docs.amazonaws.cn/goto/DotNetSDKV4/ecs-2014-11-13/ListServices) 
+  [Amazon SDK for C\$1\$1](https://docs.amazonaws.cn/goto/SdkForCpp/ecs-2014-11-13/ListServices) 
+  [Amazon SDK for Go v2](https://docs.amazonaws.cn/goto/SdkForGoV2/ecs-2014-11-13/ListServices) 
+  [Amazon SDK for Java V2](https://docs.amazonaws.cn/goto/SdkForJavaV2/ecs-2014-11-13/ListServices) 
+  [Amazon SDK for JavaScript V3](https://docs.amazonaws.cn/goto/SdkForJavaScriptV3/ecs-2014-11-13/ListServices) 
+  [Amazon SDK for Kotlin](https://docs.amazonaws.cn/goto/SdkForKotlin/ecs-2014-11-13/ListServices) 
+  [Amazon SDK for PHP V3](https://docs.amazonaws.cn/goto/SdkForPHPV3/ecs-2014-11-13/ListServices) 
+  [Amazon SDK for Python](https://docs.amazonaws.cn/goto/boto3/ecs-2014-11-13/ListServices) 
+  [Amazon SDK for Ruby V3](https://docs.amazonaws.cn/goto/SdkForRubyV3/ecs-2014-11-13/ListServices) 

# ListServicesByNamespace


This operation lists all of the services that are associated with a Amazon Cloud Map namespace. This list might include services in different clusters. In contrast, `ListServices` can only list services in one cluster at a time. If you need to filter the list of services in a single cluster by various parameters, use `ListServices`. For more information, see [Service Connect](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/service-connect.html) in the *Amazon Elastic Container Service Developer Guide*.

## Request Syntax


```
{
   "maxResults": number,
   "namespace": "string",
   "nextToken": "string"
}
```

## Request Parameters


For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [maxResults](#API_ListServicesByNamespace_RequestSyntax) **   <a name="ECS-ListServicesByNamespace-request-maxResults"></a>
The maximum number of service results that `ListServicesByNamespace` returns in paginated output. When this parameter is used, `ListServicesByNamespace` only returns `maxResults` results in a single page along with a `nextToken` response element. The remaining results of the initial request can be seen by sending another `ListServicesByNamespace` request with the returned `nextToken` value. This value can be between 1 and 100. If this parameter isn't used, then `ListServicesByNamespace` returns up to 10 results and a `nextToken` value if applicable.  
Type: Integer  
Required: No

 ** [namespace](#API_ListServicesByNamespace_RequestSyntax) **   <a name="ECS-ListServicesByNamespace-request-namespace"></a>
The namespace name or full Amazon Resource Name (ARN) of the Amazon Cloud Map namespace to list the services in.  
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](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/service-connect.html) in the *Amazon Elastic Container Service Developer Guide*.  
Type: String  
Required: Yes

 ** [nextToken](#API_ListServicesByNamespace_RequestSyntax) **   <a name="ECS-ListServicesByNamespace-request-nextToken"></a>
The `nextToken` value that's returned from a `ListServicesByNamespace` request. It indicates that more results are available to fulfill the request and further calls are needed. If `maxResults` is returned, it is possible the number of results is less than `maxResults`.  
Type: String  
Required: No

## Response Syntax


```
{
   "nextToken": "string",
   "serviceArns": [ "string" ]
}
```

## 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.

 ** [nextToken](#API_ListServicesByNamespace_ResponseSyntax) **   <a name="ECS-ListServicesByNamespace-response-nextToken"></a>
The `nextToken` value to include in a future `ListServicesByNamespace` request. When the results of a `ListServicesByNamespace` request exceed `maxResults`, this value can be used to retrieve the next page of results. When there are no more results to return, this value is `null`.  
Type: String

 ** [serviceArns](#API_ListServicesByNamespace_ResponseSyntax) **   <a name="ECS-ListServicesByNamespace-response-serviceArns"></a>
The list of full ARN entries for each service that's associated with the specified namespace.  
Type: Array of strings

## Errors


For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** ClientException **   
These errors are usually caused by a client action. This client action might be using an action or resource on behalf of a user that doesn't have permissions to use the action or resource. Or, it might be specifying an identifier that isn't valid.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** InvalidParameterException **   
The specified parameter isn't valid. Review the available parameters for the API request.  
For more information about service event errors, see [Amazon ECS service event messages](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/service-event-messages-list.html).     
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** NamespaceNotFoundException **   
The specified namespace wasn't found.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ServerException **   
These errors are usually caused by a server issue.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 500

## See Also


For more information about using this API in one of the language-specific Amazon SDKs, see the following:
+  [Amazon Command Line Interface V2](https://docs.amazonaws.cn/goto/cli2/ecs-2014-11-13/ListServicesByNamespace) 
+  [Amazon SDK for .NET V4](https://docs.amazonaws.cn/goto/DotNetSDKV4/ecs-2014-11-13/ListServicesByNamespace) 
+  [Amazon SDK for C\$1\$1](https://docs.amazonaws.cn/goto/SdkForCpp/ecs-2014-11-13/ListServicesByNamespace) 
+  [Amazon SDK for Go v2](https://docs.amazonaws.cn/goto/SdkForGoV2/ecs-2014-11-13/ListServicesByNamespace) 
+  [Amazon SDK for Java V2](https://docs.amazonaws.cn/goto/SdkForJavaV2/ecs-2014-11-13/ListServicesByNamespace) 
+  [Amazon SDK for JavaScript V3](https://docs.amazonaws.cn/goto/SdkForJavaScriptV3/ecs-2014-11-13/ListServicesByNamespace) 
+  [Amazon SDK for Kotlin](https://docs.amazonaws.cn/goto/SdkForKotlin/ecs-2014-11-13/ListServicesByNamespace) 
+  [Amazon SDK for PHP V3](https://docs.amazonaws.cn/goto/SdkForPHPV3/ecs-2014-11-13/ListServicesByNamespace) 
+  [Amazon SDK for Python](https://docs.amazonaws.cn/goto/boto3/ecs-2014-11-13/ListServicesByNamespace) 
+  [Amazon SDK for Ruby V3](https://docs.amazonaws.cn/goto/SdkForRubyV3/ecs-2014-11-13/ListServicesByNamespace) 

# ListTagsForResource


List the tags for an Amazon ECS resource.

## Request Syntax


```
{
   "resourceArn": "string"
}
```

## Request Parameters


For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [resourceArn](#API_ListTagsForResource_RequestSyntax) **   <a name="ECS-ListTagsForResource-request-resourceArn"></a>
The Amazon Resource Name (ARN) that identifies the resource to list the tags for. Currently, the supported resources are Amazon ECS tasks, services, task definitions, clusters, and container instances.  
Type: String  
Required: Yes

## Response Syntax


```
{
   "tags": [ 
      { 
         "key": "string",
         "value": "string"
      }
   ]
}
```

## 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.

 ** [tags](#API_ListTagsForResource_ResponseSyntax) **   <a name="ECS-ListTagsForResource-response-tags"></a>
The tags for the resource.  
Type: Array of [Tag](API_Tag.md) objects  
Array Members: Minimum number of 0 items. Maximum number of 50 items.

## Errors


For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** ClientException **   
These errors are usually caused by a client action. This client action might be using an action or resource on behalf of a user that doesn't have permissions to use the action or resource. Or, it might be specifying an identifier that isn't valid.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ClusterNotFoundException **   
The specified cluster wasn't found. You can view your available clusters with [ListClusters](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_ListClusters.html). Amazon ECS clusters are Region specific.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** InvalidParameterException **   
The specified parameter isn't valid. Review the available parameters for the API request.  
For more information about service event errors, see [Amazon ECS service event messages](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/service-event-messages-list.html).     
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ServerException **   
These errors are usually caused by a server issue.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 500

## Examples


In the following example or examples, the Authorization header contents (`AUTHPARAMS`) must be replaced with an Amazon Signature Version 4 signature. For more information, see [Signature Version 4 Signing Process](https://docs.amazonaws.cn/general/latest/gr/signature-version-4.html) in the * Amazon General Reference*.

You only need to learn how to sign HTTP requests if you intend to create them manually. When you use the [Amazon Command Line Interface](http://www.amazonaws.cn/cli/) or one of the [Amazon SDKs](http://www.amazonaws.cn/tools/) to make requests to Amazon, these tools automatically sign the requests for you, with the access key that you specify when you configure the tools. When you use these tools, you don't have to sign requests yourself.

### Example


This example lists the tags for the `dev` cluster.

#### Sample Request


```
POST / HTTP/1.1
Host: ecs.us-west-2.amazonaws.com
Accept-Encoding: identity
X-Amz-Target: AmazonEC2ContainerServiceV20141113.ListTagsForResource
Content-Type: application/x-amz-json-1.1
X-Amz-Date: 20181026T195430Z
Authorization: AUTHPARAMS
Content-Length: 72

{  
   "resourceArn":"arn:aws:ecs:us-west-2:012345678910:cluster/dev"
}
```

#### Sample Response


```
HTTP/1.1 200 OK
x-amzn-RequestId: 123a4b56-7c89-01d2-3ef4-example5678f
Content-Type: application/x-amz-json-1.1
Content-Length: 39
Date: Fri, 26 Oct 2018 19:54:31 GMT

{  
   "tags":[  
      {  
         "key":"team",
         "value":"dev"
      }
   ]
}
```

## See Also


For more information about using this API in one of the language-specific Amazon SDKs, see the following:
+  [Amazon Command Line Interface V2](https://docs.amazonaws.cn/goto/cli2/ecs-2014-11-13/ListTagsForResource) 
+  [Amazon SDK for .NET V4](https://docs.amazonaws.cn/goto/DotNetSDKV4/ecs-2014-11-13/ListTagsForResource) 
+  [Amazon SDK for C\$1\$1](https://docs.amazonaws.cn/goto/SdkForCpp/ecs-2014-11-13/ListTagsForResource) 
+  [Amazon SDK for Go v2](https://docs.amazonaws.cn/goto/SdkForGoV2/ecs-2014-11-13/ListTagsForResource) 
+  [Amazon SDK for Java V2](https://docs.amazonaws.cn/goto/SdkForJavaV2/ecs-2014-11-13/ListTagsForResource) 
+  [Amazon SDK for JavaScript V3](https://docs.amazonaws.cn/goto/SdkForJavaScriptV3/ecs-2014-11-13/ListTagsForResource) 
+  [Amazon SDK for Kotlin](https://docs.amazonaws.cn/goto/SdkForKotlin/ecs-2014-11-13/ListTagsForResource) 
+  [Amazon SDK for PHP V3](https://docs.amazonaws.cn/goto/SdkForPHPV3/ecs-2014-11-13/ListTagsForResource) 
+  [Amazon SDK for Python](https://docs.amazonaws.cn/goto/boto3/ecs-2014-11-13/ListTagsForResource) 
+  [Amazon SDK for Ruby V3](https://docs.amazonaws.cn/goto/SdkForRubyV3/ecs-2014-11-13/ListTagsForResource) 

# ListTaskDefinitionFamilies


Returns a list of task definition families that are registered to your account. This list includes task definition families that no longer have any `ACTIVE` task definition revisions.

You can filter out task definition families that don't contain any `ACTIVE` task definition revisions by setting the `status` parameter to `ACTIVE`. You can also filter the results with the `familyPrefix` parameter.

## Request Syntax


```
{
   "familyPrefix": "string",
   "maxResults": number,
   "nextToken": "string",
   "status": "string"
}
```

## Request Parameters


For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [familyPrefix](#API_ListTaskDefinitionFamilies_RequestSyntax) **   <a name="ECS-ListTaskDefinitionFamilies-request-familyPrefix"></a>
The `familyPrefix` is a string that's used to filter the results of `ListTaskDefinitionFamilies`. If you specify a `familyPrefix`, only task definition family names that begin with the `familyPrefix` string are returned.  
Type: String  
Required: No

 ** [maxResults](#API_ListTaskDefinitionFamilies_RequestSyntax) **   <a name="ECS-ListTaskDefinitionFamilies-request-maxResults"></a>
The maximum number of task definition family results that `ListTaskDefinitionFamilies` returned in paginated output. When this parameter is used, `ListTaskDefinitions` only returns `maxResults` results in a single page along with a `nextToken` response element. The remaining results of the initial request can be seen by sending another `ListTaskDefinitionFamilies` request with the returned `nextToken` value. This value can be between 1 and 100. If this parameter isn't used, then `ListTaskDefinitionFamilies` returns up to 100 results and a `nextToken` value if applicable.  
Type: Integer  
Required: No

 ** [nextToken](#API_ListTaskDefinitionFamilies_RequestSyntax) **   <a name="ECS-ListTaskDefinitionFamilies-request-nextToken"></a>
The `nextToken` value returned from a `ListTaskDefinitionFamilies` request indicating that more results are available to fulfill the request and further calls will be needed. If `maxResults` was provided, it is possible the number of results to be fewer than `maxResults`.  
This token should be treated as an opaque identifier that is only used to retrieve the next items in a list and not for other programmatic purposes.
Type: String  
Required: No

 ** [status](#API_ListTaskDefinitionFamilies_RequestSyntax) **   <a name="ECS-ListTaskDefinitionFamilies-request-status"></a>
The task definition family status to filter the `ListTaskDefinitionFamilies` results with. By default, both `ACTIVE` and `INACTIVE` task definition families are listed. If this parameter is set to `ACTIVE`, only task definition families that have an `ACTIVE` task definition revision are returned. If this parameter is set to `INACTIVE`, only task definition families that do not have any `ACTIVE` task definition revisions are returned. If you paginate the resulting output, be sure to keep the `status` value constant in each subsequent request.  
Type: String  
Valid Values: `ACTIVE | INACTIVE | ALL`   
Required: No

## Response Syntax


```
{
   "families": [ "string" ],
   "nextToken": "string"
}
```

## 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.

 ** [families](#API_ListTaskDefinitionFamilies_ResponseSyntax) **   <a name="ECS-ListTaskDefinitionFamilies-response-families"></a>
The list of task definition family names that match the `ListTaskDefinitionFamilies` request.  
Type: Array of strings

 ** [nextToken](#API_ListTaskDefinitionFamilies_ResponseSyntax) **   <a name="ECS-ListTaskDefinitionFamilies-response-nextToken"></a>
The `nextToken` value to include in a future `ListTaskDefinitionFamilies` request. When the results of a `ListTaskDefinitionFamilies` request exceed `maxResults`, this value can be used to retrieve the next page of results. This value is `null` when there are no more results to return.  
Type: String

## Errors


For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** ClientException **   
These errors are usually caused by a client action. This client action might be using an action or resource on behalf of a user that doesn't have permissions to use the action or resource. Or, it might be specifying an identifier that isn't valid.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** InvalidParameterException **   
The specified parameter isn't valid. Review the available parameters for the API request.  
For more information about service event errors, see [Amazon ECS service event messages](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/service-event-messages-list.html).     
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ServerException **   
These errors are usually caused by a server issue.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 500

## Examples


In the following example or examples, the Authorization header contents (`AUTHPARAMS`) must be replaced with an Amazon Signature Version 4 signature. For more information, see [Signature Version 4 Signing Process](https://docs.amazonaws.cn/general/latest/gr/signature-version-4.html) in the * Amazon General Reference*.

You only need to learn how to sign HTTP requests if you intend to create them manually. When you use the [Amazon Command Line Interface](http://www.amazonaws.cn/cli/) or one of the [Amazon SDKs](http://www.amazonaws.cn/tools/) to make requests to Amazon, these tools automatically sign the requests for you, with the access key that you specify when you configure the tools. When you use these tools, you don't have to sign requests yourself.

### Example


This example request lists all of the task definition families in your account in the current Region.

#### Sample Request


```
POST / HTTP/1.1
Host: ecs.us-east-1.amazonaws.com
Accept-Encoding: identity
Content-Length: 2
X-Amz-Target: AmazonEC2ContainerServiceV20141113.ListTaskDefinitionFamilies
X-Amz-Date: 20150429T191650Z
Content-Type: application/x-amz-json-1.1
Authorization: AUTHPARAMS

{}
```

#### Sample Response


```
HTTP/1.1 200 OK
Server: Server
Date: Wed, 29 Apr 2015 19:16:51 GMT
Content-Type: application/x-amz-json-1.1
Content-Length: 270
Connection: keep-alive
x-amzn-RequestId: 123a4b56-7c89-01d2-3ef4-example5678f

{
  "families": [
    "console-sample-app",
    "ecs-demo",
    "ecs-private",
    "hello_world",
    "hpcc",
    "hpcc-t2-medium",
    "image-dedupe",
    "node-dedupe",
    "port-mappings",
    "redis-volumes-from",
    "sleep360",
    "terrible-timer",
    "test-volumes-from",
    "tt-empty",
    "tt-empty-2vol",
    "tt-empty-volumes",
    "web-timer"
  ]
}
```

### Example


This example request lists all of the task definition families in your account in the current Region that begin with `hpcc`.

#### Sample Request


```
POST / HTTP/1.1
Host: ecs.us-east-1.amazonaws.com
Accept-Encoding: identity
Content-Length: 24
X-Amz-Target: AmazonEC2ContainerServiceV20141113.ListTaskDefinitionFamilies
X-Amz-Date: 20150429T191825Z
Content-Type: application/x-amz-json-1.1
Authorization: AUTHPARAMS

{
  "familyPrefix": "hpcc"
}
```

#### Sample Response


```
HTTP/1.1 200 OK
Server: Server
Date: Wed, 29 Apr 2015 19:18:25 GMT
Content-Type: application/x-amz-json-1.1
Content-Length: 38
Connection: keep-alive
x-amzn-RequestId: 123a4b56-7c89-01d2-3ef4-example5678f

{
  "families": [
    "hpcc",
    "hpcc-t2-medium"
  ]
}
```

## See Also


For more information about using this API in one of the language-specific Amazon SDKs, see the following:
+  [Amazon Command Line Interface V2](https://docs.amazonaws.cn/goto/cli2/ecs-2014-11-13/ListTaskDefinitionFamilies) 
+  [Amazon SDK for .NET V4](https://docs.amazonaws.cn/goto/DotNetSDKV4/ecs-2014-11-13/ListTaskDefinitionFamilies) 
+  [Amazon SDK for C\$1\$1](https://docs.amazonaws.cn/goto/SdkForCpp/ecs-2014-11-13/ListTaskDefinitionFamilies) 
+  [Amazon SDK for Go v2](https://docs.amazonaws.cn/goto/SdkForGoV2/ecs-2014-11-13/ListTaskDefinitionFamilies) 
+  [Amazon SDK for Java V2](https://docs.amazonaws.cn/goto/SdkForJavaV2/ecs-2014-11-13/ListTaskDefinitionFamilies) 
+  [Amazon SDK for JavaScript V3](https://docs.amazonaws.cn/goto/SdkForJavaScriptV3/ecs-2014-11-13/ListTaskDefinitionFamilies) 
+  [Amazon SDK for Kotlin](https://docs.amazonaws.cn/goto/SdkForKotlin/ecs-2014-11-13/ListTaskDefinitionFamilies) 
+  [Amazon SDK for PHP V3](https://docs.amazonaws.cn/goto/SdkForPHPV3/ecs-2014-11-13/ListTaskDefinitionFamilies) 
+  [Amazon SDK for Python](https://docs.amazonaws.cn/goto/boto3/ecs-2014-11-13/ListTaskDefinitionFamilies) 
+  [Amazon SDK for Ruby V3](https://docs.amazonaws.cn/goto/SdkForRubyV3/ecs-2014-11-13/ListTaskDefinitionFamilies) 

# ListTaskDefinitions


Returns a list of task definitions that are registered to your account. You can filter the results by family name with the `familyPrefix` parameter or by status with the `status` parameter.

## Request Syntax


```
{
   "familyPrefix": "string",
   "maxResults": number,
   "nextToken": "string",
   "sort": "string",
   "status": "string"
}
```

## Request Parameters


For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [familyPrefix](#API_ListTaskDefinitions_RequestSyntax) **   <a name="ECS-ListTaskDefinitions-request-familyPrefix"></a>
The full family name to filter the `ListTaskDefinitions` results with. Specifying a `familyPrefix` limits the listed task definitions to task definition revisions that belong to that family.  
Type: String  
Required: No

 ** [maxResults](#API_ListTaskDefinitions_RequestSyntax) **   <a name="ECS-ListTaskDefinitions-request-maxResults"></a>
The maximum number of task definition results that `ListTaskDefinitions` returned in paginated output. When this parameter is used, `ListTaskDefinitions` only returns `maxResults` results in a single page along with a `nextToken` response element. The remaining results of the initial request can be seen by sending another `ListTaskDefinitions` request with the returned `nextToken` value. This value can be between 1 and 100. If this parameter isn't used, then `ListTaskDefinitions` returns up to 100 results and a `nextToken` value if applicable.  
Type: Integer  
Required: No

 ** [nextToken](#API_ListTaskDefinitions_RequestSyntax) **   <a name="ECS-ListTaskDefinitions-request-nextToken"></a>
The `nextToken` value returned from a `ListTaskDefinitions` request indicating that more results are available to fulfill the request and further calls will be needed. If `maxResults` was provided, it is possible the number of results to be fewer than `maxResults`.  
This token should be treated as an opaque identifier that is only used to retrieve the next items in a list and not for other programmatic purposes.
Type: String  
Required: No

 ** [sort](#API_ListTaskDefinitions_RequestSyntax) **   <a name="ECS-ListTaskDefinitions-request-sort"></a>
The order to sort the results in. Valid values are `ASC` and `DESC`. By default, (`ASC`) task definitions are listed lexicographically by family name and in ascending numerical order by revision so that the newest task definitions in a family are listed last. Setting this parameter to `DESC` reverses the sort order on family name and revision. This is so that the newest task definitions in a family are listed first.  
Type: String  
Valid Values: `ASC | DESC`   
Required: No

 ** [status](#API_ListTaskDefinitions_RequestSyntax) **   <a name="ECS-ListTaskDefinitions-request-status"></a>
The task definition status to filter the `ListTaskDefinitions` results with. By default, only `ACTIVE` task definitions are listed. By setting this parameter to `INACTIVE`, you can view task definitions that are `INACTIVE` as long as an active task or service still references them. If you paginate the resulting output, be sure to keep the `status` value constant in each subsequent request.  
Type: String  
Valid Values: `ACTIVE | INACTIVE | DELETE_IN_PROGRESS`   
Required: No

## Response Syntax


```
{
   "nextToken": "string",
   "taskDefinitionArns": [ "string" ]
}
```

## 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.

 ** [nextToken](#API_ListTaskDefinitions_ResponseSyntax) **   <a name="ECS-ListTaskDefinitions-response-nextToken"></a>
The `nextToken` value to include in a future `ListTaskDefinitions` request. When the results of a `ListTaskDefinitions` request exceed `maxResults`, this value can be used to retrieve the next page of results. This value is `null` when there are no more results to return.  
Type: String

 ** [taskDefinitionArns](#API_ListTaskDefinitions_ResponseSyntax) **   <a name="ECS-ListTaskDefinitions-response-taskDefinitionArns"></a>
The list of task definition Amazon Resource Name (ARN) entries for the `ListTaskDefinitions` request.  
Type: Array of strings

## Errors


For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** ClientException **   
These errors are usually caused by a client action. This client action might be using an action or resource on behalf of a user that doesn't have permissions to use the action or resource. Or, it might be specifying an identifier that isn't valid.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** InvalidParameterException **   
The specified parameter isn't valid. Review the available parameters for the API request.  
For more information about service event errors, see [Amazon ECS service event messages](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/service-event-messages-list.html).     
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ServerException **   
These errors are usually caused by a server issue.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 500

## Examples


In the following example or examples, the Authorization header contents (`AUTHPARAMS`) must be replaced with an Amazon Signature Version 4 signature. For more information, see [Signature Version 4 Signing Process](https://docs.amazonaws.cn/general/latest/gr/signature-version-4.html) in the * Amazon General Reference*.

You only need to learn how to sign HTTP requests if you intend to create them manually. When you use the [Amazon Command Line Interface](http://www.amazonaws.cn/cli/) or one of the [Amazon SDKs](http://www.amazonaws.cn/tools/) to make requests to Amazon, these tools automatically sign the requests for you, with the access key that you specify when you configure the tools. When you use these tools, you don't have to sign requests yourself.

### Example


This example request lists all of the task definitions in the `hello_world` family.

#### Sample Request


```
POST / HTTP/1.1
Host: ecs.us-east-1.amazonaws.com
Accept-Encoding: identity
Content-Length: 31
X-Amz-Target: AmazonEC2ContainerServiceV20141113.ListTaskDefinitions
X-Amz-Date: 20150429T192041Z
Content-Type: application/x-amz-json-1.1
Authorization: AUTHPARAMS

{
  "familyPrefix": "hello_world"
}
```

#### Sample Response


```
HTTP/1.1 200 OK
Server: Server
Date: Wed, 29 Apr 2015 19:20:41 GMT
Content-Type: application/x-amz-json-1.1
Content-Length: 695
Connection: keep-alive
x-amzn-RequestId: 123a4b56-7c89-01d2-3ef4-example5678f

{
  "taskDefinitionArns": [
    "arn:aws:ecs:us-east-1:012345678910:task-definition/hello_world:1",
    "arn:aws:ecs:us-east-1:012345678910:task-definition/hello_world:2",
    "arn:aws:ecs:us-east-1:012345678910:task-definition/hello_world:3",
    "arn:aws:ecs:us-east-1:012345678910:task-definition/hello_world:4",
    "arn:aws:ecs:us-east-1:012345678910:task-definition/hello_world:5",
    "arn:aws:ecs:us-east-1:012345678910:task-definition/hello_world:6",
    "arn:aws:ecs:us-east-1:012345678910:task-definition/hello_world:7",
    "arn:aws:ecs:us-east-1:012345678910:task-definition/hello_world:8",
    "arn:aws:ecs:us-east-1:012345678910:task-definition/hello_world:9",
    "arn:aws:ecs:us-east-1:012345678910:task-definition/hello_world:10"
  ]
}
```

## See Also


For more information about using this API in one of the language-specific Amazon SDKs, see the following:
+  [Amazon Command Line Interface V2](https://docs.amazonaws.cn/goto/cli2/ecs-2014-11-13/ListTaskDefinitions) 
+  [Amazon SDK for .NET V4](https://docs.amazonaws.cn/goto/DotNetSDKV4/ecs-2014-11-13/ListTaskDefinitions) 
+  [Amazon SDK for C\$1\$1](https://docs.amazonaws.cn/goto/SdkForCpp/ecs-2014-11-13/ListTaskDefinitions) 
+  [Amazon SDK for Go v2](https://docs.amazonaws.cn/goto/SdkForGoV2/ecs-2014-11-13/ListTaskDefinitions) 
+  [Amazon SDK for Java V2](https://docs.amazonaws.cn/goto/SdkForJavaV2/ecs-2014-11-13/ListTaskDefinitions) 
+  [Amazon SDK for JavaScript V3](https://docs.amazonaws.cn/goto/SdkForJavaScriptV3/ecs-2014-11-13/ListTaskDefinitions) 
+  [Amazon SDK for Kotlin](https://docs.amazonaws.cn/goto/SdkForKotlin/ecs-2014-11-13/ListTaskDefinitions) 
+  [Amazon SDK for PHP V3](https://docs.amazonaws.cn/goto/SdkForPHPV3/ecs-2014-11-13/ListTaskDefinitions) 
+  [Amazon SDK for Python](https://docs.amazonaws.cn/goto/boto3/ecs-2014-11-13/ListTaskDefinitions) 
+  [Amazon SDK for Ruby V3](https://docs.amazonaws.cn/goto/SdkForRubyV3/ecs-2014-11-13/ListTaskDefinitions) 

# ListTasks


Returns a list of tasks. You can filter the results by cluster, task definition family, container instance, launch type, what IAM principal started the task, or by the desired status of the task.

Recently stopped tasks might appear in the returned results. 

## Request Syntax


```
{
   "cluster": "string",
   "containerInstance": "string",
   "daemonName": "string",
   "desiredStatus": "string",
   "family": "string",
   "launchType": "string",
   "maxResults": number,
   "nextToken": "string",
   "serviceName": "string",
   "startedBy": "string"
}
```

## Request Parameters


For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [cluster](#API_ListTasks_RequestSyntax) **   <a name="ECS-ListTasks-request-cluster"></a>
The short name or full Amazon Resource Name (ARN) of the cluster to use when filtering the `ListTasks` results. If you do not specify a cluster, the default cluster is assumed.  
Type: String  
Required: No

 ** [containerInstance](#API_ListTasks_RequestSyntax) **   <a name="ECS-ListTasks-request-containerInstance"></a>
The container instance ID or full ARN of the container instance to use when filtering the `ListTasks` results. Specifying a `containerInstance` limits the results to tasks that belong to that container instance.  
Type: String  
Required: No

 ** [daemonName](#API_ListTasks_RequestSyntax) **   <a name="ECS-ListTasks-request-daemonName"></a>
The name of the daemon to use when filtering the `ListTasks` results. Specifying a `daemonName` limits the results to tasks that belong to that daemon.  
Type: String  
Required: No

 ** [desiredStatus](#API_ListTasks_RequestSyntax) **   <a name="ECS-ListTasks-request-desiredStatus"></a>
The task desired status to use when filtering the `ListTasks` results. Specifying a `desiredStatus` of `STOPPED` limits the results to tasks that Amazon ECS has set the desired status to `STOPPED`. This can be useful for debugging tasks that aren't starting properly or have died or finished. The default status filter is `RUNNING`, which shows tasks that Amazon ECS has set the desired status to `RUNNING`.  
Although you can filter results based on a desired status of `PENDING`, this doesn't return any results. Amazon ECS never sets the desired status of a task to that value (only a task's `lastStatus` may have a value of `PENDING`).
Type: String  
Valid Values: `RUNNING | PENDING | STOPPED`   
Required: No

 ** [family](#API_ListTasks_RequestSyntax) **   <a name="ECS-ListTasks-request-family"></a>
The name of the task definition family to use when filtering the `ListTasks` results. Specifying a `family` limits the results to tasks that belong to that family.  
Type: String  
Required: No

 ** [launchType](#API_ListTasks_RequestSyntax) **   <a name="ECS-ListTasks-request-launchType"></a>
The launch type to use when filtering the `ListTasks` results.  
Type: String  
Valid Values: `EC2 | FARGATE | EXTERNAL | MANAGED_INSTANCES`   
Required: No

 ** [maxResults](#API_ListTasks_RequestSyntax) **   <a name="ECS-ListTasks-request-maxResults"></a>
The maximum number of task results that `ListTasks` returned in paginated output. When this parameter is used, `ListTasks` only returns `maxResults` results in a single page along with a `nextToken` response element. The remaining results of the initial request can be seen by sending another `ListTasks` request with the returned `nextToken` value. This value can be between 1 and 100. If this parameter isn't used, then `ListTasks` returns up to 100 results and a `nextToken` value if applicable.  
Type: Integer  
Required: No

 ** [nextToken](#API_ListTasks_RequestSyntax) **   <a name="ECS-ListTasks-request-nextToken"></a>
The `nextToken` value returned from a `ListTasks` request indicating that more results are available to fulfill the request and further calls will be needed. If `maxResults` was provided, it's possible the number of results to be fewer than `maxResults`.  
This token should be treated as an opaque identifier that is only used to retrieve the next items in a list and not for other programmatic purposes.
Type: String  
Required: No

 ** [serviceName](#API_ListTasks_RequestSyntax) **   <a name="ECS-ListTasks-request-serviceName"></a>
The name of the service to use when filtering the `ListTasks` results. Specifying a `serviceName` limits the results to tasks that belong to that service.  
Type: String  
Required: No

 ** [startedBy](#API_ListTasks_RequestSyntax) **   <a name="ECS-ListTasks-request-startedBy"></a>
The `startedBy` value to filter the task results with. Specifying a `startedBy` value limits the results to tasks that were started with that value.  
When you specify `startedBy` as the filter, it must be the only filter that you use.  
Type: String  
Required: No

## Response Syntax


```
{
   "nextToken": "string",
   "taskArns": [ "string" ]
}
```

## 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.

 ** [nextToken](#API_ListTasks_ResponseSyntax) **   <a name="ECS-ListTasks-response-nextToken"></a>
The `nextToken` value to include in a future `ListTasks` request. When the results of a `ListTasks` request exceed `maxResults`, this value can be used to retrieve the next page of results. This value is `null` when there are no more results to return.  
Type: String

 ** [taskArns](#API_ListTasks_ResponseSyntax) **   <a name="ECS-ListTasks-response-taskArns"></a>
The list of task ARN entries for the `ListTasks` request.  
Type: Array of strings

## Errors


For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** ClientException **   
These errors are usually caused by a client action. This client action might be using an action or resource on behalf of a user that doesn't have permissions to use the action or resource. Or, it might be specifying an identifier that isn't valid.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ClusterNotFoundException **   
The specified cluster wasn't found. You can view your available clusters with [ListClusters](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_ListClusters.html). Amazon ECS clusters are Region specific.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** InvalidParameterException **   
The specified parameter isn't valid. Review the available parameters for the API request.  
For more information about service event errors, see [Amazon ECS service event messages](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/service-event-messages-list.html).     
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ServerException **   
These errors are usually caused by a server issue.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 500

 ** ServiceNotFoundException **   
The specified service wasn't found. You can view your available services with [ListServices](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_ListServices.html). Amazon ECS services are cluster specific and Region specific.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

## Examples


In the following example or examples, the Authorization header contents (`AUTHPARAMS`) must be replaced with an Amazon Signature Version 4 signature. For more information, see [Signature Version 4 Signing Process](https://docs.amazonaws.cn/general/latest/gr/signature-version-4.html) in the * Amazon General Reference*.

You only need to learn how to sign HTTP requests if you intend to create them manually. When you use the [Amazon Command Line Interface](http://www.amazonaws.cn/cli/) or one of the [Amazon SDKs](http://www.amazonaws.cn/tools/) to make requests to Amazon, these tools automatically sign the requests for you, with the access key that you specify when you configure the tools. When you use these tools, you don't have to sign requests yourself.

### Example


This example request lists all of the tasks in the default cluster.

#### Sample Request


```
POST / HTTP/1.1
Host: ecs.us-east-1.amazonaws.com
Accept-Encoding: identity
Content-Length: 2
X-Amz-Target: AmazonEC2ContainerServiceV20141113.ListTasks
X-Amz-Date: 20150429T192615Z
Content-Type: application/x-amz-json-1.1
Authorization: AUTHPARAMS

{}
```

#### Sample Response


```
HTTP/1.1 200 OK
Server: Server
Date: Wed, 29 Apr 2015 19:26:16 GMT
Content-Type: application/x-amz-json-1.1
Content-Length: 330
Connection: keep-alive
x-amzn-RequestId: 123a4b56-7c89-01d2-3ef4-example5678f

{
  "taskArns": [
    "arn:aws:ecs:us-east-1:012345678910:task/0b69d5c0-d655-4695-98cd-5d2d526d9d5a",
    "arn:aws:ecs:us-east-1:012345678910:task/51a01bdf-d00e-487e-ab14-7645330b6207",
    "arn:aws:ecs:us-east-1:012345678910:task/b0b28bb8-2be3-4810-b52b-88df129d893c",
    "arn:aws:ecs:us-east-1:012345678910:task/c09f0188-7f87-4b0f-bfc3-16296622b6fe"
  ]
}
```

## See Also


For more information about using this API in one of the language-specific Amazon SDKs, see the following:
+  [Amazon Command Line Interface V2](https://docs.amazonaws.cn/goto/cli2/ecs-2014-11-13/ListTasks) 
+  [Amazon SDK for .NET V4](https://docs.amazonaws.cn/goto/DotNetSDKV4/ecs-2014-11-13/ListTasks) 
+  [Amazon SDK for C\$1\$1](https://docs.amazonaws.cn/goto/SdkForCpp/ecs-2014-11-13/ListTasks) 
+  [Amazon SDK for Go v2](https://docs.amazonaws.cn/goto/SdkForGoV2/ecs-2014-11-13/ListTasks) 
+  [Amazon SDK for Java V2](https://docs.amazonaws.cn/goto/SdkForJavaV2/ecs-2014-11-13/ListTasks) 
+  [Amazon SDK for JavaScript V3](https://docs.amazonaws.cn/goto/SdkForJavaScriptV3/ecs-2014-11-13/ListTasks) 
+  [Amazon SDK for Kotlin](https://docs.amazonaws.cn/goto/SdkForKotlin/ecs-2014-11-13/ListTasks) 
+  [Amazon SDK for PHP V3](https://docs.amazonaws.cn/goto/SdkForPHPV3/ecs-2014-11-13/ListTasks) 
+  [Amazon SDK for Python](https://docs.amazonaws.cn/goto/boto3/ecs-2014-11-13/ListTasks) 
+  [Amazon SDK for Ruby V3](https://docs.amazonaws.cn/goto/SdkForRubyV3/ecs-2014-11-13/ListTasks) 

# PutAccountSetting


Modifies an account setting. Account settings are set on a per-Region basis.

If you change the root user account setting, the default settings are reset for users and roles that do not have specified individual account settings. For more information, see [Account Settings](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/ecs-account-settings.html) in the *Amazon Elastic Container Service Developer Guide*.

## Request Syntax


```
{
   "name": "string",
   "principalArn": "string",
   "value": "string"
}
```

## Request Parameters


For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [name](#API_PutAccountSetting_RequestSyntax) **   <a name="ECS-PutAccountSetting-request-name"></a>
The Amazon ECS account setting name to modify.  
The following are the valid values for the account setting name.  
+  `serviceLongArnFormat` - When modified, the Amazon Resource Name (ARN) and resource ID format of the resource type for a specified user, role, or the root user for an account is affected. The opt-in and opt-out account setting must be set for each Amazon ECS resource separately. The ARN and resource ID format of a resource is defined by the opt-in status of the user or role that created the resource. You must turn on this setting to use Amazon ECS features such as resource tagging.
+  `taskLongArnFormat` - When modified, the Amazon Resource Name (ARN) and resource ID format of the resource type for a specified user, role, or the root user for an account is affected. The opt-in and opt-out account setting must be set for each Amazon ECS resource separately. The ARN and resource ID format of a resource is defined by the opt-in status of the user or role that created the resource. You must turn on this setting to use Amazon ECS features such as resource tagging.
+  `containerInstanceLongArnFormat` - When modified, the Amazon Resource Name (ARN) and resource ID format of the resource type for a specified user, role, or the root user for an account is affected. The opt-in and opt-out account setting must be set for each Amazon ECS resource separately. The ARN and resource ID format of a resource is defined by the opt-in status of the user or role that created the resource. You must turn on this setting to use Amazon ECS features such as resource tagging.
+  `awsvpcTrunking` - When modified, the elastic network interface (ENI) limit for any new container instances that support the feature is changed. If `awsvpcTrunking` is turned on, any new container instances that support the feature are launched have the increased ENI limits available to them. For more information, see [Elastic Network Interface Trunking](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/container-instance-eni.html) in the *Amazon Elastic Container Service Developer Guide*.
+  `containerInsights` - 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. 

  To use Container Insights with enhanced observability, set the `containerInsights` account setting to `enhanced`.

  To use Container Insights, set the `containerInsights` account setting to `enabled`.

  For more information, see [Monitor Amazon ECS containers using Container Insights with enhanced observability](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/cloudwatch-container-insights.html) in the *Amazon Elastic Container Service Developer Guide*.
+  `dualStackIPv6` - When turned on, when using a VPC in dual stack mode, your tasks using the `awsvpc` network mode can have an IPv6 address assigned. For more information on using IPv6 with tasks launched on Amazon EC2 instances, see [Using a VPC in dual-stack mode](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/task-networking-awsvpc.html#task-networking-vpc-dual-stack). For more information on using IPv6 with tasks launched on Fargate, see [Using a VPC in dual-stack mode](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/fargate-task-networking.html#fargate-task-networking-vpc-dual-stack).
+  `fargateTaskRetirementWaitPeriod` - When Amazon determines that a security or infrastructure update is needed for an Amazon ECS task hosted on Fargate, the tasks need to be stopped and new tasks launched to replace them. Use `fargateTaskRetirementWaitPeriod` to configure the wait time to retire a Fargate task. For information about the Fargate tasks maintenance, see [Amazon Fargate task maintenance](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/task-maintenance.html) in the *Amazon ECS Developer Guide*.
+  `fargateEventWindows` - When Amazon determines that a security or infrastructure update is needed for an Amazon ECS task hosted on Fargate, the tasks need to be stopped and new tasks launched to replace them. Use `fargateEventWindows` to use EC2 Event Windows associated with Fargate tasks to configure time windows for task retirement.
+  `tagResourceAuthorization` - Amazon ECS is introducing tagging authorization for resource creation. Users must have permissions for actions that create the resource, such as `ecsCreateCluster`. If tags are specified when you create a resource, Amazon performs additional authorization to verify if users or roles have permissions to create tags. Therefore, you must grant explicit permissions to use the `ecs:TagResource` action. For more information, see [Grant permission to tag resources on creation](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/supported-iam-actions-tagging.html) in the *Amazon ECS Developer Guide*.
+  `defaultLogDriverMode` - Amazon ECS supports setting a default delivery mode of log messages from a container to the `logDriver` that you specify in the container's `logConfiguration`. The delivery mode affects application stability when the flow of logs from the container to the log driver is interrupted. The `defaultLogDriverMode` setting supports two values: `blocking` and `non-blocking`. If you don't specify a delivery mode in your container definition's `logConfiguration`, the mode you specify using this account setting will be used as the default. For more information about log delivery modes, see [LogConfiguration](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_LogConfiguration.html). 
**Note**  
On June 25, 2025, Amazon ECS changed the default log driver mode from `blocking` to `non-blocking` to prioritize task availability over logging. To continue using the `blocking` mode after this change, do one of the following:  
Set the `mode` option in your container definition's `logConfiguration` as `blocking`.
Set the `defaultLogDriverMode` account setting to `blocking`.
+  `guardDutyActivate` - The `guardDutyActivate` parameter is read-only in Amazon ECS and indicates whether Amazon ECS Runtime Monitoring is enabled or disabled by your security administrator in your Amazon ECS account. Amazon GuardDuty controls this account setting on your behalf. For more information, see [Protecting Amazon ECS workloads with Amazon ECS Runtime Monitoring](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/ecs-guard-duty-integration.html).
Type: String  
Valid Values: `serviceLongArnFormat | taskLongArnFormat | containerInstanceLongArnFormat | awsvpcTrunking | containerInsights | fargateFIPSMode | tagResourceAuthorization | fargateTaskRetirementWaitPeriod | guardDutyActivate | defaultLogDriverMode | fargateEventWindows`   
Required: Yes

 ** [principalArn](#API_PutAccountSetting_RequestSyntax) **   <a name="ECS-PutAccountSetting-request-principalArn"></a>
The ARN of the principal, which can be a user, role, or the root user. If you specify the root user, it modifies the account setting for all users, roles, and the root user of the account unless a user or role explicitly overrides these settings. If this field is omitted, the setting is changed only for the authenticated user.  
In order to use this parameter, you must be the root user, or the principal.  
You must use the root user when you set the Fargate wait time (`fargateTaskRetirementWaitPeriod`).   
Federated users assume the account setting of the root user and can't have explicit account settings set for them.
Type: String  
Required: No

 ** [value](#API_PutAccountSetting_RequestSyntax) **   <a name="ECS-PutAccountSetting-request-value"></a>
The account setting value for the specified principal ARN. Accepted values are `enabled`, `disabled`, `enhanced`, `on`, and `off`.  
When you specify `fargateTaskRetirementWaitPeriod` for the `name`, the following are the valid values:  
+  `0` - Amazon sends the notification, and immediately retires the affected tasks.
+  `7` - Amazon sends the notification, and waits 7 calendar days to retire the tasks.
+  `14` - Amazon sends the notification, and waits 14 calendar days to retire the tasks.
Type: String  
Required: Yes

## Response Syntax


```
{
   "setting": { 
      "name": "string",
      "principalArn": "string",
      "type": "string",
      "value": "string"
   }
}
```

## 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.

 ** [setting](#API_PutAccountSetting_ResponseSyntax) **   <a name="ECS-PutAccountSetting-response-setting"></a>
The current account setting for a resource.  
Type: [Setting](API_Setting.md) object

## Errors


For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** ClientException **   
These errors are usually caused by a client action. This client action might be using an action or resource on behalf of a user that doesn't have permissions to use the action or resource. Or, it might be specifying an identifier that isn't valid.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** InvalidParameterException **   
The specified parameter isn't valid. Review the available parameters for the API request.  
For more information about service event errors, see [Amazon ECS service event messages](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/service-event-messages-list.html).     
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ServerException **   
These errors are usually caused by a server issue.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 500

## See Also


For more information about using this API in one of the language-specific Amazon SDKs, see the following:
+  [Amazon Command Line Interface V2](https://docs.amazonaws.cn/goto/cli2/ecs-2014-11-13/PutAccountSetting) 
+  [Amazon SDK for .NET V4](https://docs.amazonaws.cn/goto/DotNetSDKV4/ecs-2014-11-13/PutAccountSetting) 
+  [Amazon SDK for C\$1\$1](https://docs.amazonaws.cn/goto/SdkForCpp/ecs-2014-11-13/PutAccountSetting) 
+  [Amazon SDK for Go v2](https://docs.amazonaws.cn/goto/SdkForGoV2/ecs-2014-11-13/PutAccountSetting) 
+  [Amazon SDK for Java V2](https://docs.amazonaws.cn/goto/SdkForJavaV2/ecs-2014-11-13/PutAccountSetting) 
+  [Amazon SDK for JavaScript V3](https://docs.amazonaws.cn/goto/SdkForJavaScriptV3/ecs-2014-11-13/PutAccountSetting) 
+  [Amazon SDK for Kotlin](https://docs.amazonaws.cn/goto/SdkForKotlin/ecs-2014-11-13/PutAccountSetting) 
+  [Amazon SDK for PHP V3](https://docs.amazonaws.cn/goto/SdkForPHPV3/ecs-2014-11-13/PutAccountSetting) 
+  [Amazon SDK for Python](https://docs.amazonaws.cn/goto/boto3/ecs-2014-11-13/PutAccountSetting) 
+  [Amazon SDK for Ruby V3](https://docs.amazonaws.cn/goto/SdkForRubyV3/ecs-2014-11-13/PutAccountSetting) 

# PutAccountSettingDefault


Modifies an account setting for all users on an account for whom no individual account setting has been specified. Account settings are set on a per-Region basis.

## Request Syntax


```
{
   "name": "string",
   "value": "string"
}
```

## Request Parameters


For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [name](#API_PutAccountSettingDefault_RequestSyntax) **   <a name="ECS-PutAccountSettingDefault-request-name"></a>
The resource name for which to modify the account setting.  
The following are the valid values for the account setting name.  
+  `serviceLongArnFormat` - When modified, the Amazon Resource Name (ARN) and resource ID format of the resource type for a specified user, role, or the root user for an account is affected. The opt-in and opt-out account setting must be set for each Amazon ECS resource separately. The ARN and resource ID format of a resource is defined by the opt-in status of the user or role that created the resource. You must turn on this setting to use Amazon ECS features such as resource tagging.
+  `taskLongArnFormat` - When modified, the Amazon Resource Name (ARN) and resource ID format of the resource type for a specified user, role, or the root user for an account is affected. The opt-in and opt-out account setting must be set for each Amazon ECS resource separately. The ARN and resource ID format of a resource is defined by the opt-in status of the user or role that created the resource. You must turn on this setting to use Amazon ECS features such as resource tagging.
+  `containerInstanceLongArnFormat` - When modified, the Amazon Resource Name (ARN) and resource ID format of the resource type for a specified user, role, or the root user for an account is affected. The opt-in and opt-out account setting must be set for each Amazon ECS resource separately. The ARN and resource ID format of a resource is defined by the opt-in status of the user or role that created the resource. You must turn on this setting to use Amazon ECS features such as resource tagging.
+  `awsvpcTrunking` - When modified, the elastic network interface (ENI) limit for any new container instances that support the feature is changed. If `awsvpcTrunking` is turned on, any new container instances that support the feature are launched have the increased ENI limits available to them. For more information, see [Elastic Network Interface Trunking](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/container-instance-eni.html) in the *Amazon Elastic Container Service Developer Guide*.
+  `containerInsights` - 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. 

  To use Container Insights with enhanced observability, set the `containerInsights` account setting to `enhanced`.

  To use Container Insights, set the `containerInsights` account setting to `enabled`.

  For more information, see [Monitor Amazon ECS containers using Container Insights with enhanced observability](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/cloudwatch-container-insights.html) in the *Amazon Elastic Container Service Developer Guide*.
+  `dualStackIPv6` - When turned on, when using a VPC in dual stack mode, your tasks using the `awsvpc` network mode can have an IPv6 address assigned. For more information on using IPv6 with tasks launched on Amazon EC2 instances, see [Using a VPC in dual-stack mode](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/task-networking-awsvpc.html#task-networking-vpc-dual-stack). For more information on using IPv6 with tasks launched on Fargate, see [Using a VPC in dual-stack mode](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/fargate-task-networking.html#fargate-task-networking-vpc-dual-stack).
+  `fargateFIPSMode` - If you specify `fargateFIPSMode`, Amazon Fargate FIPS 140 compliance is affected.
+  `fargateTaskRetirementWaitPeriod` - When Amazon determines that a security or infrastructure update is needed for an Amazon ECS task hosted on Fargate, the tasks need to be stopped and new tasks launched to replace them. Use `fargateTaskRetirementWaitPeriod` to configure the wait time to retire a Fargate task. For information about the Fargate tasks maintenance, see [Amazon Fargate task maintenance](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/task-maintenance.html) in the *Amazon ECS Developer Guide*.
+  `fargateEventWindows` - When Amazon determines that a security or infrastructure update is needed for an Amazon ECS task hosted on Fargate, the tasks need to be stopped and new tasks launched to replace them. Use `fargateEventWindows` to use EC2 Event Windows associated with Fargate tasks to configure time windows for task retirement.
+  `tagResourceAuthorization` - Amazon ECS is introducing tagging authorization for resource creation. Users must have permissions for actions that create the resource, such as `ecsCreateCluster`. If tags are specified when you create a resource, Amazon performs additional authorization to verify if users or roles have permissions to create tags. Therefore, you must grant explicit permissions to use the `ecs:TagResource` action. For more information, see [Grant permission to tag resources on creation](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/supported-iam-actions-tagging.html) in the *Amazon ECS Developer Guide*.
+  `defaultLogDriverMode` -Amazon ECS supports setting a default delivery mode of log messages from a container to the `logDriver` that you specify in the container's `logConfiguration`. The delivery mode affects application stability when the flow of logs from the container to the log driver is interrupted. The `defaultLogDriverMode` setting supports two values: `blocking` and `non-blocking`. If you don't specify a delivery mode in your container definition's `logConfiguration`, the mode you specify using this account setting will be used as the default. For more information about log delivery modes, see [LogConfiguration](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_LogConfiguration.html).
**Note**  
On June 25, 2025, Amazon ECS changed the default log driver mode from `blocking` to `non-blocking` to prioritize task availability over logging. To continue using the `blocking` mode after this change, do one of the following:  
Set the `mode` option in your container definition's `logConfiguration` as `blocking`.
Set the `defaultLogDriverMode` account setting to `blocking`.
+  `guardDutyActivate` - The `guardDutyActivate` parameter is read-only in Amazon ECS and indicates whether Amazon ECS Runtime Monitoring is enabled or disabled by your security administrator in your Amazon ECS account. Amazon GuardDuty controls this account setting on your behalf. For more information, see [Protecting Amazon ECS workloads with Amazon ECS Runtime Monitoring](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/ecs-guard-duty-integration.html).
Type: String  
Valid Values: `serviceLongArnFormat | taskLongArnFormat | containerInstanceLongArnFormat | awsvpcTrunking | containerInsights | fargateFIPSMode | tagResourceAuthorization | fargateTaskRetirementWaitPeriod | guardDutyActivate | defaultLogDriverMode | fargateEventWindows`   
Required: Yes

 ** [value](#API_PutAccountSettingDefault_RequestSyntax) **   <a name="ECS-PutAccountSettingDefault-request-value"></a>
The account setting value for the specified principal ARN. Accepted values are `enabled`, `disabled`, `on`, `enhanced`, and `off`.  
When you specify `fargateTaskRetirementWaitPeriod` for the `name`, the following are the valid values:  
+  `0` - Amazon sends the notification, and immediately retires the affected tasks.
+  `7` - Amazon sends the notification, and waits 7 calendar days to retire the tasks.
+  `14` - Amazon sends the notification, and waits 14 calendar days to retire the tasks.
Type: String  
Required: Yes

## Response Syntax


```
{
   "setting": { 
      "name": "string",
      "principalArn": "string",
      "type": "string",
      "value": "string"
   }
}
```

## 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.

 ** [setting](#API_PutAccountSettingDefault_ResponseSyntax) **   <a name="ECS-PutAccountSettingDefault-response-setting"></a>
The current setting for a resource.  
Type: [Setting](API_Setting.md) object

## Errors


For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** ClientException **   
These errors are usually caused by a client action. This client action might be using an action or resource on behalf of a user that doesn't have permissions to use the action or resource. Or, it might be specifying an identifier that isn't valid.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** InvalidParameterException **   
The specified parameter isn't valid. Review the available parameters for the API request.  
For more information about service event errors, see [Amazon ECS service event messages](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/service-event-messages-list.html).     
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ServerException **   
These errors are usually caused by a server issue.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 500

## See Also


For more information about using this API in one of the language-specific Amazon SDKs, see the following:
+  [Amazon Command Line Interface V2](https://docs.amazonaws.cn/goto/cli2/ecs-2014-11-13/PutAccountSettingDefault) 
+  [Amazon SDK for .NET V4](https://docs.amazonaws.cn/goto/DotNetSDKV4/ecs-2014-11-13/PutAccountSettingDefault) 
+  [Amazon SDK for C\$1\$1](https://docs.amazonaws.cn/goto/SdkForCpp/ecs-2014-11-13/PutAccountSettingDefault) 
+  [Amazon SDK for Go v2](https://docs.amazonaws.cn/goto/SdkForGoV2/ecs-2014-11-13/PutAccountSettingDefault) 
+  [Amazon SDK for Java V2](https://docs.amazonaws.cn/goto/SdkForJavaV2/ecs-2014-11-13/PutAccountSettingDefault) 
+  [Amazon SDK for JavaScript V3](https://docs.amazonaws.cn/goto/SdkForJavaScriptV3/ecs-2014-11-13/PutAccountSettingDefault) 
+  [Amazon SDK for Kotlin](https://docs.amazonaws.cn/goto/SdkForKotlin/ecs-2014-11-13/PutAccountSettingDefault) 
+  [Amazon SDK for PHP V3](https://docs.amazonaws.cn/goto/SdkForPHPV3/ecs-2014-11-13/PutAccountSettingDefault) 
+  [Amazon SDK for Python](https://docs.amazonaws.cn/goto/boto3/ecs-2014-11-13/PutAccountSettingDefault) 
+  [Amazon SDK for Ruby V3](https://docs.amazonaws.cn/goto/SdkForRubyV3/ecs-2014-11-13/PutAccountSettingDefault) 

# PutAttributes


Create or update an attribute on an Amazon ECS resource. If the attribute doesn't exist, it's created. If the attribute exists, its value is replaced with the specified value. To delete an attribute, use [DeleteAttributes](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_DeleteAttributes.html). For more information, see [Attributes](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/task-placement-constraints.html#attributes) in the *Amazon Elastic Container Service Developer Guide*.

## Request Syntax


```
{
   "attributes": [ 
      { 
         "name": "string",
         "targetId": "string",
         "targetType": "string",
         "value": "string"
      }
   ],
   "cluster": "string"
}
```

## Request Parameters


For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [attributes](#API_PutAttributes_RequestSyntax) **   <a name="ECS-PutAttributes-request-attributes"></a>
The attributes to apply to your resource. You can specify up to 10 custom attributes for each resource. You can specify up to 10 attributes in a single call.  
Type: Array of [Attribute](API_Attribute.md) objects  
Required: Yes

 ** [cluster](#API_PutAttributes_RequestSyntax) **   <a name="ECS-PutAttributes-request-cluster"></a>
The short name or full Amazon Resource Name (ARN) of the cluster that contains the resource to apply attributes. If you do not specify a cluster, the default cluster is assumed.  
Type: String  
Required: No

## Response Syntax


```
{
   "attributes": [ 
      { 
         "name": "string",
         "targetId": "string",
         "targetType": "string",
         "value": "string"
      }
   ]
}
```

## 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.

 ** [attributes](#API_PutAttributes_ResponseSyntax) **   <a name="ECS-PutAttributes-response-attributes"></a>
The attributes applied to your resource.  
Type: Array of [Attribute](API_Attribute.md) objects

## Errors


For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** AttributeLimitExceededException **   
You can apply up to 10 custom attributes for each resource. You can view the attributes of a resource with [ListAttributes](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_ListAttributes.html). You can remove existing attributes on a resource with [DeleteAttributes](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_DeleteAttributes.html).    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ClusterNotFoundException **   
The specified cluster wasn't found. You can view your available clusters with [ListClusters](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_ListClusters.html). Amazon ECS clusters are Region specific.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** InvalidParameterException **   
The specified parameter isn't valid. Review the available parameters for the API request.  
For more information about service event errors, see [Amazon ECS service event messages](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/service-event-messages-list.html).     
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** TargetNotFoundException **   
The specified target wasn't found. You can view your available container instances with [ListContainerInstances](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_ListContainerInstances.html). Amazon ECS container instances are cluster-specific and Region-specific.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

## Examples


In the following example or examples, the Authorization header contents (`AUTHPARAMS`) must be replaced with an Amazon Signature Version 4 signature. For more information, see [Signature Version 4 Signing Process](https://docs.amazonaws.cn/general/latest/gr/signature-version-4.html) in the * Amazon General Reference*.

You only need to learn how to sign HTTP requests if you intend to create them manually. When you use the [Amazon Command Line Interface](http://www.amazonaws.cn/cli/) or one of the [Amazon SDKs](http://www.amazonaws.cn/tools/) to make requests to Amazon, these tools automatically sign the requests for you, with the access key that you specify when you configure the tools. When you use these tools, you don't have to sign requests yourself.

### Example


This example applies an attribute with the name `stack` and the value `production` to a container instance.

#### Sample Request


```
POST / HTTP/1.1
Host: ecs.us-west-2.amazonaws.com
Accept-Encoding: identity
Content-Length: 192
X-Amz-Target: AmazonEC2ContainerServiceV20141113.PutAttributes
X-Amz-Date: 20161222T180005Z
User-Agent: aws-cli/1.11.30 Python/2.7.12 Darwin/16.3.0 botocore/1.4.87
Content-Type: application/x-amz-json-1.1
Authorization: AUTHPARAMS

{
  "cluster": "default",
  "attributes": [
    {
      "targetId": "arn:aws:ecs:us-west-2:123456789012:container-instance/1c3be8ed-df30-47b4-8f1e-6e68ebd01f34",
      "name": "stack",
      "value": "production"
    }
  ]
}
```

#### Sample Response


```
HTTP/1.1 200 OK
Server: Server
Date: Thu, 22 Dec 2016 18:00:06 GMT
Content-Type: application/x-amz-json-1.1
Content-Length: 158
Connection: keep-alive
x-amzn-RequestId: 7835c1be-c870-11e6-a3b0-295902c79de2

{
  "attributes": [
    {
      "name": "stack",
      "targetId": "arn:aws:ecs:us-west-2:123456789012:container-instance/1c3be8ed-df30-47b4-8f1e-6e68ebd01f34",
      "value": "production"
    }
  ]
}
```

## See Also


For more information about using this API in one of the language-specific Amazon SDKs, see the following:
+  [Amazon Command Line Interface V2](https://docs.amazonaws.cn/goto/cli2/ecs-2014-11-13/PutAttributes) 
+  [Amazon SDK for .NET V4](https://docs.amazonaws.cn/goto/DotNetSDKV4/ecs-2014-11-13/PutAttributes) 
+  [Amazon SDK for C\$1\$1](https://docs.amazonaws.cn/goto/SdkForCpp/ecs-2014-11-13/PutAttributes) 
+  [Amazon SDK for Go v2](https://docs.amazonaws.cn/goto/SdkForGoV2/ecs-2014-11-13/PutAttributes) 
+  [Amazon SDK for Java V2](https://docs.amazonaws.cn/goto/SdkForJavaV2/ecs-2014-11-13/PutAttributes) 
+  [Amazon SDK for JavaScript V3](https://docs.amazonaws.cn/goto/SdkForJavaScriptV3/ecs-2014-11-13/PutAttributes) 
+  [Amazon SDK for Kotlin](https://docs.amazonaws.cn/goto/SdkForKotlin/ecs-2014-11-13/PutAttributes) 
+  [Amazon SDK for PHP V3](https://docs.amazonaws.cn/goto/SdkForPHPV3/ecs-2014-11-13/PutAttributes) 
+  [Amazon SDK for Python](https://docs.amazonaws.cn/goto/boto3/ecs-2014-11-13/PutAttributes) 
+  [Amazon SDK for Ruby V3](https://docs.amazonaws.cn/goto/SdkForRubyV3/ecs-2014-11-13/PutAttributes) 

# PutClusterCapacityProviders


Modifies the available capacity providers and the default capacity provider strategy for a cluster.

You must specify both the available capacity providers and a default capacity provider strategy for the cluster. If the specified cluster has existing capacity providers associated with it, you must specify all existing capacity providers in addition to any new ones you want to add. Any existing capacity providers that are associated with a cluster that are omitted from a [PutClusterCapacityProviders](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_PutClusterCapacityProviders.html) API call will be disassociated with the cluster. You can only disassociate an existing capacity provider from a cluster if it's not being used by any existing tasks.

When creating a service or running a task on a cluster, if no capacity provider or launch type is specified, then the cluster's default capacity provider strategy is used. We recommend that you define a default capacity provider strategy for your cluster. However, you must specify an empty array (`[]`) to bypass defining a default strategy.

Amazon ECS Managed Instances doesn't support this, because when you create a capacity provider with Amazon ECS Managed Instances, it becomes available only within the specified cluster.

## Request Syntax


```
{
   "capacityProviders": [ "string" ],
   "cluster": "string",
   "defaultCapacityProviderStrategy": [ 
      { 
         "base": number,
         "capacityProvider": "string",
         "weight": number
      }
   ]
}
```

## Request Parameters


For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [capacityProviders](#API_PutClusterCapacityProviders_RequestSyntax) **   <a name="ECS-PutClusterCapacityProviders-request-capacityProviders"></a>
The name of one or more capacity providers to associate with the cluster.  
If specifying a capacity provider that uses an Auto Scaling group, the capacity provider must already be created. New capacity providers can be created with the [CreateCapacityProvider](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_CreateCapacityProvider.html) API operation.  
To use a Amazon Fargate capacity provider, specify either the `FARGATE` or `FARGATE_SPOT` capacity providers. The Amazon Fargate capacity providers are available to all accounts and only need to be associated with a cluster to be used.  
Type: Array of strings  
Required: Yes

 ** [cluster](#API_PutClusterCapacityProviders_RequestSyntax) **   <a name="ECS-PutClusterCapacityProviders-request-cluster"></a>
The short name or full Amazon Resource Name (ARN) of the cluster to modify the capacity provider settings for. If you don't specify a cluster, the default cluster is assumed.  
Type: String  
Required: Yes

 ** [defaultCapacityProviderStrategy](#API_PutClusterCapacityProviders_RequestSyntax) **   <a name="ECS-PutClusterCapacityProviders-request-defaultCapacityProviderStrategy"></a>
The capacity provider strategy to use by default for the cluster.  
When creating a service or running a task on a cluster, if no capacity provider or launch type is specified then the default capacity provider strategy for the cluster is used.  
A capacity provider strategy consists of one or more capacity providers along with the `base` and `weight` to assign to them. A capacity provider must be associated with the cluster to be used in a capacity provider strategy. The [PutClusterCapacityProviders](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_PutClusterCapacityProviders.html) API is used to associate a capacity provider with a cluster. Only capacity providers with an `ACTIVE` or `UPDATING` status can be used.  
If specifying a capacity provider that uses an Auto Scaling group, the capacity provider must already be created. New capacity providers can be created with the [CreateCapacityProvider](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_CreateCapacityProvider.html) API operation.  
To use a Amazon Fargate capacity provider, specify either the `FARGATE` or `FARGATE_SPOT` capacity providers. The Amazon Fargate capacity providers are available to all accounts and only need to be associated with a cluster to be used.  
Type: Array of [CapacityProviderStrategyItem](API_CapacityProviderStrategyItem.md) objects  
Required: Yes

## Response Syntax


```
{
   "cluster": { 
      "activeServicesCount": number,
      "attachments": [ 
         { 
            "details": [ 
               { 
                  "name": "string",
                  "value": "string"
               }
            ],
            "id": "string",
            "status": "string",
            "type": "string"
         }
      ],
      "attachmentsStatus": "string",
      "capacityProviders": [ "string" ],
      "clusterArn": "string",
      "clusterName": "string",
      "configuration": { 
         "executeCommandConfiguration": { 
            "kmsKeyId": "string",
            "logConfiguration": { 
               "cloudWatchEncryptionEnabled": boolean,
               "cloudWatchLogGroupName": "string",
               "s3BucketName": "string",
               "s3EncryptionEnabled": boolean,
               "s3KeyPrefix": "string"
            },
            "logging": "string"
         },
         "managedStorageConfiguration": { 
            "fargateEphemeralStorageKmsKeyId": "string",
            "kmsKeyId": "string"
         }
      },
      "defaultCapacityProviderStrategy": [ 
         { 
            "base": number,
            "capacityProvider": "string",
            "weight": number
         }
      ],
      "pendingTasksCount": number,
      "registeredContainerInstancesCount": number,
      "runningTasksCount": number,
      "serviceConnectDefaults": { 
         "namespace": "string"
      },
      "settings": [ 
         { 
            "name": "string",
            "value": "string"
         }
      ],
      "statistics": [ 
         { 
            "name": "string",
            "value": "string"
         }
      ],
      "status": "string",
      "tags": [ 
         { 
            "key": "string",
            "value": "string"
         }
      ]
   }
}
```

## 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.

 ** [cluster](#API_PutClusterCapacityProviders_ResponseSyntax) **   <a name="ECS-PutClusterCapacityProviders-response-cluster"></a>
Details about the cluster.  
Type: [Cluster](API_Cluster.md) object

## Errors


For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** ClientException **   
These errors are usually caused by a client action. This client action might be using an action or resource on behalf of a user that doesn't have permissions to use the action or resource. Or, it might be specifying an identifier that isn't valid.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ClusterNotFoundException **   
The specified cluster wasn't found. You can view your available clusters with [ListClusters](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_ListClusters.html). Amazon ECS clusters are Region specific.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** InvalidParameterException **   
The specified parameter isn't valid. Review the available parameters for the API request.  
For more information about service event errors, see [Amazon ECS service event messages](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/service-event-messages-list.html).     
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ResourceInUseException **   
The specified resource is in-use and can't be removed.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ServerException **   
These errors are usually caused by a server issue.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 500

 ** UpdateInProgressException **   
There's already a current Amazon ECS container agent update in progress on the container instance that's specified. If the container agent becomes disconnected while it's in a transitional stage, such as `PENDING` or `STAGING`, the update process can get stuck in that state. However, when the agent reconnects, it resumes where it stopped previously.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

## See Also


For more information about using this API in one of the language-specific Amazon SDKs, see the following:
+  [Amazon Command Line Interface V2](https://docs.amazonaws.cn/goto/cli2/ecs-2014-11-13/PutClusterCapacityProviders) 
+  [Amazon SDK for .NET V4](https://docs.amazonaws.cn/goto/DotNetSDKV4/ecs-2014-11-13/PutClusterCapacityProviders) 
+  [Amazon SDK for C\$1\$1](https://docs.amazonaws.cn/goto/SdkForCpp/ecs-2014-11-13/PutClusterCapacityProviders) 
+  [Amazon SDK for Go v2](https://docs.amazonaws.cn/goto/SdkForGoV2/ecs-2014-11-13/PutClusterCapacityProviders) 
+  [Amazon SDK for Java V2](https://docs.amazonaws.cn/goto/SdkForJavaV2/ecs-2014-11-13/PutClusterCapacityProviders) 
+  [Amazon SDK for JavaScript V3](https://docs.amazonaws.cn/goto/SdkForJavaScriptV3/ecs-2014-11-13/PutClusterCapacityProviders) 
+  [Amazon SDK for Kotlin](https://docs.amazonaws.cn/goto/SdkForKotlin/ecs-2014-11-13/PutClusterCapacityProviders) 
+  [Amazon SDK for PHP V3](https://docs.amazonaws.cn/goto/SdkForPHPV3/ecs-2014-11-13/PutClusterCapacityProviders) 
+  [Amazon SDK for Python](https://docs.amazonaws.cn/goto/boto3/ecs-2014-11-13/PutClusterCapacityProviders) 
+  [Amazon SDK for Ruby V3](https://docs.amazonaws.cn/goto/SdkForRubyV3/ecs-2014-11-13/PutClusterCapacityProviders) 

# RegisterContainerInstance


**Note**  
This action is only used by the Amazon ECS agent, and it is not intended for use outside of the agent.

Registers an EC2 instance into the specified cluster. This instance becomes available to place containers on.

## Request Syntax


```
{
   "attributes": [ 
      { 
         "name": "string",
         "targetId": "string",
         "targetType": "string",
         "value": "string"
      }
   ],
   "cluster": "string",
   "containerInstanceArn": "string",
   "instanceIdentityDocument": "string",
   "instanceIdentityDocumentSignature": "string",
   "platformDevices": [ 
      { 
         "id": "string",
         "type": "string"
      }
   ],
   "tags": [ 
      { 
         "key": "string",
         "value": "string"
      }
   ],
   "totalResources": [ 
      { 
         "doubleValue": number,
         "integerValue": number,
         "longValue": number,
         "name": "string",
         "stringSetValue": [ "string" ],
         "type": "string"
      }
   ],
   "versionInfo": { 
      "agentHash": "string",
      "agentVersion": "string",
      "dockerVersion": "string"
   }
}
```

## Request Parameters


For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [attributes](#API_RegisterContainerInstance_RequestSyntax) **   <a name="ECS-RegisterContainerInstance-request-attributes"></a>
The container instance attributes that this container instance supports.  
Type: Array of [Attribute](API_Attribute.md) objects  
Required: No

 ** [cluster](#API_RegisterContainerInstance_RequestSyntax) **   <a name="ECS-RegisterContainerInstance-request-cluster"></a>
The short name or full Amazon Resource Name (ARN) of the cluster to register your container instance with. If you do not specify a cluster, the default cluster is assumed.  
Type: String  
Required: No

 ** [containerInstanceArn](#API_RegisterContainerInstance_RequestSyntax) **   <a name="ECS-RegisterContainerInstance-request-containerInstanceArn"></a>
The ARN of the container instance (if it was previously registered).  
Type: String  
Required: No

 ** [instanceIdentityDocument](#API_RegisterContainerInstance_RequestSyntax) **   <a name="ECS-RegisterContainerInstance-request-instanceIdentityDocument"></a>
The instance identity document for the EC2 instance to register. This document can be found by running the following command from the instance: `curl http://169.254.169.254/latest/dynamic/instance-identity/document/`   
Type: String  
Required: No

 ** [instanceIdentityDocumentSignature](#API_RegisterContainerInstance_RequestSyntax) **   <a name="ECS-RegisterContainerInstance-request-instanceIdentityDocumentSignature"></a>
The instance identity document signature for the EC2 instance to register. This signature can be found by running the following command from the instance: `curl http://169.254.169.254/latest/dynamic/instance-identity/signature/`   
Type: String  
Required: No

 ** [platformDevices](#API_RegisterContainerInstance_RequestSyntax) **   <a name="ECS-RegisterContainerInstance-request-platformDevices"></a>
The devices that are available on the container instance. The only supported device type is a GPU.  
Type: Array of [PlatformDevice](API_PlatformDevice.md) objects  
Required: No

 ** [tags](#API_RegisterContainerInstance_RequestSyntax) **   <a name="ECS-RegisterContainerInstance-request-tags"></a>
The metadata that you apply to the container instance 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 Amazon 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.
Type: Array of [Tag](API_Tag.md) objects  
Array Members: Minimum number of 0 items. Maximum number of 50 items.  
Required: No

 ** [totalResources](#API_RegisterContainerInstance_RequestSyntax) **   <a name="ECS-RegisterContainerInstance-request-totalResources"></a>
The resources available on the instance.  
Type: Array of [Resource](API_Resource.md) objects  
Required: No

 ** [versionInfo](#API_RegisterContainerInstance_RequestSyntax) **   <a name="ECS-RegisterContainerInstance-request-versionInfo"></a>
The version information for the Amazon ECS container agent and Docker daemon that runs on the container instance.  
Type: [VersionInfo](API_VersionInfo.md) object  
Required: No

## Response Syntax


```
{
   "containerInstance": { 
      "agentConnected": boolean,
      "agentUpdateStatus": "string",
      "attachments": [ 
         { 
            "details": [ 
               { 
                  "name": "string",
                  "value": "string"
               }
            ],
            "id": "string",
            "status": "string",
            "type": "string"
         }
      ],
      "attributes": [ 
         { 
            "name": "string",
            "targetId": "string",
            "targetType": "string",
            "value": "string"
         }
      ],
      "capacityProviderName": "string",
      "containerInstanceArn": "string",
      "ec2InstanceId": "string",
      "healthStatus": { 
         "details": [ 
            { 
               "lastStatusChange": number,
               "lastUpdated": number,
               "status": "string",
               "type": "string"
            }
         ],
         "overallStatus": "string"
      },
      "pendingTasksCount": number,
      "registeredAt": number,
      "registeredResources": [ 
         { 
            "doubleValue": number,
            "integerValue": number,
            "longValue": number,
            "name": "string",
            "stringSetValue": [ "string" ],
            "type": "string"
         }
      ],
      "remainingResources": [ 
         { 
            "doubleValue": number,
            "integerValue": number,
            "longValue": number,
            "name": "string",
            "stringSetValue": [ "string" ],
            "type": "string"
         }
      ],
      "runningTasksCount": number,
      "status": "string",
      "statusReason": "string",
      "tags": [ 
         { 
            "key": "string",
            "value": "string"
         }
      ],
      "version": number,
      "versionInfo": { 
         "agentHash": "string",
         "agentVersion": "string",
         "dockerVersion": "string"
      }
   }
}
```

## 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.

 ** [containerInstance](#API_RegisterContainerInstance_ResponseSyntax) **   <a name="ECS-RegisterContainerInstance-response-containerInstance"></a>
The container instance that was registered.  
Type: [ContainerInstance](API_ContainerInstance.md) object

## Errors


For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** ClientException **   
These errors are usually caused by a client action. This client action might be using an action or resource on behalf of a user that doesn't have permissions to use the action or resource. Or, it might be specifying an identifier that isn't valid.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** InvalidParameterException **   
The specified parameter isn't valid. Review the available parameters for the API request.  
For more information about service event errors, see [Amazon ECS service event messages](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/service-event-messages-list.html).     
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ServerException **   
These errors are usually caused by a server issue.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 500

## See Also


For more information about using this API in one of the language-specific Amazon SDKs, see the following:
+  [Amazon Command Line Interface V2](https://docs.amazonaws.cn/goto/cli2/ecs-2014-11-13/RegisterContainerInstance) 
+  [Amazon SDK for .NET V4](https://docs.amazonaws.cn/goto/DotNetSDKV4/ecs-2014-11-13/RegisterContainerInstance) 
+  [Amazon SDK for C\$1\$1](https://docs.amazonaws.cn/goto/SdkForCpp/ecs-2014-11-13/RegisterContainerInstance) 
+  [Amazon SDK for Go v2](https://docs.amazonaws.cn/goto/SdkForGoV2/ecs-2014-11-13/RegisterContainerInstance) 
+  [Amazon SDK for Java V2](https://docs.amazonaws.cn/goto/SdkForJavaV2/ecs-2014-11-13/RegisterContainerInstance) 
+  [Amazon SDK for JavaScript V3](https://docs.amazonaws.cn/goto/SdkForJavaScriptV3/ecs-2014-11-13/RegisterContainerInstance) 
+  [Amazon SDK for Kotlin](https://docs.amazonaws.cn/goto/SdkForKotlin/ecs-2014-11-13/RegisterContainerInstance) 
+  [Amazon SDK for PHP V3](https://docs.amazonaws.cn/goto/SdkForPHPV3/ecs-2014-11-13/RegisterContainerInstance) 
+  [Amazon SDK for Python](https://docs.amazonaws.cn/goto/boto3/ecs-2014-11-13/RegisterContainerInstance) 
+  [Amazon SDK for Ruby V3](https://docs.amazonaws.cn/goto/SdkForRubyV3/ecs-2014-11-13/RegisterContainerInstance) 

# RegisterDaemonTaskDefinition


Registers a new daemon task definition from the supplied `family` and `containerDefinitions`. Optionally, you can add data volumes to your containers with the `volumes` parameter. For more information, see [Daemon task definitions](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/daemon-task-definitions.html) in the *Amazon Elastic Container Service Developer Guide*.

A daemon task definition is a template that describes the containers that form a daemon. Daemons deploy cross-cutting software agents such as security monitoring, telemetry, and logging across your Amazon ECS infrastructure.

Each time you call `RegisterDaemonTaskDefinition`, a new revision of the daemon task definition is created. You can't modify a revision after you register it.

## Request Syntax


```
{
   "containerDefinitions": [ 
      { 
         "command": [ "string" ],
         "cpu": number,
         "dependsOn": [ 
            { 
               "condition": "string",
               "containerName": "string"
            }
         ],
         "entryPoint": [ "string" ],
         "environment": [ 
            { 
               "name": "string",
               "value": "string"
            }
         ],
         "environmentFiles": [ 
            { 
               "type": "string",
               "value": "string"
            }
         ],
         "essential": boolean,
         "firelensConfiguration": { 
            "options": { 
               "string" : "string" 
            },
            "type": "string"
         },
         "healthCheck": { 
            "command": [ "string" ],
            "interval": number,
            "retries": number,
            "startPeriod": number,
            "timeout": number
         },
         "image": "string",
         "interactive": boolean,
         "linuxParameters": { 
            "capabilities": { 
               "add": [ "string" ],
               "drop": [ "string" ]
            },
            "devices": [ 
               { 
                  "containerPath": "string",
                  "hostPath": "string",
                  "permissions": [ "string" ]
               }
            ],
            "initProcessEnabled": boolean,
            "tmpfs": [ 
               { 
                  "containerPath": "string",
                  "mountOptions": [ "string" ],
                  "size": number
               }
            ]
         },
         "logConfiguration": { 
            "logDriver": "string",
            "options": { 
               "string" : "string" 
            },
            "secretOptions": [ 
               { 
                  "name": "string",
                  "valueFrom": "string"
               }
            ]
         },
         "memory": number,
         "memoryReservation": number,
         "mountPoints": [ 
            { 
               "containerPath": "string",
               "readOnly": boolean,
               "sourceVolume": "string"
            }
         ],
         "name": "string",
         "privileged": boolean,
         "pseudoTerminal": boolean,
         "readonlyRootFilesystem": boolean,
         "repositoryCredentials": { 
            "credentialsParameter": "string"
         },
         "restartPolicy": { 
            "enabled": boolean,
            "ignoredExitCodes": [ number ],
            "restartAttemptPeriod": number
         },
         "secrets": [ 
            { 
               "name": "string",
               "valueFrom": "string"
            }
         ],
         "startTimeout": number,
         "stopTimeout": number,
         "systemControls": [ 
            { 
               "namespace": "string",
               "value": "string"
            }
         ],
         "ulimits": [ 
            { 
               "hardLimit": number,
               "name": "string",
               "softLimit": number
            }
         ],
         "user": "string",
         "workingDirectory": "string"
      }
   ],
   "cpu": "string",
   "executionRoleArn": "string",
   "family": "string",
   "memory": "string",
   "tags": [ 
      { 
         "key": "string",
         "value": "string"
      }
   ],
   "taskRoleArn": "string",
   "volumes": [ 
      { 
         "host": { 
            "sourcePath": "string"
         },
         "name": "string"
      }
   ]
}
```

## Request Parameters


For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [containerDefinitions](#API_RegisterDaemonTaskDefinition_RequestSyntax) **   <a name="ECS-RegisterDaemonTaskDefinition-request-containerDefinitions"></a>
A list of container definitions in JSON format that describe the containers that make up your daemon task.  
Type: Array of [DaemonContainerDefinition](API_DaemonContainerDefinition.md) objects  
Required: Yes

 ** [cpu](#API_RegisterDaemonTaskDefinition_RequestSyntax) **   <a name="ECS-RegisterDaemonTaskDefinition-request-cpu"></a>
The number of CPU units used by the daemon task. It can be expressed as an integer using CPU units (for example, `1024`).  
Type: String  
Required: No

 ** [executionRoleArn](#API_RegisterDaemonTaskDefinition_RequestSyntax) **   <a name="ECS-RegisterDaemonTaskDefinition-request-executionRoleArn"></a>
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 role is required for daemon tasks that pull container images from Amazon ECR or send container logs to CloudWatch.  
Type: String  
Required: No

 ** [family](#API_RegisterDaemonTaskDefinition_RequestSyntax) **   <a name="ECS-RegisterDaemonTaskDefinition-request-family"></a>
You must specify a `family` for a daemon task definition. This family is used as a name for your daemon task definition. Up to 255 letters (uppercase and lowercase), numbers, underscores, and hyphens are allowed.  
Type: String  
Required: Yes

 ** [memory](#API_RegisterDaemonTaskDefinition_RequestSyntax) **   <a name="ECS-RegisterDaemonTaskDefinition-request-memory"></a>
The amount of memory (in MiB) used by the daemon task. It can be expressed as an integer using MiB (for example, `1024`).  
Type: String  
Required: No

 ** [tags](#API_RegisterDaemonTaskDefinition_RequestSyntax) **   <a name="ECS-RegisterDaemonTaskDefinition-request-tags"></a>
The metadata that you apply to the daemon 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: \$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 Amazon 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.
Type: Array of [Tag](API_Tag.md) objects  
Array Members: Minimum number of 0 items. Maximum number of 50 items.  
Required: No

 ** [taskRoleArn](#API_RegisterDaemonTaskDefinition_RequestSyntax) **   <a name="ECS-RegisterDaemonTaskDefinition-request-taskRoleArn"></a>
The short name or full Amazon Resource Name (ARN) of the IAM role that containers in this daemon task can assume. All containers in this daemon task are granted the permissions that are specified in this role.  
Type: String  
Required: No

 ** [volumes](#API_RegisterDaemonTaskDefinition_RequestSyntax) **   <a name="ECS-RegisterDaemonTaskDefinition-request-volumes"></a>
A list of volume definitions in JSON format that containers in your daemon task can use.  
Type: Array of [DaemonVolume](API_DaemonVolume.md) objects  
Required: No

## Response Syntax


```
{
   "daemonTaskDefinitionArn": "string"
}
```

## 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.

 ** [daemonTaskDefinitionArn](#API_RegisterDaemonTaskDefinition_ResponseSyntax) **   <a name="ECS-RegisterDaemonTaskDefinition-response-daemonTaskDefinitionArn"></a>
The full Amazon Resource Name (ARN) of the registered daemon task definition.  
Type: String

## Errors


For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** AccessDeniedException **   
You don't have authorization to perform the requested action.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ClientException **   
These errors are usually caused by a client action. This client action might be using an action or resource on behalf of a user that doesn't have permissions to use the action or resource. Or, it might be specifying an identifier that isn't valid.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** InvalidParameterException **   
The specified parameter isn't valid. Review the available parameters for the API request.  
For more information about service event errors, see [Amazon ECS service event messages](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/service-event-messages-list.html).     
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** LimitExceededException **   
The limit for the resource was exceeded.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ServerException **   
These errors are usually caused by a server issue.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 500

## Examples


In the following example or examples, the Authorization header contents (`AUTHPARAMS`) must be replaced with an Amazon Signature Version 4 signature. For more information, see [Signature Version 4 Signing Process](https://docs.amazonaws.cn/general/latest/gr/signature-version-4.html) in the * Amazon General Reference*.

You only need to learn how to sign HTTP requests if you intend to create them manually. When you use the [Amazon Command Line Interface](http://www.amazonaws.cn/cli/) or one of the [Amazon SDKs](http://www.amazonaws.cn/tools/) to make requests to Amazon, these tools automatically sign the requests for you, with the access key that you specify when you configure the tools. When you use these tools, you don't have to sign requests yourself.

### Example


This example registers a daemon task definition in the monitoring-agent family with a single container that runs a CloudWatch agent.

#### Sample Request


```
POST / HTTP/1.1
Host: ecs.us-east-1.amazonaws.com
Accept-Encoding: identity
X-Amz-Target: AmazonEC2ContainerServiceV20141113.RegisterDaemonTaskDefinition
X-Amz-Date: 20250315T103000Z
Content-Type: application/x-amz-json-1.1
Authorization: AUTHPARAMS

{
  "family": "monitoring-agent",
  "containerDefinitions": [
    {
      "name": "cloudwatch-agent",
      "image": "public.ecr.aws/cloudwatch-agent/cloudwatch-agent:latest",
      "memory": 256,
      "cpu": 128,
      "essential": true,
      "logConfiguration": {
        "logDriver": "awslogs",
        "options": {
          "awslogs-group": "/ecs/daemon/monitoring-agent",
          "awslogs-region": "us-east-1",
          "awslogs-stream-prefix": "ecs"
        }
      },
      "environment": [
        {
          "name": "USE_DEFAULT_CONFIG",
          "value": "true"
        }
      ]
    }
  ],
  "cpu": "128",
  "memory": "256",
  "executionRoleArn": "arn:aws:iam::123456789012:role/ecsTaskExecutionRole",
  "taskRoleArn": "arn:aws:iam::123456789012:role/ecsDaemonTaskRole"
}
```

#### Sample Response


```
HTTP/1.1 200 OK
Server: Server
Date: Sat, 15 Mar 2025 10:30:00 GMT
Content-Type: application/x-amz-json-1.1
Content-Length: 97
Connection: keep-alive
x-amzn-RequestId: 123a4b56-7c89-01d2-3ef4-example5678f

{
  "daemonTaskDefinitionArn": "arn:aws:ecs:us-east-1:123456789012:daemon-task-definition/monitoring-agent:1"
}
```

## See Also


For more information about using this API in one of the language-specific Amazon SDKs, see the following:
+  [Amazon Command Line Interface V2](https://docs.amazonaws.cn/goto/cli2/ecs-2014-11-13/RegisterDaemonTaskDefinition) 
+  [Amazon SDK for .NET V4](https://docs.amazonaws.cn/goto/DotNetSDKV4/ecs-2014-11-13/RegisterDaemonTaskDefinition) 
+  [Amazon SDK for C\$1\$1](https://docs.amazonaws.cn/goto/SdkForCpp/ecs-2014-11-13/RegisterDaemonTaskDefinition) 
+  [Amazon SDK for Go v2](https://docs.amazonaws.cn/goto/SdkForGoV2/ecs-2014-11-13/RegisterDaemonTaskDefinition) 
+  [Amazon SDK for Java V2](https://docs.amazonaws.cn/goto/SdkForJavaV2/ecs-2014-11-13/RegisterDaemonTaskDefinition) 
+  [Amazon SDK for JavaScript V3](https://docs.amazonaws.cn/goto/SdkForJavaScriptV3/ecs-2014-11-13/RegisterDaemonTaskDefinition) 
+  [Amazon SDK for Kotlin](https://docs.amazonaws.cn/goto/SdkForKotlin/ecs-2014-11-13/RegisterDaemonTaskDefinition) 
+  [Amazon SDK for PHP V3](https://docs.amazonaws.cn/goto/SdkForPHPV3/ecs-2014-11-13/RegisterDaemonTaskDefinition) 
+  [Amazon SDK for Python](https://docs.amazonaws.cn/goto/boto3/ecs-2014-11-13/RegisterDaemonTaskDefinition) 
+  [Amazon SDK for Ruby V3](https://docs.amazonaws.cn/goto/SdkForRubyV3/ecs-2014-11-13/RegisterDaemonTaskDefinition) 

# RegisterTaskDefinition


Registers a new task definition from the supplied `family` and `containerDefinitions`. Optionally, you can add data volumes to your containers with the `volumes` parameter. For more information about task definition parameters and defaults, see [Amazon ECS Task Definitions](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/task_defintions.html) in the *Amazon Elastic Container Service Developer Guide*.

You can specify a role for your task with the `taskRoleArn` parameter. When you specify a role for a task, its containers can then use the latest versions of the Amazon CLI or SDKs to make API requests to the Amazon services that are specified in the policy that's associated with the role. For more information, see [IAM Roles for Tasks](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/task-iam-roles.html) in the *Amazon Elastic Container Service Developer Guide*.

You can specify a Docker networking mode for the containers in your task definition with the `networkMode` parameter. If you specify the `awsvpc` network mode, the task is allocated an elastic network interface, and you must specify a [NetworkConfiguration](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_NetworkConfiguration.html) when you create a service or run a task with the task definition. For more information, see [Task Networking](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/task-networking.html) in the *Amazon Elastic Container Service Developer Guide*.

## Request Syntax


```
{
   "containerDefinitions": [ 
      { 
         "command": [ "string" ],
         "cpu": number,
         "credentialSpecs": [ "string" ],
         "dependsOn": [ 
            { 
               "condition": "string",
               "containerName": "string"
            }
         ],
         "disableNetworking": boolean,
         "dnsSearchDomains": [ "string" ],
         "dnsServers": [ "string" ],
         "dockerLabels": { 
            "string" : "string" 
         },
         "dockerSecurityOptions": [ "string" ],
         "entryPoint": [ "string" ],
         "environment": [ 
            { 
               "name": "string",
               "value": "string"
            }
         ],
         "environmentFiles": [ 
            { 
               "type": "string",
               "value": "string"
            }
         ],
         "essential": boolean,
         "extraHosts": [ 
            { 
               "hostname": "string",
               "ipAddress": "string"
            }
         ],
         "firelensConfiguration": { 
            "options": { 
               "string" : "string" 
            },
            "type": "string"
         },
         "healthCheck": { 
            "command": [ "string" ],
            "interval": number,
            "retries": number,
            "startPeriod": number,
            "timeout": number
         },
         "hostname": "string",
         "image": "string",
         "interactive": boolean,
         "links": [ "string" ],
         "linuxParameters": { 
            "capabilities": { 
               "add": [ "string" ],
               "drop": [ "string" ]
            },
            "devices": [ 
               { 
                  "containerPath": "string",
                  "hostPath": "string",
                  "permissions": [ "string" ]
               }
            ],
            "initProcessEnabled": boolean,
            "maxSwap": number,
            "sharedMemorySize": number,
            "swappiness": number,
            "tmpfs": [ 
               { 
                  "containerPath": "string",
                  "mountOptions": [ "string" ],
                  "size": number
               }
            ]
         },
         "logConfiguration": { 
            "logDriver": "string",
            "options": { 
               "string" : "string" 
            },
            "secretOptions": [ 
               { 
                  "name": "string",
                  "valueFrom": "string"
               }
            ]
         },
         "memory": number,
         "memoryReservation": number,
         "mountPoints": [ 
            { 
               "containerPath": "string",
               "readOnly": boolean,
               "sourceVolume": "string"
            }
         ],
         "name": "string",
         "portMappings": [ 
            { 
               "appProtocol": "string",
               "containerPort": number,
               "containerPortRange": "string",
               "hostPort": number,
               "name": "string",
               "protocol": "string"
            }
         ],
         "privileged": boolean,
         "pseudoTerminal": boolean,
         "readonlyRootFilesystem": boolean,
         "repositoryCredentials": { 
            "credentialsParameter": "string"
         },
         "resourceRequirements": [ 
            { 
               "type": "string",
               "value": "string"
            }
         ],
         "restartPolicy": { 
            "enabled": boolean,
            "ignoredExitCodes": [ number ],
            "restartAttemptPeriod": number
         },
         "secrets": [ 
            { 
               "name": "string",
               "valueFrom": "string"
            }
         ],
         "startTimeout": number,
         "stopTimeout": number,
         "systemControls": [ 
            { 
               "namespace": "string",
               "value": "string"
            }
         ],
         "ulimits": [ 
            { 
               "hardLimit": number,
               "name": "string",
               "softLimit": number
            }
         ],
         "user": "string",
         "versionConsistency": "string",
         "volumesFrom": [ 
            { 
               "readOnly": boolean,
               "sourceContainer": "string"
            }
         ],
         "workingDirectory": "string"
      }
   ],
   "cpu": "string",
   "enableFaultInjection": boolean,
   "ephemeralStorage": { 
      "sizeInGiB": number
   },
   "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",
   "volumes": [ 
      { 
         "configuredAtLaunch": boolean,
         "dockerVolumeConfiguration": { 
            "autoprovision": boolean,
            "driver": "string",
            "driverOpts": { 
               "string" : "string" 
            },
            "labels": { 
               "string" : "string" 
            },
            "scope": "string"
         },
         "efsVolumeConfiguration": { 
            "authorizationConfig": { 
               "accessPointId": "string",
               "iam": "string"
            },
            "fileSystemId": "string",
            "rootDirectory": "string",
            "transitEncryption": "string",
            "transitEncryptionPort": number
         },
         "fsxWindowsFileServerVolumeConfiguration": { 
            "authorizationConfig": { 
               "credentialsParameter": "string",
               "domain": "string"
            },
            "fileSystemId": "string",
            "rootDirectory": "string"
         },
         "host": { 
            "sourcePath": "string"
         },
         "name": "string"
      }
   ]
}
```

## Request Parameters


For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [containerDefinitions](#API_RegisterTaskDefinition_RequestSyntax) **   <a name="ECS-RegisterTaskDefinition-request-containerDefinitions"></a>
A list of container definitions in JSON format that describe the different containers that make up your task.  
Type: Array of [ContainerDefinition](API_ContainerDefinition.md) objects  
Required: Yes

 ** [cpu](#API_RegisterTaskDefinition_RequestSyntax) **   <a name="ECS-RegisterTaskDefinition-request-cpu"></a>
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 or external launch type, this field is optional. Supported values are between `128` CPU units (`0.125` vCPUs) and `196608` CPU units (`192` vCPUs). If you do not specify a value, the parameter is ignored.  
This field is required for Fargate. For information about the valid values, see [Task size](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/task_definition_parameters.html#task_size) in the *Amazon Elastic Container Service Developer Guide*.  
Type: String  
Required: No

 ** [enableFaultInjection](#API_RegisterTaskDefinition_RequestSyntax) **   <a name="ECS-RegisterTaskDefinition-request-enableFaultInjection"></a>
Enables fault injection when you register your task definition and allows for fault injection requests to be accepted from the task's containers. The default value is `false`.  
Type: Boolean  
Required: No

 ** [ephemeralStorage](#API_RegisterTaskDefinition_RequestSyntax) **   <a name="ECS-RegisterTaskDefinition-request-ephemeralStorage"></a>
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 Amazon Fargate. For more information, see [Using data volumes in tasks](https://docs.amazonaws.cn/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.
Type: [EphemeralStorage](API_EphemeralStorage.md) object  
Required: No

 ** [executionRoleArn](#API_RegisterTaskDefinition_RequestSyntax) **   <a name="ECS-RegisterTaskDefinition-request-executionRoleArn"></a>
The Amazon Resource Name (ARN) of the task execution role that grants the Amazon ECS container agent permission to make Amazon API calls on your behalf. For informationabout the required IAM roles for Amazon ECS, see [IAM roles for Amazon ECS](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/security-ecs-iam-role-overview.html) in the *Amazon Elastic Container Service Developer Guide*.  
Type: String  
Required: No

 ** [family](#API_RegisterTaskDefinition_RequestSyntax) **   <a name="ECS-RegisterTaskDefinition-request-family"></a>
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.  
Type: String  
Required: Yes

 ** [inferenceAccelerators](#API_RegisterTaskDefinition_RequestSyntax) **   <a name="ECS-RegisterTaskDefinition-request-inferenceAccelerators"></a>
The Elastic Inference accelerators to use for the containers in the task.  
Type: Array of [InferenceAccelerator](API_InferenceAccelerator.md) objects  
Required: No

 ** [ipcMode](#API_RegisterTaskDefinition_RequestSyntax) **   <a name="ECS-RegisterTaskDefinition-request-ipcMode"></a>
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.  
If the `host` IPC mode is used, be aware that there is a heightened risk of undesired IPC namespace expose.  
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.amazonaws.cn/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 Amazon Fargate.
Type: String  
Valid Values: `host | task | none`   
Required: No

 ** [memory](#API_RegisterTaskDefinition_RequestSyntax) **   <a name="ECS-RegisterTaskDefinition-request-memory"></a>
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.
Type: String  
Required: No

 ** [networkMode](#API_RegisterTaskDefinition_RequestSyntax) **   <a name="ECS-RegisterTaskDefinition-request-networkMode"></a>
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, `<default>` or `awsvpc` 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](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_NetworkConfiguration.html) value when you create a service or run a task with the task definition. For more information, see [Task Networking](https://docs.amazonaws.cn/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.  
Type: String  
Valid Values: `bridge | host | awsvpc | none`   
Required: No

 ** [pidMode](#API_RegisterTaskDefinition_RequestSyntax) **   <a name="ECS-RegisterTaskDefinition-request-pidMode"></a>
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 The default is a private namespace for each container.  
If the `host` PID mode is used, there's a heightened risk of undesired process namespace exposure.  
This parameter is not supported for Windows containers.
This parameter is only supported for tasks that are hosted on Amazon Fargate if the tasks are using platform version `1.4.0` or later (Linux). This isn't supported for Windows containers on Fargate.
Type: String  
Valid Values: `host | task`   
Required: No

 ** [placementConstraints](#API_RegisterTaskDefinition_RequestSyntax) **   <a name="ECS-RegisterTaskDefinition-request-placementConstraints"></a>
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.  
Type: Array of [TaskDefinitionPlacementConstraint](API_TaskDefinitionPlacementConstraint.md) objects  
Required: No

 ** [proxyConfiguration](#API_RegisterTaskDefinition_RequestSyntax) **   <a name="ECS-RegisterTaskDefinition-request-proxyConfiguration"></a>
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.amazonaws.cn/AmazonECS/latest/developerguide/ecs-ami-versions.html) in the *Amazon Elastic Container Service Developer Guide*.  
Type: [ProxyConfiguration](API_ProxyConfiguration.md) object  
Required: No

 ** [requiresCompatibilities](#API_RegisterTaskDefinition_RequestSyntax) **   <a name="ECS-RegisterTaskDefinition-request-requiresCompatibilities"></a>
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.  
Type: Array of strings  
Valid Values: `EC2 | FARGATE | EXTERNAL | MANAGED_INSTANCES`   
Required: No

 ** [runtimePlatform](#API_RegisterTaskDefinition_RequestSyntax) **   <a name="ECS-RegisterTaskDefinition-request-runtimePlatform"></a>
The operating system that your tasks definitions run on.  
Type: [RuntimePlatform](API_RuntimePlatform.md) object  
Required: No

 ** [tags](#API_RegisterTaskDefinition_RequestSyntax) **   <a name="ECS-RegisterTaskDefinition-request-tags"></a>
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: \$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 Amazon 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.
Type: Array of [Tag](API_Tag.md) objects  
Array Members: Minimum number of 0 items. Maximum number of 50 items.  
Required: No

 ** [taskRoleArn](#API_RegisterTaskDefinition_RequestSyntax) **   <a name="ECS-RegisterTaskDefinition-request-taskRoleArn"></a>
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.amazonaws.cn/AmazonECS/latest/developerguide/task-iam-roles.html) in the *Amazon Elastic Container Service Developer Guide*.  
Type: String  
Required: No

 ** [volumes](#API_RegisterTaskDefinition_RequestSyntax) **   <a name="ECS-RegisterTaskDefinition-request-volumes"></a>
A list of volume definitions in JSON format that containers in your task might use.  
Type: Array of [Volume](API_Volume.md) objects  
Required: No

## Response Syntax


```
{
   "tags": [ 
      { 
         "key": "string",
         "value": "string"
      }
   ],
   "taskDefinition": { 
      "compatibilities": [ "string" ],
      "containerDefinitions": [ 
         { 
            "command": [ "string" ],
            "cpu": number,
            "credentialSpecs": [ "string" ],
            "dependsOn": [ 
               { 
                  "condition": "string",
                  "containerName": "string"
               }
            ],
            "disableNetworking": boolean,
            "dnsSearchDomains": [ "string" ],
            "dnsServers": [ "string" ],
            "dockerLabels": { 
               "string" : "string" 
            },
            "dockerSecurityOptions": [ "string" ],
            "entryPoint": [ "string" ],
            "environment": [ 
               { 
                  "name": "string",
                  "value": "string"
               }
            ],
            "environmentFiles": [ 
               { 
                  "type": "string",
                  "value": "string"
               }
            ],
            "essential": boolean,
            "extraHosts": [ 
               { 
                  "hostname": "string",
                  "ipAddress": "string"
               }
            ],
            "firelensConfiguration": { 
               "options": { 
                  "string" : "string" 
               },
               "type": "string"
            },
            "healthCheck": { 
               "command": [ "string" ],
               "interval": number,
               "retries": number,
               "startPeriod": number,
               "timeout": number
            },
            "hostname": "string",
            "image": "string",
            "interactive": boolean,
            "links": [ "string" ],
            "linuxParameters": { 
               "capabilities": { 
                  "add": [ "string" ],
                  "drop": [ "string" ]
               },
               "devices": [ 
                  { 
                     "containerPath": "string",
                     "hostPath": "string",
                     "permissions": [ "string" ]
                  }
               ],
               "initProcessEnabled": boolean,
               "maxSwap": number,
               "sharedMemorySize": number,
               "swappiness": number,
               "tmpfs": [ 
                  { 
                     "containerPath": "string",
                     "mountOptions": [ "string" ],
                     "size": number
                  }
               ]
            },
            "logConfiguration": { 
               "logDriver": "string",
               "options": { 
                  "string" : "string" 
               },
               "secretOptions": [ 
                  { 
                     "name": "string",
                     "valueFrom": "string"
                  }
               ]
            },
            "memory": number,
            "memoryReservation": number,
            "mountPoints": [ 
               { 
                  "containerPath": "string",
                  "readOnly": boolean,
                  "sourceVolume": "string"
               }
            ],
            "name": "string",
            "portMappings": [ 
               { 
                  "appProtocol": "string",
                  "containerPort": number,
                  "containerPortRange": "string",
                  "hostPort": number,
                  "name": "string",
                  "protocol": "string"
               }
            ],
            "privileged": boolean,
            "pseudoTerminal": boolean,
            "readonlyRootFilesystem": boolean,
            "repositoryCredentials": { 
               "credentialsParameter": "string"
            },
            "resourceRequirements": [ 
               { 
                  "type": "string",
                  "value": "string"
               }
            ],
            "restartPolicy": { 
               "enabled": boolean,
               "ignoredExitCodes": [ number ],
               "restartAttemptPeriod": number
            },
            "secrets": [ 
               { 
                  "name": "string",
                  "valueFrom": "string"
               }
            ],
            "startTimeout": number,
            "stopTimeout": number,
            "systemControls": [ 
               { 
                  "namespace": "string",
                  "value": "string"
               }
            ],
            "ulimits": [ 
               { 
                  "hardLimit": number,
                  "name": "string",
                  "softLimit": number
               }
            ],
            "user": "string",
            "versionConsistency": "string",
            "volumesFrom": [ 
               { 
                  "readOnly": boolean,
                  "sourceContainer": "string"
               }
            ],
            "workingDirectory": "string"
         }
      ],
      "cpu": "string",
      "deleteRequestedAt": number,
      "deregisteredAt": number,
      "enableFaultInjection": boolean,
      "ephemeralStorage": { 
         "sizeInGiB": number
      },
      "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"
      },
      "registeredAt": number,
      "registeredBy": "string",
      "requiresAttributes": [ 
         { 
            "name": "string",
            "targetId": "string",
            "targetType": "string",
            "value": "string"
         }
      ],
      "requiresCompatibilities": [ "string" ],
      "revision": number,
      "runtimePlatform": { 
         "cpuArchitecture": "string",
         "operatingSystemFamily": "string"
      },
      "status": "string",
      "taskDefinitionArn": "string",
      "taskRoleArn": "string",
      "volumes": [ 
         { 
            "configuredAtLaunch": boolean,
            "dockerVolumeConfiguration": { 
               "autoprovision": boolean,
               "driver": "string",
               "driverOpts": { 
                  "string" : "string" 
               },
               "labels": { 
                  "string" : "string" 
               },
               "scope": "string"
            },
            "efsVolumeConfiguration": { 
               "authorizationConfig": { 
                  "accessPointId": "string",
                  "iam": "string"
               },
               "fileSystemId": "string",
               "rootDirectory": "string",
               "transitEncryption": "string",
               "transitEncryptionPort": number
            },
            "fsxWindowsFileServerVolumeConfiguration": { 
               "authorizationConfig": { 
                  "credentialsParameter": "string",
                  "domain": "string"
               },
               "fileSystemId": "string",
               "rootDirectory": "string"
            },
            "host": { 
               "sourcePath": "string"
            },
            "name": "string"
         }
      ]
   }
}
```

## 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.

 ** [tags](#API_RegisterTaskDefinition_ResponseSyntax) **   <a name="ECS-RegisterTaskDefinition-response-tags"></a>
The list of tags associated with the task definition.  
Type: Array of [Tag](API_Tag.md) objects  
Array Members: Minimum number of 0 items. Maximum number of 50 items.

 ** [taskDefinition](#API_RegisterTaskDefinition_ResponseSyntax) **   <a name="ECS-RegisterTaskDefinition-response-taskDefinition"></a>
The full description of the registered task definition.  
Type: [TaskDefinition](API_TaskDefinition.md) object

## Errors


For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** ClientException **   
These errors are usually caused by a client action. This client action might be using an action or resource on behalf of a user that doesn't have permissions to use the action or resource. Or, it might be specifying an identifier that isn't valid.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** InvalidParameterException **   
The specified parameter isn't valid. Review the available parameters for the API request.  
For more information about service event errors, see [Amazon ECS service event messages](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/service-event-messages-list.html).     
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ServerException **   
These errors are usually caused by a server issue.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 500

## Examples


In the following example or examples, the Authorization header contents (`AUTHPARAMS`) must be replaced with an Amazon Signature Version 4 signature. For more information, see [Signature Version 4 Signing Process](https://docs.amazonaws.cn/general/latest/gr/signature-version-4.html) in the * Amazon General Reference*.

You only need to learn how to sign HTTP requests if you intend to create them manually. When you use the [Amazon Command Line Interface](http://www.amazonaws.cn/cli/) or one of the [Amazon SDKs](http://www.amazonaws.cn/tools/) to make requests to Amazon, these tools automatically sign the requests for you, with the access key that you specify when you configure the tools. When you use these tools, you don't have to sign requests yourself.

### Example


This example request registers a task definition in the `hello_world` family with the `host` networking mode.

#### Sample Request


```
POST / HTTP/1.1
Host: ecs.us-east-1.amazonaws.com
Accept-Encoding: identity
Content-Length: 486
X-Amz-Target: AmazonEC2ContainerServiceV20141113.RegisterTaskDefinition
X-Amz-Date: 20150429T193109Z
Content-Type: application/x-amz-json-1.1
Authorization: AUTHPARAMS

{
  "networkMode": "host",
  "containerDefinitions": [
    {
      "name": "wordpress",
      "links": [
        "mysql"
      ],
      "image": "public.ecr.aws/docker/library/wordpress:latest",
      "essential": true,
      "portMappings": [
        {
          "containerPort": 80,
          "hostPort": 80
        }
      ],
      "memory": 500,
      "cpu": 10
    },
    {
      "name": "mysql",
      "image": "public.ecr.aws/docker/library/mysql:latest",
      "cpu": 10,
      "environment": [
        {
          "name": "MYSQL_ROOT_PASSWORD",
          "value": "password"
        }
      ],
      "memory": 500,
      "healthCheck": {
          "retries": 3,
          "command": [
              "CMD-SHELL",
              "curl -f http://localhost:8080/ || exit 1"
          ],
          "timeout": 5,
          "interval": 30,
      },
      "essential": true
    }
  ],
  "family": "hello_world"
}
```

#### Sample Response


```
HTTP/1.1 200 OK
Server: Server
Date: Fri, 12 Aug 2016 22:17:20 GMT
Content-Type: application/x-amz-json-1.1
Content-Length: 714
Connection: keep-alive
x-amzn-RequestId: 896d7e0f-60da-11e6-8e21-55c97a4b6423

{
  "taskDefinition": {
    "containerDefinitions": [
      {
        "cpu": 10,
        "environment": [],
        "healthCheck": {
              "retries": 3,
              "command": [
                  "CMD-SHELL",
                  "curl -f http://localhost:8080/ || exit 1"
              ],
              "timeout": 5,
              "interval": 30,
              "startPeriod": null
        },
        "essential": true,
        "image": "public.ecr.aws/docker/library/wordpress:latest",
        "links": [
          "mysql"
        ],
        "memory": 500,
        "mountPoints": [],
        "name": "wordpress",
        "portMappings": [
          {
            "containerPort": 80,
            "hostPort": 80,
            "protocol": "tcp"
          }
        ],
        "volumesFrom": []
      },
      {
        "cpu": 10,
        "environment": [
          {
            "name": "MYSQL_ROOT_PASSWORD",
            "value": "password"
          }
        ],
        "essential": true,
        "image": "public.ecr.aws/docker/library/mysql:latest",
        "memory": 500,
        "mountPoints": [],
        "name": "mysql",
        "portMappings": [],
        "volumesFrom": []
      }
    ],
    "family": "hello_world",
    "networkMode": "host",
    "runtimePlatform":LINUX
    "requiresAttributes": [
      {
        "name": "com.amazonaws.ecs.capability.docker-remote-api.1.18"
      }
    ],
    "revision": 4,
    "status": "ACTIVE",
    "taskDefinitionArn": "arn:aws:ecs:us-east-1:012345678910:task-definition/hello_world:4",
    "volumes": []
  }
}
```

## See Also


For more information about using this API in one of the language-specific Amazon SDKs, see the following:
+  [Amazon Command Line Interface V2](https://docs.amazonaws.cn/goto/cli2/ecs-2014-11-13/RegisterTaskDefinition) 
+  [Amazon SDK for .NET V4](https://docs.amazonaws.cn/goto/DotNetSDKV4/ecs-2014-11-13/RegisterTaskDefinition) 
+  [Amazon SDK for C\$1\$1](https://docs.amazonaws.cn/goto/SdkForCpp/ecs-2014-11-13/RegisterTaskDefinition) 
+  [Amazon SDK for Go v2](https://docs.amazonaws.cn/goto/SdkForGoV2/ecs-2014-11-13/RegisterTaskDefinition) 
+  [Amazon SDK for Java V2](https://docs.amazonaws.cn/goto/SdkForJavaV2/ecs-2014-11-13/RegisterTaskDefinition) 
+  [Amazon SDK for JavaScript V3](https://docs.amazonaws.cn/goto/SdkForJavaScriptV3/ecs-2014-11-13/RegisterTaskDefinition) 
+  [Amazon SDK for Kotlin](https://docs.amazonaws.cn/goto/SdkForKotlin/ecs-2014-11-13/RegisterTaskDefinition) 
+  [Amazon SDK for PHP V3](https://docs.amazonaws.cn/goto/SdkForPHPV3/ecs-2014-11-13/RegisterTaskDefinition) 
+  [Amazon SDK for Python](https://docs.amazonaws.cn/goto/boto3/ecs-2014-11-13/RegisterTaskDefinition) 
+  [Amazon SDK for Ruby V3](https://docs.amazonaws.cn/goto/SdkForRubyV3/ecs-2014-11-13/RegisterTaskDefinition) 

# RunTask


Starts a new task using the specified task definition.

**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.

**Note**  
Amazon Elastic Inference (EI) is no longer available to customers.

You can allow Amazon ECS to place tasks for you, or you can customize how Amazon ECS places tasks using placement constraints and placement strategies. For more information, see [Scheduling Tasks](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/scheduling_tasks.html) in the *Amazon Elastic Container Service Developer Guide*.

Alternatively, you can use `StartTask` to use your own scheduler or place tasks manually on specific container instances.

You can attach Amazon EBS volumes to Amazon ECS tasks by configuring the volume when creating or updating a service. For more information, see [Amazon EBS volumes](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/ebs-volumes.html#ebs-volume-types) in the *Amazon Elastic Container Service Developer Guide*.

The Amazon ECS API follows an eventual consistency model. This is because of the distributed nature of the system supporting the API. This means that the result of an API command you run that affects your Amazon ECS resources might not be immediately visible to all subsequent commands you run. Keep this in mind when you carry out an API command that immediately follows a previous API command.

To manage eventual consistency, you can do the following:
+ Confirm the state of the resource before you run a command to modify it. Run the DescribeTasks command using an exponential backoff algorithm to ensure that you allow enough time for the previous command to propagate through the system. To do this, run the DescribeTasks command repeatedly, starting with a couple of seconds of wait time and increasing gradually up to five minutes of wait time.
+ Add wait time between subsequent commands, even if the DescribeTasks command returns an accurate response. Apply an exponential backoff algorithm starting with a couple of seconds of wait time, and increase gradually up to about five minutes of wait time.

If you get a `ConflictException` error, the `RunTask` request could not be processed due to conflicts. The provided `clientToken` is already in use with a different `RunTask` request. The `resourceIds` are the existing task ARNs which are already associated with the `clientToken`. 

To fix this issue:
+ Run `RunTask` with a unique `clientToken`.
+ Run `RunTask` with the `clientToken` and the original set of parameters

If you get a `ClientException`error, the `RunTask` could not be processed because you use managed scaling and there is a capacity error because the quota of tasks in the `PROVISIONING` per cluster has been reached. For information about the service quotas, see [Amazon ECS service quotas](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/service-quotas.html).

## Request Syntax


```
{
   "capacityProviderStrategy": [ 
      { 
         "base": number,
         "capacityProvider": "string",
         "weight": number
      }
   ],
   "clientToken": "string",
   "cluster": "string",
   "count": number,
   "enableECSManagedTags": boolean,
   "enableExecuteCommand": boolean,
   "group": "string",
   "launchType": "string",
   "networkConfiguration": { 
      "awsvpcConfiguration": { 
         "assignPublicIp": "string",
         "securityGroups": [ "string" ],
         "subnets": [ "string" ]
      }
   },
   "overrides": { 
      "containerOverrides": [ 
         { 
            "command": [ "string" ],
            "cpu": number,
            "environment": [ 
               { 
                  "name": "string",
                  "value": "string"
               }
            ],
            "environmentFiles": [ 
               { 
                  "type": "string",
                  "value": "string"
               }
            ],
            "memory": number,
            "memoryReservation": number,
            "name": "string",
            "resourceRequirements": [ 
               { 
                  "type": "string",
                  "value": "string"
               }
            ]
         }
      ],
      "cpu": "string",
      "ephemeralStorage": { 
         "sizeInGiB": number
      },
      "executionRoleArn": "string",
      "inferenceAcceleratorOverrides": [ 
         { 
            "deviceName": "string",
            "deviceType": "string"
         }
      ],
      "memory": "string",
      "taskRoleArn": "string"
   },
   "placementConstraints": [ 
      { 
         "expression": "string",
         "type": "string"
      }
   ],
   "placementStrategy": [ 
      { 
         "field": "string",
         "type": "string"
      }
   ],
   "platformVersion": "string",
   "propagateTags": "string",
   "referenceId": "string",
   "startedBy": "string",
   "tags": [ 
      { 
         "key": "string",
         "value": "string"
      }
   ],
   "taskDefinition": "string",
   "volumeConfigurations": [ 
      { 
         "managedEBSVolume": { 
            "encrypted": boolean,
            "filesystemType": "string",
            "iops": number,
            "kmsKeyId": "string",
            "roleArn": "string",
            "sizeInGiB": number,
            "snapshotId": "string",
            "tagSpecifications": [ 
               { 
                  "propagateTags": "string",
                  "resourceType": "string",
                  "tags": [ 
                     { 
                        "key": "string",
                        "value": "string"
                     }
                  ]
               }
            ],
            "terminationPolicy": { 
               "deleteOnTermination": boolean
            },
            "throughput": number,
            "volumeInitializationRate": number,
            "volumeType": "string"
         },
         "name": "string"
      }
   ]
}
```

## Request Parameters


For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [capacityProviderStrategy](#API_RunTask_RequestSyntax) **   <a name="ECS-RunTask-request-capacityProviderStrategy"></a>
The capacity provider strategy to use for the task.  
If you want to use Amazon ECS Managed Instances, you must use the `capacityProviderStrategy` request parameter and omit the `launchType` request parameter.
If a `capacityProviderStrategy` is specified, the `launchType` parameter must be omitted. If no `capacityProviderStrategy` or `launchType` is specified, the `defaultCapacityProviderStrategy` for the cluster is used.  
When you use cluster auto scaling, you must specify `capacityProviderStrategy` and not `launchType`.   
A capacity provider strategy can contain a maximum of 20 capacity providers.  
Type: Array of [CapacityProviderStrategyItem](API_CapacityProviderStrategyItem.md) objects  
Required: No

 ** [clientToken](#API_RunTask_RequestSyntax) **   <a name="ECS-RunTask-request-clientToken"></a>
An identifier that you provide to ensure the idempotency of the request. It must be unique and is case sensitive. Up to 64 characters are allowed. The valid characters are characters in the range of 33-126, inclusive. For more information, see [Ensuring idempotency](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/ECS_Idempotency.html).  
Type: String  
Required: No

 ** [cluster](#API_RunTask_RequestSyntax) **   <a name="ECS-RunTask-request-cluster"></a>
The short name or full Amazon Resource Name (ARN) of the cluster to run your task on. If you do not specify a cluster, the default cluster is assumed.  
Each account receives a default cluster the first time you use the service, but you may also create other clusters.  
Type: String  
Required: No

 ** [count](#API_RunTask_RequestSyntax) **   <a name="ECS-RunTask-request-count"></a>
The number of instantiations of the specified task to place on your cluster. You can specify up to 10 tasks for each call.  
Type: Integer  
Required: No

 ** [enableECSManagedTags](#API_RunTask_RequestSyntax) **   <a name="ECS-RunTask-request-enableECSManagedTags"></a>
Specifies whether to use Amazon ECS managed tags for the task. For more information, see [Tagging Your Amazon ECS Resources](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/ecs-using-tags.html) in the *Amazon Elastic Container Service Developer Guide*.  
Type: Boolean  
Required: No

 ** [enableExecuteCommand](#API_RunTask_RequestSyntax) **   <a name="ECS-RunTask-request-enableExecuteCommand"></a>
Determines whether to use the execute command functionality for the containers in this task. If `true`, this enables execute command functionality on all containers in the task.  
If `true`, then the task definition must have a task role, or you must provide one as an override.  
Type: Boolean  
Required: No

 ** [group](#API_RunTask_RequestSyntax) **   <a name="ECS-RunTask-request-group"></a>
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`).  
Type: String  
Required: No

 ** [launchType](#API_RunTask_RequestSyntax) **   <a name="ECS-RunTask-request-launchType"></a>
The infrastructure to run your standalone task on. For more information, see [Amazon ECS launch types](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/launch_types.html) in the *Amazon Elastic Container Service Developer Guide*.  
If you want to use Amazon ECS Managed Instances, you must use the `capacityProviderStrategy` request parameter and omit the `launchType` request parameter.
The `FARGATE` launch type runs your tasks on Amazon Fargate On-Demand infrastructure.  
Fargate Spot infrastructure is available for use but a capacity provider strategy must be used. For more information, see [Amazon Fargate capacity providers](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/fargate-capacity-providers.html) in the *Amazon ECS Developer Guide*.
The `EC2` launch type runs your tasks on Amazon EC2 instances registered to your cluster.  
The `EXTERNAL` launch type runs your tasks on your on-premises server or virtual machine (VM) capacity registered to your cluster.  
A task can use either a launch type or a capacity provider strategy. If a `launchType` is specified, the `capacityProviderStrategy` parameter must be omitted.  
When you use cluster auto scaling, you must specify `capacityProviderStrategy` and not `launchType`.   
Type: String  
Valid Values: `EC2 | FARGATE | EXTERNAL | MANAGED_INSTANCES`   
Required: No

 ** [networkConfiguration](#API_RunTask_RequestSyntax) **   <a name="ECS-RunTask-request-networkConfiguration"></a>
The network configuration for the task. This parameter is required for task definitions that use the `awsvpc` network mode to receive their own elastic network interface, and it isn't supported for other network modes. For more information, see [Task networking](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/task-networking.html) in the *Amazon Elastic Container Service Developer Guide*.  
Type: [NetworkConfiguration](API_NetworkConfiguration.md) object  
Required: No

 ** [overrides](#API_RunTask_RequestSyntax) **   <a name="ECS-RunTask-request-overrides"></a>
A list of container overrides in JSON format that specify the name of a container in the specified task definition and the overrides it should receive. You can override the default command for a container (that's specified in the task definition or Docker image) with a `command` override. You can also override existing environment variables (that are specified in the task definition or Docker image) on a container or add new environment variables to it with an `environment` override.  
A total of 8192 characters are allowed for overrides. This limit includes the JSON formatting characters of the override structure.  
Type: [TaskOverride](API_TaskOverride.md) object  
Required: No

 ** [placementConstraints](#API_RunTask_RequestSyntax) **   <a name="ECS-RunTask-request-placementConstraints"></a>
An array of placement constraint objects to use for the task. You can specify up to 10 constraints for each task (including constraints in the task definition and those specified at runtime).  
Type: Array of [PlacementConstraint](API_PlacementConstraint.md) objects  
Required: No

 ** [placementStrategy](#API_RunTask_RequestSyntax) **   <a name="ECS-RunTask-request-placementStrategy"></a>
The placement strategy objects to use for the task. You can specify a maximum of 5 strategy rules for each task.  
Type: Array of [PlacementStrategy](API_PlacementStrategy.md) objects  
Required: No

 ** [platformVersion](#API_RunTask_RequestSyntax) **   <a name="ECS-RunTask-request-platformVersion"></a>
The platform version the task uses. A platform version is only specified for tasks hosted on Fargate. If one isn't specified, the `LATEST` platform version is used. For more information, see [Amazon Fargate platform versions](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/platform_versions.html) in the *Amazon Elastic Container Service Developer Guide*.  
Type: String  
Required: No

 ** [propagateTags](#API_RunTask_RequestSyntax) **   <a name="ECS-RunTask-request-propagateTags"></a>
Specifies whether to propagate the tags from the task definition to the task. If no value is specified, the tags aren't propagated. Tags can only be propagated to the task during task creation. To add tags to a task after task creation, use the[TagResource](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_TagResource.html) API action.  
An error will be received if you specify the `SERVICE` option when running a task.
Type: String  
Valid Values: `TASK_DEFINITION | SERVICE | NONE`   
Required: No

 ** [referenceId](#API_RunTask_RequestSyntax) **   <a name="ECS-RunTask-request-referenceId"></a>
This parameter is only used by Amazon ECS. It is not intended for use by customers.  
Type: String  
Required: No

 ** [startedBy](#API_RunTask_RequestSyntax) **   <a name="ECS-RunTask-request-startedBy"></a>
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 `startedBy` parameter. You can then identify which tasks belong to that job by filtering the results of a [ListTasks](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_ListTasks.html) call with the `startedBy` value. Up to 128 letters (uppercase and lowercase), numbers, hyphens (-), forward slash (/), and underscores (\$1) are allowed.  
If a task is started by an Amazon ECS service, then the `startedBy` parameter contains the deployment ID of the service that starts it.  
Type: String  
Required: No

 ** [tags](#API_RunTask_RequestSyntax) **   <a name="ECS-RunTask-request-tags"></a>
The metadata that you apply to the task to help you categorize and organize them. Each tag consists of a key and an optional value, both of which you define.  
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 Amazon 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.
Type: Array of [Tag](API_Tag.md) objects  
Array Members: Minimum number of 0 items. Maximum number of 50 items.  
Required: No

 ** [taskDefinition](#API_RunTask_RequestSyntax) **   <a name="ECS-RunTask-request-taskDefinition"></a>
The `family` and `revision` (`family:revision`) or full ARN of the task definition to run. If a `revision` isn't specified, the latest `ACTIVE` revision is used.  
The full ARN value must match the value that you specified as the `Resource` of the principal's permissions policy.  
When you specify a task definition, you must either specify a specific revision, or all revisions in the ARN.  
To specify a specific revision, include the revision number in the ARN. For example, to specify revision 2, use `arn:aws:ecs:us-east-1:111122223333:task-definition/TaskFamilyName:2`.  
To specify all revisions, use the wildcard (\$1) in the ARN. For example, to specify all revisions, use `arn:aws:ecs:us-east-1:111122223333:task-definition/TaskFamilyName:*`.  
For more information, see [Policy Resources for Amazon ECS](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/security_iam_service-with-iam.html#security_iam_service-with-iam-id-based-policies-resources) in the Amazon Elastic Container Service Developer Guide.  
Type: String  
Required: Yes

 ** [volumeConfigurations](#API_RunTask_RequestSyntax) **   <a name="ECS-RunTask-request-volumeConfigurations"></a>
The details of the volume that was `configuredAtLaunch`. You can configure the size, volumeType, IOPS, throughput, snapshot and encryption in [TaskManagedEBSVolumeConfiguration](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_TaskManagedEBSVolumeConfiguration.html). The `name` of the volume must match the `name` from the task definition.  
Type: Array of [TaskVolumeConfiguration](API_TaskVolumeConfiguration.md) objects  
Required: No

## Response Syntax


```
{
   "failures": [ 
      { 
         "arn": "string",
         "detail": "string",
         "reason": "string"
      }
   ],
   "tasks": [ 
      { 
         "attachments": [ 
            { 
               "details": [ 
                  { 
                     "name": "string",
                     "value": "string"
                  }
               ],
               "id": "string",
               "status": "string",
               "type": "string"
            }
         ],
         "attributes": [ 
            { 
               "name": "string",
               "targetId": "string",
               "targetType": "string",
               "value": "string"
            }
         ],
         "availabilityZone": "string",
         "capacityProviderName": "string",
         "clusterArn": "string",
         "connectivity": "string",
         "connectivityAt": number,
         "containerInstanceArn": "string",
         "containers": [ 
            { 
               "containerArn": "string",
               "cpu": "string",
               "exitCode": number,
               "gpuIds": [ "string" ],
               "healthStatus": "string",
               "image": "string",
               "imageDigest": "string",
               "lastStatus": "string",
               "managedAgents": [ 
                  { 
                     "lastStartedAt": number,
                     "lastStatus": "string",
                     "name": "string",
                     "reason": "string"
                  }
               ],
               "memory": "string",
               "memoryReservation": "string",
               "name": "string",
               "networkBindings": [ 
                  { 
                     "bindIP": "string",
                     "containerPort": number,
                     "containerPortRange": "string",
                     "hostPort": number,
                     "hostPortRange": "string",
                     "protocol": "string"
                  }
               ],
               "networkInterfaces": [ 
                  { 
                     "attachmentId": "string",
                     "ipv6Address": "string",
                     "privateIpv4Address": "string"
                  }
               ],
               "reason": "string",
               "runtimeId": "string",
               "taskArn": "string"
            }
         ],
         "cpu": "string",
         "createdAt": number,
         "desiredStatus": "string",
         "enableExecuteCommand": boolean,
         "ephemeralStorage": { 
            "sizeInGiB": number
         },
         "executionStoppedAt": number,
         "fargateEphemeralStorage": { 
            "kmsKeyId": "string",
            "sizeInGiB": number
         },
         "group": "string",
         "healthStatus": "string",
         "inferenceAccelerators": [ 
            { 
               "deviceName": "string",
               "deviceType": "string"
            }
         ],
         "lastStatus": "string",
         "launchType": "string",
         "memory": "string",
         "overrides": { 
            "containerOverrides": [ 
               { 
                  "command": [ "string" ],
                  "cpu": number,
                  "environment": [ 
                     { 
                        "name": "string",
                        "value": "string"
                     }
                  ],
                  "environmentFiles": [ 
                     { 
                        "type": "string",
                        "value": "string"
                     }
                  ],
                  "memory": number,
                  "memoryReservation": number,
                  "name": "string",
                  "resourceRequirements": [ 
                     { 
                        "type": "string",
                        "value": "string"
                     }
                  ]
               }
            ],
            "cpu": "string",
            "ephemeralStorage": { 
               "sizeInGiB": number
            },
            "executionRoleArn": "string",
            "inferenceAcceleratorOverrides": [ 
               { 
                  "deviceName": "string",
                  "deviceType": "string"
               }
            ],
            "memory": "string",
            "taskRoleArn": "string"
         },
         "platformFamily": "string",
         "platformVersion": "string",
         "pullStartedAt": number,
         "pullStoppedAt": number,
         "startedAt": number,
         "startedBy": "string",
         "stopCode": "string",
         "stoppedAt": number,
         "stoppedReason": "string",
         "stoppingAt": number,
         "tags": [ 
            { 
               "key": "string",
               "value": "string"
            }
         ],
         "taskArn": "string",
         "taskDefinitionArn": "string",
         "version": 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.

 ** [failures](#API_RunTask_ResponseSyntax) **   <a name="ECS-RunTask-response-failures"></a>
Any failures associated with the call.  
For information about how to address failures, see [Service event messages](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/service-event-messages.html#service-event-messages-list) and [API failure reasons](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/api_failures_messages.html) in the *Amazon Elastic Container Service Developer Guide*.  
Type: Array of [Failure](API_Failure.md) objects

 ** [tasks](#API_RunTask_ResponseSyntax) **   <a name="ECS-RunTask-response-tasks"></a>
A full description of the tasks that were run. The tasks that were successfully placed on your cluster are described here.  
Type: Array of [Task](API_Task.md) objects

## Errors


For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** AccessDeniedException **   
You don't have authorization to perform the requested action.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** BlockedException **   
Your Amazon account was blocked. For more information, contact [Amazon Web Services Support](http://www.amazonaws.cn/contact-us/).    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ClientException **   
These errors are usually caused by a client action. This client action might be using an action or resource on behalf of a user that doesn't have permissions to use the action or resource. Or, it might be specifying an identifier that isn't valid.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ClusterNotFoundException **   
The specified cluster wasn't found. You can view your available clusters with [ListClusters](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_ListClusters.html). Amazon ECS clusters are Region specific.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ConflictException **   
The request could not be processed because of conflict in the current state of the resource.     
 ** message **   
 Message that describes the cause of the exception.  
 ** resourceIds **   
The existing task ARNs which are already associated with the `clientToken`.
HTTP Status Code: 400

 ** InvalidParameterException **   
The specified parameter isn't valid. Review the available parameters for the API request.  
For more information about service event errors, see [Amazon ECS service event messages](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/service-event-messages-list.html).     
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** PlatformTaskDefinitionIncompatibilityException **   
The specified platform version doesn't satisfy the required capabilities of the task definition.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** PlatformUnknownException **   
The specified platform version doesn't exist.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ServerException **   
These errors are usually caused by a server issue.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 500

 ** UnsupportedFeatureException **   
The specified task isn't supported in this Region.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

## Examples


In the following example or examples, the Authorization header contents (`AUTHPARAMS`) must be replaced with an Amazon Signature Version 4 signature. For more information, see [Signature Version 4 Signing Process](https://docs.amazonaws.cn/general/latest/gr/signature-version-4.html) in the * Amazon General Reference*.

You only need to learn how to sign HTTP requests if you intend to create them manually. When you use the [Amazon Command Line Interface](http://www.amazonaws.cn/cli/) or one of the [Amazon SDKs](http://www.amazonaws.cn/tools/) to make requests to Amazon, these tools automatically sign the requests for you, with the access key that you specify when you configure the tools. When you use these tools, you don't have to sign requests yourself.

### Example


This example request runs the latest `ACTIVE` revision of the `hello_world` task definition family in the default cluster.

#### Sample Request


```
POST / HTTP/1.1
Host: ecs.us-east-1.amazonaws.com
Accept-Encoding: identity
Content-Length: 45
X-Amz-Target: AmazonEC2ContainerServiceV20141113.RunTask
X-Amz-Date: 20161121T215740Z
User-Agent: aws-cli/1.11.13 Python/2.7.12 Darwin/16.1.0 botocore/1.4.66
Content-Type: application/x-amz-json-1.1
Authorization: AUTHPARAMS

{
  "count": 1,
  "taskDefinition": "hello_world",
  "clientToken": "550e8400-e29b-41d4-a716-446655440000" 
}
```

#### Sample Response


```
HTTP/1.1 200 OK
Server: Server
Date: Mon, 21 Nov 2016 21:57:40 GMT
Content-Type: application/x-amz-json-1.1
Content-Length: 1025
Connection: keep-alive
x-amzn-RequestId: 123a4b56-7c89-01d2-3ef4-example5678f

{
  "failures": [],
  "tasks": [
    {
      "clusterArn": "arn:aws:ecs:us-east-1:012345678910:cluster/default",
      "containerInstanceArn": "arn:aws:ecs:us-east-1:012345678910:container-instance/default/4c543eed-f83f-47da-b1d8-3d23f1da4c64",
      "containers": [
        {
          "containerArn": "arn:aws:ecs:us-east-1:012345678910:container/default/e76594d4-27e1-4c74-98b5-46a6435eb769",
          "lastStatus": "PENDING",
          "name": "wordpress",
          "taskArn": "arn:aws:ecs:us-east-1:012345678910:task/default/fdf2c302-468c-4e55-b884-5331d816e7fb"
        },
        {
          "containerArn": "arn:aws:ecs:us-east-1:012345678910:container/b19106ea-4fa8-4f1d-9767-96922c82b070",
          "lastStatus": "PENDING",
          "name": "mysql",
          "taskArn": "arn:aws:ecs:us-east-1:012345678910:task/default/fdf2c302-468c-4e55-b884-5331d816e7fb"
        }
      ],
      "createdAt": 1479765460.842,
      "desiredStatus": "RUNNING",
      "lastStatus": "PENDING",
      "overrides": {
        "containerOverrides": [
          {
            "name": "wordpress"
          },
          {
            "name": "mysql"
          }
        ]
      },
      "taskArn": "arn:aws:ecs:us-east-1:012345678910:task/default/fdf2c302-468c-4e55-b884-5331d816e7fb",
      "taskDefinitionArn": "arn:aws:ecs:us-east-1:012345678910:task-definition/hello_world:6",
      "version": 1
    }
  ]
}
```

## See Also


For more information about using this API in one of the language-specific Amazon SDKs, see the following:
+  [Amazon Command Line Interface V2](https://docs.amazonaws.cn/goto/cli2/ecs-2014-11-13/RunTask) 
+  [Amazon SDK for .NET V4](https://docs.amazonaws.cn/goto/DotNetSDKV4/ecs-2014-11-13/RunTask) 
+  [Amazon SDK for C\$1\$1](https://docs.amazonaws.cn/goto/SdkForCpp/ecs-2014-11-13/RunTask) 
+  [Amazon SDK for Go v2](https://docs.amazonaws.cn/goto/SdkForGoV2/ecs-2014-11-13/RunTask) 
+  [Amazon SDK for Java V2](https://docs.amazonaws.cn/goto/SdkForJavaV2/ecs-2014-11-13/RunTask) 
+  [Amazon SDK for JavaScript V3](https://docs.amazonaws.cn/goto/SdkForJavaScriptV3/ecs-2014-11-13/RunTask) 
+  [Amazon SDK for Kotlin](https://docs.amazonaws.cn/goto/SdkForKotlin/ecs-2014-11-13/RunTask) 
+  [Amazon SDK for PHP V3](https://docs.amazonaws.cn/goto/SdkForPHPV3/ecs-2014-11-13/RunTask) 
+  [Amazon SDK for Python](https://docs.amazonaws.cn/goto/boto3/ecs-2014-11-13/RunTask) 
+  [Amazon SDK for Ruby V3](https://docs.amazonaws.cn/goto/SdkForRubyV3/ecs-2014-11-13/RunTask) 

# StartTask


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

**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.

**Note**  
Amazon Elastic Inference (EI) is no longer available to customers.

Alternatively, you can use`RunTask` to place tasks for you. For more information, see [Scheduling Tasks](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/scheduling_tasks.html) in the *Amazon Elastic Container Service Developer Guide*.

You can attach Amazon EBS volumes to Amazon ECS tasks by configuring the volume when creating or updating a service. For more information, see [Amazon EBS volumes](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/ebs-volumes.html#ebs-volume-types) in the *Amazon Elastic Container Service Developer Guide*.

## Request Syntax


```
{
   "cluster": "string",
   "containerInstances": [ "string" ],
   "enableECSManagedTags": boolean,
   "enableExecuteCommand": boolean,
   "group": "string",
   "networkConfiguration": { 
      "awsvpcConfiguration": { 
         "assignPublicIp": "string",
         "securityGroups": [ "string" ],
         "subnets": [ "string" ]
      }
   },
   "overrides": { 
      "containerOverrides": [ 
         { 
            "command": [ "string" ],
            "cpu": number,
            "environment": [ 
               { 
                  "name": "string",
                  "value": "string"
               }
            ],
            "environmentFiles": [ 
               { 
                  "type": "string",
                  "value": "string"
               }
            ],
            "memory": number,
            "memoryReservation": number,
            "name": "string",
            "resourceRequirements": [ 
               { 
                  "type": "string",
                  "value": "string"
               }
            ]
         }
      ],
      "cpu": "string",
      "ephemeralStorage": { 
         "sizeInGiB": number
      },
      "executionRoleArn": "string",
      "inferenceAcceleratorOverrides": [ 
         { 
            "deviceName": "string",
            "deviceType": "string"
         }
      ],
      "memory": "string",
      "taskRoleArn": "string"
   },
   "propagateTags": "string",
   "referenceId": "string",
   "startedBy": "string",
   "tags": [ 
      { 
         "key": "string",
         "value": "string"
      }
   ],
   "taskDefinition": "string",
   "volumeConfigurations": [ 
      { 
         "managedEBSVolume": { 
            "encrypted": boolean,
            "filesystemType": "string",
            "iops": number,
            "kmsKeyId": "string",
            "roleArn": "string",
            "sizeInGiB": number,
            "snapshotId": "string",
            "tagSpecifications": [ 
               { 
                  "propagateTags": "string",
                  "resourceType": "string",
                  "tags": [ 
                     { 
                        "key": "string",
                        "value": "string"
                     }
                  ]
               }
            ],
            "terminationPolicy": { 
               "deleteOnTermination": boolean
            },
            "throughput": number,
            "volumeInitializationRate": number,
            "volumeType": "string"
         },
         "name": "string"
      }
   ]
}
```

## Request Parameters


For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [cluster](#API_StartTask_RequestSyntax) **   <a name="ECS-StartTask-request-cluster"></a>
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.  
Type: String  
Required: No

 ** [containerInstances](#API_StartTask_RequestSyntax) **   <a name="ECS-StartTask-request-containerInstances"></a>
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.  
Type: Array of strings  
Required: Yes

 ** [enableECSManagedTags](#API_StartTask_RequestSyntax) **   <a name="ECS-StartTask-request-enableECSManagedTags"></a>
Specifies whether to use Amazon ECS managed tags for the task. For more information, see [Tagging Your Amazon ECS Resources](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/ecs-using-tags.html) in the *Amazon Elastic Container Service Developer Guide*.  
Type: Boolean  
Required: No

 ** [enableExecuteCommand](#API_StartTask_RequestSyntax) **   <a name="ECS-StartTask-request-enableExecuteCommand"></a>
Whether or not the execute command functionality is turned on for the task. If `true`, this turns on the execute command functionality on all containers in the task.  
Type: Boolean  
Required: No

 ** [group](#API_StartTask_RequestSyntax) **   <a name="ECS-StartTask-request-group"></a>
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).  
Type: String  
Required: No

 ** [networkConfiguration](#API_StartTask_RequestSyntax) **   <a name="ECS-StartTask-request-networkConfiguration"></a>
The VPC subnet and security group configuration for tasks that receive their own elastic network interface by using the `awsvpc` networking mode.  
Type: [NetworkConfiguration](API_NetworkConfiguration.md) object  
Required: No

 ** [overrides](#API_StartTask_RequestSyntax) **   <a name="ECS-StartTask-request-overrides"></a>
A list of container overrides in JSON format that specify the name of a container in the specified task definition and the overrides it receives. You can override the default command for a container (that's specified in the task definition or Docker image) with a `command` override. You can also override existing environment variables (that are specified in the task definition or Docker image) on a container or add new environment variables to it with an `environment` override.  
A total of 8192 characters are allowed for overrides. This limit includes the JSON formatting characters of the override structure.
Type: [TaskOverride](API_TaskOverride.md) object  
Required: No

 ** [propagateTags](#API_StartTask_RequestSyntax) **   <a name="ECS-StartTask-request-propagateTags"></a>
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.  
Type: String  
Valid Values: `TASK_DEFINITION | SERVICE | NONE`   
Required: No

 ** [referenceId](#API_StartTask_RequestSyntax) **   <a name="ECS-StartTask-request-referenceId"></a>
This parameter is only used by Amazon ECS. It is not intended for use by customers.  
Type: String  
Required: No

 ** [startedBy](#API_StartTask_RequestSyntax) **   <a name="ECS-StartTask-request-startedBy"></a>
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 `startedBy` parameter. You can then identify which tasks belong to that job by filtering the results of a [ListTasks](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_ListTasks.html) call with the `startedBy` value. Up to 36 letters (uppercase and lowercase), numbers, hyphens (-), forward slash (/), and underscores (\$1) are allowed.  
If a task is started by an Amazon ECS service, the `startedBy` parameter contains the deployment ID of the service that starts it.  
Type: String  
Required: No

 ** [tags](#API_StartTask_RequestSyntax) **   <a name="ECS-StartTask-request-tags"></a>
The metadata that you apply to the task to help you categorize and organize them. Each tag consists of a key and an optional value, both of which you define.  
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 Amazon 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.
Type: Array of [Tag](API_Tag.md) objects  
Array Members: Minimum number of 0 items. Maximum number of 50 items.  
Required: No

 ** [taskDefinition](#API_StartTask_RequestSyntax) **   <a name="ECS-StartTask-request-taskDefinition"></a>
The `family` and `revision` (`family:revision`) or full ARN of the task definition to start. If a `revision` isn't specified, the latest `ACTIVE` revision is used.  
Type: String  
Required: Yes

 ** [volumeConfigurations](#API_StartTask_RequestSyntax) **   <a name="ECS-StartTask-request-volumeConfigurations"></a>
The details of the volume that was `configuredAtLaunch`. You can configure the size, volumeType, IOPS, throughput, snapshot and encryption in [TaskManagedEBSVolumeConfiguration](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_TaskManagedEBSVolumeConfiguration.html). The `name` of the volume must match the `name` from the task definition.  
Type: Array of [TaskVolumeConfiguration](API_TaskVolumeConfiguration.md) objects  
Required: No

## Response Syntax


```
{
   "failures": [ 
      { 
         "arn": "string",
         "detail": "string",
         "reason": "string"
      }
   ],
   "tasks": [ 
      { 
         "attachments": [ 
            { 
               "details": [ 
                  { 
                     "name": "string",
                     "value": "string"
                  }
               ],
               "id": "string",
               "status": "string",
               "type": "string"
            }
         ],
         "attributes": [ 
            { 
               "name": "string",
               "targetId": "string",
               "targetType": "string",
               "value": "string"
            }
         ],
         "availabilityZone": "string",
         "capacityProviderName": "string",
         "clusterArn": "string",
         "connectivity": "string",
         "connectivityAt": number,
         "containerInstanceArn": "string",
         "containers": [ 
            { 
               "containerArn": "string",
               "cpu": "string",
               "exitCode": number,
               "gpuIds": [ "string" ],
               "healthStatus": "string",
               "image": "string",
               "imageDigest": "string",
               "lastStatus": "string",
               "managedAgents": [ 
                  { 
                     "lastStartedAt": number,
                     "lastStatus": "string",
                     "name": "string",
                     "reason": "string"
                  }
               ],
               "memory": "string",
               "memoryReservation": "string",
               "name": "string",
               "networkBindings": [ 
                  { 
                     "bindIP": "string",
                     "containerPort": number,
                     "containerPortRange": "string",
                     "hostPort": number,
                     "hostPortRange": "string",
                     "protocol": "string"
                  }
               ],
               "networkInterfaces": [ 
                  { 
                     "attachmentId": "string",
                     "ipv6Address": "string",
                     "privateIpv4Address": "string"
                  }
               ],
               "reason": "string",
               "runtimeId": "string",
               "taskArn": "string"
            }
         ],
         "cpu": "string",
         "createdAt": number,
         "desiredStatus": "string",
         "enableExecuteCommand": boolean,
         "ephemeralStorage": { 
            "sizeInGiB": number
         },
         "executionStoppedAt": number,
         "fargateEphemeralStorage": { 
            "kmsKeyId": "string",
            "sizeInGiB": number
         },
         "group": "string",
         "healthStatus": "string",
         "inferenceAccelerators": [ 
            { 
               "deviceName": "string",
               "deviceType": "string"
            }
         ],
         "lastStatus": "string",
         "launchType": "string",
         "memory": "string",
         "overrides": { 
            "containerOverrides": [ 
               { 
                  "command": [ "string" ],
                  "cpu": number,
                  "environment": [ 
                     { 
                        "name": "string",
                        "value": "string"
                     }
                  ],
                  "environmentFiles": [ 
                     { 
                        "type": "string",
                        "value": "string"
                     }
                  ],
                  "memory": number,
                  "memoryReservation": number,
                  "name": "string",
                  "resourceRequirements": [ 
                     { 
                        "type": "string",
                        "value": "string"
                     }
                  ]
               }
            ],
            "cpu": "string",
            "ephemeralStorage": { 
               "sizeInGiB": number
            },
            "executionRoleArn": "string",
            "inferenceAcceleratorOverrides": [ 
               { 
                  "deviceName": "string",
                  "deviceType": "string"
               }
            ],
            "memory": "string",
            "taskRoleArn": "string"
         },
         "platformFamily": "string",
         "platformVersion": "string",
         "pullStartedAt": number,
         "pullStoppedAt": number,
         "startedAt": number,
         "startedBy": "string",
         "stopCode": "string",
         "stoppedAt": number,
         "stoppedReason": "string",
         "stoppingAt": number,
         "tags": [ 
            { 
               "key": "string",
               "value": "string"
            }
         ],
         "taskArn": "string",
         "taskDefinitionArn": "string",
         "version": 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.

 ** [failures](#API_StartTask_ResponseSyntax) **   <a name="ECS-StartTask-response-failures"></a>
Any failures associated with the call.  
Type: Array of [Failure](API_Failure.md) objects

 ** [tasks](#API_StartTask_ResponseSyntax) **   <a name="ECS-StartTask-response-tasks"></a>
A full description of the tasks that were started. Each task that was successfully placed on your container instances is described.  
Type: Array of [Task](API_Task.md) objects

## Errors


For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** ClientException **   
These errors are usually caused by a client action. This client action might be using an action or resource on behalf of a user that doesn't have permissions to use the action or resource. Or, it might be specifying an identifier that isn't valid.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ClusterNotFoundException **   
The specified cluster wasn't found. You can view your available clusters with [ListClusters](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_ListClusters.html). Amazon ECS clusters are Region specific.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** InvalidParameterException **   
The specified parameter isn't valid. Review the available parameters for the API request.  
For more information about service event errors, see [Amazon ECS service event messages](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/service-event-messages-list.html).     
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ServerException **   
These errors are usually caused by a server issue.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 500

 ** UnsupportedFeatureException **   
The specified task isn't supported in this Region.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

## Examples


In the following example or examples, the Authorization header contents (`AUTHPARAMS`) must be replaced with an Amazon Signature Version 4 signature. For more information, see [Signature Version 4 Signing Process](https://docs.amazonaws.cn/general/latest/gr/signature-version-4.html) in the * Amazon General Reference*.

You only need to learn how to sign HTTP requests if you intend to create them manually. When you use the [Amazon Command Line Interface](http://www.amazonaws.cn/cli/) or one of the [Amazon SDKs](http://www.amazonaws.cn/tools/) to make requests to Amazon, these tools automatically sign the requests for you, with the access key that you specify when you configure the tools. When you use these tools, you don't have to sign requests yourself.

### Example


This example request starts the latest `ACTIVE` revision of the `hello_world` task definition family in the default cluster on the container instance with the ID `4c543eed-f83f-47da-b1d8-3d23f1da4c64`.

#### Sample Request


```
POST / HTTP/1.1
Host: ecs.us-east-1.amazonaws.com
Accept-Encoding: identity
Content-Length: 97
X-Amz-Target: AmazonEC2ContainerServiceV20141113.StartTask
X-Amz-Date: 20161121T220032Z
User-Agent: aws-cli/1.11.13 Python/2.7.12 Darwin/16.1.0 botocore/1.4.66
Content-Type: application/x-amz-json-1.1
Authorization: AUTHPARAMS

{
  "containerInstances": [
    "4c543eed-f83f-47da-b1d8-3d23f1da4c64"
  ],
  "taskDefinition": "hello_world"
}
```

#### Sample Response


```
HTTP/1.1 200 OK
Server: Server
Date: Mon, 21 Nov 2016 22:00:32 GMT
Content-Type: application/x-amz-json-1.1
Content-Length: 1025
Connection: keep-alive
x-amzn-RequestId: 123a4b56-7c89-01d2-3ef4-example5678f

{
  "failures": [],
  "tasks": [
    {
      "clusterArn": "arn:aws:ecs:us-east-1:012345678910:cluster/default",
      "containerInstanceArn": "arn:aws:ecs:us-east-1:012345678910:container-instance/default/4c543eed-f83f-47da-b1d8-3d23f1da4c64",
      "containers": [
        {
          "containerArn": "arn:aws:ecs:us-east-1:012345678910:container/e76594d4-27e1-4c74-98b5-46a6435eb769",
          "lastStatus": "PENDING",
          "name": "wordpress",
          "taskArn": "arn:aws:ecs:us-east-1:012345678910:task/default/fdf2c302-468c-4e55-b884-5331d816e7fb"
        },
        {
          "containerArn": "arn:aws:ecs:us-east-1:012345678910:container/default/b19106ea-4fa8-4f1d-9767-96922c82b070",
          "lastStatus": "PENDING",
          "name": "mysql",
          "taskArn": "arn:aws:ecs:us-east-1:012345678910:task/default/fdf2c302-468c-4e55-b884-5331d816e7fb"
        }
      ],
      "createdAt": 1479765460.842,
      "desiredStatus": "RUNNING",
      "lastStatus": "PENDING",
      "overrides": {
        "containerOverrides": [
          {
            "name": "wordpress"
          },
          {
            "name": "mysql"
          }
        ]
      },
      "taskArn": "arn:aws:ecs:us-east-1:012345678910:task/default/fdf2c302-468c-4e55-b884-5331d816e7fb",
      "taskDefinitionArn": "arn:aws:ecs:us-east-1:012345678910:task-definition/hello_world:6",
      "version": 1
    }
  ]
}
```

## See Also


For more information about using this API in one of the language-specific Amazon SDKs, see the following:
+  [Amazon Command Line Interface V2](https://docs.amazonaws.cn/goto/cli2/ecs-2014-11-13/StartTask) 
+  [Amazon SDK for .NET V4](https://docs.amazonaws.cn/goto/DotNetSDKV4/ecs-2014-11-13/StartTask) 
+  [Amazon SDK for C\$1\$1](https://docs.amazonaws.cn/goto/SdkForCpp/ecs-2014-11-13/StartTask) 
+  [Amazon SDK for Go v2](https://docs.amazonaws.cn/goto/SdkForGoV2/ecs-2014-11-13/StartTask) 
+  [Amazon SDK for Java V2](https://docs.amazonaws.cn/goto/SdkForJavaV2/ecs-2014-11-13/StartTask) 
+  [Amazon SDK for JavaScript V3](https://docs.amazonaws.cn/goto/SdkForJavaScriptV3/ecs-2014-11-13/StartTask) 
+  [Amazon SDK for Kotlin](https://docs.amazonaws.cn/goto/SdkForKotlin/ecs-2014-11-13/StartTask) 
+  [Amazon SDK for PHP V3](https://docs.amazonaws.cn/goto/SdkForPHPV3/ecs-2014-11-13/StartTask) 
+  [Amazon SDK for Python](https://docs.amazonaws.cn/goto/boto3/ecs-2014-11-13/StartTask) 
+  [Amazon SDK for Ruby V3](https://docs.amazonaws.cn/goto/SdkForRubyV3/ecs-2014-11-13/StartTask) 

# StopServiceDeployment


Stops an ongoing service deployment.

The following stop types are avaiable:
+ ROLLBACK - This option rolls back the service deployment to the previous service revision. 

  You can use this option even if you didn't configure the service deployment for the rollback option. 

For more information, see [Stopping Amazon ECS service deployments](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/stop-service-deployment.html) in the *Amazon Elastic Container Service Developer Guide*.

## Request Syntax


```
{
   "serviceDeploymentArn": "string",
   "stopType": "string"
}
```

## Request Parameters


For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [serviceDeploymentArn](#API_StopServiceDeployment_RequestSyntax) **   <a name="ECS-StopServiceDeployment-request-serviceDeploymentArn"></a>
The ARN of the service deployment that you want to stop.  
Type: String  
Required: Yes

 ** [stopType](#API_StopServiceDeployment_RequestSyntax) **   <a name="ECS-StopServiceDeployment-request-stopType"></a>
How you want Amazon ECS to stop the service.   
The valid values are `ROLLBACK`.  
Type: String  
Valid Values: `ABORT | ROLLBACK`   
Required: No

## Response Syntax


```
{
   "serviceDeploymentArn": "string"
}
```

## 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.

 ** [serviceDeploymentArn](#API_StopServiceDeployment_ResponseSyntax) **   <a name="ECS-StopServiceDeployment-response-serviceDeploymentArn"></a>
The ARN of the stopped service deployment.  
Type: String

## Errors


For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** AccessDeniedException **   
You don't have authorization to perform the requested action.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ClientException **   
These errors are usually caused by a client action. This client action might be using an action or resource on behalf of a user that doesn't have permissions to use the action or resource. Or, it might be specifying an identifier that isn't valid.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ConflictException **   
The request could not be processed because of conflict in the current state of the resource.     
 ** message **   
 Message that describes the cause of the exception.  
 ** resourceIds **   
The existing task ARNs which are already associated with the `clientToken`.
HTTP Status Code: 400

 ** InvalidParameterException **   
The specified parameter isn't valid. Review the available parameters for the API request.  
For more information about service event errors, see [Amazon ECS service event messages](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/service-event-messages-list.html).     
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ServerException **   
These errors are usually caused by a server issue.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 500

 ** ServiceDeploymentNotFoundException **   
The service deploy ARN that you specified in the `StopServiceDeployment` doesn't exist. You can use `ListServiceDeployments` to retrieve the service deployment ARNs.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** UnsupportedFeatureException **   
The specified task isn't supported in this Region.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

## Examples


### Example


This example request stops the service deployment with the ARN of `arn:aws:ecs:us-east-1:123456789012:service-deployment/MyCluster/MyService/r9i43YFjvgF_xlg7m2eJ1`using the `ROLLBACK` stop type. 

#### Sample Request


```
POST / HTTP/1.1
Host: ecs.us-west-2.amazonaws.com
Accept-Encoding: identity
Content-Length: 55
X-Amz-Target: AmazonEC2ContainerServiceV20141113.StopServiceDeployment
X-Amz-Date: 20250407T133521Z
User-Agent: aws-cli/2.26 Python/3.12.6 Darwin/14.3.0
Content-Type: application/x-amz-json-1.1
Authorization: AUTHPARAMS

{

  "serviceDeploymentArn": "arn:aws:ecs:us-east-1:123456789012:service-deployment/MyCluster/MyService/r9i43YFjvgF_xlg7m2eJ1",
  "stopType": "ROLLBACK"
}
```

#### Sample Response


```
HTTP/1.1 200 OK
Server: Server
Date: Mon Apr 7, 2025 18:50:14 GMT
Content-Type: application/x-amz-json-1.1
Content-Length: 220
Connection: keep-alive
RequestId: 360c5551-123e-4e74-9914-7582d3a28807
{
     "serviceDeploymentArn": "arn:aws:ecs:us-east-1:123456789012:service-deployment/MyCluster/MyService/r9i43YFjvgF_xlg7m2eJ1",
}
}
```

## See Also


For more information about using this API in one of the language-specific Amazon SDKs, see the following:
+  [Amazon Command Line Interface V2](https://docs.amazonaws.cn/goto/cli2/ecs-2014-11-13/StopServiceDeployment) 
+  [Amazon SDK for .NET V4](https://docs.amazonaws.cn/goto/DotNetSDKV4/ecs-2014-11-13/StopServiceDeployment) 
+  [Amazon SDK for C\$1\$1](https://docs.amazonaws.cn/goto/SdkForCpp/ecs-2014-11-13/StopServiceDeployment) 
+  [Amazon SDK for Go v2](https://docs.amazonaws.cn/goto/SdkForGoV2/ecs-2014-11-13/StopServiceDeployment) 
+  [Amazon SDK for Java V2](https://docs.amazonaws.cn/goto/SdkForJavaV2/ecs-2014-11-13/StopServiceDeployment) 
+  [Amazon SDK for JavaScript V3](https://docs.amazonaws.cn/goto/SdkForJavaScriptV3/ecs-2014-11-13/StopServiceDeployment) 
+  [Amazon SDK for Kotlin](https://docs.amazonaws.cn/goto/SdkForKotlin/ecs-2014-11-13/StopServiceDeployment) 
+  [Amazon SDK for PHP V3](https://docs.amazonaws.cn/goto/SdkForPHPV3/ecs-2014-11-13/StopServiceDeployment) 
+  [Amazon SDK for Python](https://docs.amazonaws.cn/goto/boto3/ecs-2014-11-13/StopServiceDeployment) 
+  [Amazon SDK for Ruby V3](https://docs.amazonaws.cn/goto/SdkForRubyV3/ecs-2014-11-13/StopServiceDeployment) 

# StopTask


Stops a running task. Any tags associated with the task will be deleted.

When you call `StopTask` on a task, the equivalent of `docker stop` is issued to the containers running in the task. This results in a stop signal value and a default 30-second timeout, after which the `SIGKILL` value is sent and the containers are forcibly stopped. This signal can be defined in your container image with the `STOPSIGNAL` instruction and will default to `SIGTERM`. If the container handles the `SIGTERM` value gracefully and exits within 30 seconds from receiving it, no `SIGKILL` value is sent.

For Windows containers, POSIX signals do not work and runtime stops the container by sending a `CTRL_SHUTDOWN_EVENT`. For more information, see [Unable to react to graceful shutdown of (Windows) container \$125982](https://github.com/moby/moby/issues/25982) on GitHub.

**Note**  
The default 30-second timeout can be configured on the Amazon ECS container agent with the `ECS_CONTAINER_STOP_TIMEOUT` variable. For more information, see [Amazon ECS Container Agent Configuration](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/ecs-agent-config.html) in the *Amazon Elastic Container Service Developer Guide*.

## Request Syntax


```
{
   "cluster": "string",
   "reason": "string",
   "task": "string"
}
```

## Request Parameters


For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [cluster](#API_StopTask_RequestSyntax) **   <a name="ECS-StopTask-request-cluster"></a>
The short name or full Amazon Resource Name (ARN) of the cluster that hosts the task to stop. If you do not specify a cluster, the default cluster is assumed.  
Type: String  
Required: No

 ** [reason](#API_StopTask_RequestSyntax) **   <a name="ECS-StopTask-request-reason"></a>
An optional message specified when a task is stopped. For example, if you're using a custom scheduler, you can use this parameter to specify the reason for stopping the task here, and the message appears in subsequent [DescribeTasks](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_DescribeTasks.html)> API operations on this task.  
Type: String  
Required: No

 ** [task](#API_StopTask_RequestSyntax) **   <a name="ECS-StopTask-request-task"></a>
Thefull Amazon Resource Name (ARN) of the task.  
Type: String  
Required: Yes

## Response Syntax


```
{
   "task": { 
      "attachments": [ 
         { 
            "details": [ 
               { 
                  "name": "string",
                  "value": "string"
               }
            ],
            "id": "string",
            "status": "string",
            "type": "string"
         }
      ],
      "attributes": [ 
         { 
            "name": "string",
            "targetId": "string",
            "targetType": "string",
            "value": "string"
         }
      ],
      "availabilityZone": "string",
      "capacityProviderName": "string",
      "clusterArn": "string",
      "connectivity": "string",
      "connectivityAt": number,
      "containerInstanceArn": "string",
      "containers": [ 
         { 
            "containerArn": "string",
            "cpu": "string",
            "exitCode": number,
            "gpuIds": [ "string" ],
            "healthStatus": "string",
            "image": "string",
            "imageDigest": "string",
            "lastStatus": "string",
            "managedAgents": [ 
               { 
                  "lastStartedAt": number,
                  "lastStatus": "string",
                  "name": "string",
                  "reason": "string"
               }
            ],
            "memory": "string",
            "memoryReservation": "string",
            "name": "string",
            "networkBindings": [ 
               { 
                  "bindIP": "string",
                  "containerPort": number,
                  "containerPortRange": "string",
                  "hostPort": number,
                  "hostPortRange": "string",
                  "protocol": "string"
               }
            ],
            "networkInterfaces": [ 
               { 
                  "attachmentId": "string",
                  "ipv6Address": "string",
                  "privateIpv4Address": "string"
               }
            ],
            "reason": "string",
            "runtimeId": "string",
            "taskArn": "string"
         }
      ],
      "cpu": "string",
      "createdAt": number,
      "desiredStatus": "string",
      "enableExecuteCommand": boolean,
      "ephemeralStorage": { 
         "sizeInGiB": number
      },
      "executionStoppedAt": number,
      "fargateEphemeralStorage": { 
         "kmsKeyId": "string",
         "sizeInGiB": number
      },
      "group": "string",
      "healthStatus": "string",
      "inferenceAccelerators": [ 
         { 
            "deviceName": "string",
            "deviceType": "string"
         }
      ],
      "lastStatus": "string",
      "launchType": "string",
      "memory": "string",
      "overrides": { 
         "containerOverrides": [ 
            { 
               "command": [ "string" ],
               "cpu": number,
               "environment": [ 
                  { 
                     "name": "string",
                     "value": "string"
                  }
               ],
               "environmentFiles": [ 
                  { 
                     "type": "string",
                     "value": "string"
                  }
               ],
               "memory": number,
               "memoryReservation": number,
               "name": "string",
               "resourceRequirements": [ 
                  { 
                     "type": "string",
                     "value": "string"
                  }
               ]
            }
         ],
         "cpu": "string",
         "ephemeralStorage": { 
            "sizeInGiB": number
         },
         "executionRoleArn": "string",
         "inferenceAcceleratorOverrides": [ 
            { 
               "deviceName": "string",
               "deviceType": "string"
            }
         ],
         "memory": "string",
         "taskRoleArn": "string"
      },
      "platformFamily": "string",
      "platformVersion": "string",
      "pullStartedAt": number,
      "pullStoppedAt": number,
      "startedAt": number,
      "startedBy": "string",
      "stopCode": "string",
      "stoppedAt": number,
      "stoppedReason": "string",
      "stoppingAt": number,
      "tags": [ 
         { 
            "key": "string",
            "value": "string"
         }
      ],
      "taskArn": "string",
      "taskDefinitionArn": "string",
      "version": 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.

 ** [task](#API_StopTask_ResponseSyntax) **   <a name="ECS-StopTask-response-task"></a>
The task that was stopped.  
Type: [Task](API_Task.md) object

## Errors


For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** ClientException **   
These errors are usually caused by a client action. This client action might be using an action or resource on behalf of a user that doesn't have permissions to use the action or resource. Or, it might be specifying an identifier that isn't valid.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ClusterNotFoundException **   
The specified cluster wasn't found. You can view your available clusters with [ListClusters](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_ListClusters.html). Amazon ECS clusters are Region specific.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** InvalidParameterException **   
The specified parameter isn't valid. Review the available parameters for the API request.  
For more information about service event errors, see [Amazon ECS service event messages](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/service-event-messages-list.html).     
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ServerException **   
These errors are usually caused by a server issue.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 500

## Examples


In the following example or examples, the Authorization header contents (`AUTHPARAMS`) must be replaced with an Amazon Signature Version 4 signature. For more information, see [Signature Version 4 Signing Process](https://docs.amazonaws.cn/general/latest/gr/signature-version-4.html) in the * Amazon General Reference*.

You only need to learn how to sign HTTP requests if you intend to create them manually. When you use the [Amazon Command Line Interface](http://www.amazonaws.cn/cli/) or one of the [Amazon SDKs](http://www.amazonaws.cn/tools/) to make requests to Amazon, these tools automatically sign the requests for you, with the access key that you specify when you configure the tools. When you use these tools, you don't have to sign requests yourself.

### Example


This example request stops a task with the ID `1dc5c17a-422b-4dc4-b493-371970c6c4d6` in the default cluster.

#### Sample Request


```
POST / HTTP/1.1
Host: ecs.us-east-1.amazonaws.com
Accept-Encoding: identity
Content-Length: 88
X-Amz-Target: AmazonEC2ContainerServiceV20141113.StopTask
X-Amz-Date: 20250203T220318Z
User-Agent: aws-cli/2.2.26 Python/3.12.6 Darwin/16.1.0 botocore/1.4.66
Content-Type: application/x-amz-json-1.1
Authorization: AUTHPARAMS

{
  "task": "arn:aws:ecs:us-east-1:123456789012:task/MyCluster/36ad4ef947bb470b89010d864574237e"
}
```

#### Sample Response


```
HTTP/1.1 200 OK
Server: Server
Date: Mon, 03 Feb 2025 22:03:18 GMT
Content-Type: application/x-amz-json-1.1
Content-Length: 1260
Connection: keep-alive
x-amzn-RequestId: 123a4b56-7c89-01d2-3ef4-example5678f

{
    "task": {
        "attachments": [
            {
                "id": "9711cfc0-8c7d-470b-93e4-9d2041731db6",
                "type": "ElasticNetworkInterface",
                "status": "ATTACHED",
                "details": [
                    {
                        "name": "subnetId",
                        "value": "subnet-0d0eab1bb38d5ca64"
                    },
                    {
                        "name": "networkInterfaceId",
                        "value": "eni-0f6b537b3ec7ba800"
                    },
                    {
                        "name": "macAddress",
                        "value": "0e:fd:16:ec:9a:01"
                    },
                    {
                        "name": "privateDnsName",
                        "value": "ip-10-0-1-114.ec2.internal"
                    },
                    {
                        "name": "privateIPv4Address",
                        "value": "10.0.1.114"
                    }
                ]
            }
        ],
        "attributes": [
            {
                "name": "ecs.cpu-architecture",
                "value": "x86_64"
            }
        ],
        "availabilityZone": "us-east-1b",
        "capacityProviderName": "FARGATE",
        "clusterArn": "arn:aws:ecs:us-east-1:123456789012:cluster/MyCluster",
        "connectivity": "CONNECTED",
        "connectivityAt": "2025-02-03T15:26:37.435000-05:00",
        "containers": [
            {
                "containerArn": "arn:aws:ecs:us-east-1:123456789012:container/MyCluster/36ad4ef947bb470b89010d864574237e/0a7d1107-a0c8-45c4-ac05-f0aaab4c63db",
                "taskArn": "arn:aws:ecs:us-east-1:123456789012:task/MyCluster/36ad4ef947bb470b89010d864574237e",
                "name": "web",
                "image": "nginx",
                "imageDigest": "sha256:0a399eb16751829e1af26fea27b20c3ec28d7ab1fb72182879dcae1cca21206a",
                "runtimeId": "36ad4ef947bb470b89010d864574237e-0265927825",
                "lastStatus": "RUNNING",
                "networkBindings": [],
                "networkInterfaces": [
                    {
                        "attachmentId": "9711cfc0-8c7d-470b-93e4-9d2041731db6",
                        "privateIpv4Address": "10.0.1.114"
                    }
                ],
                "cpu": "99",
                "memory": "100"
            },
            {
                "containerArn": "arn:aws:ecs:us-east-1:123456789012:container/MyCluster/36ad4ef947bb470b89010d864574237e/48dfdefe-b605-4747-b071-5f6bc8650b2d",
                "taskArn": "arn:aws:ecs:us-east-1:123456789012:task/MyCluster/36ad4ef947bb470b89010d864574237e",
                "name": "aws-otel-collector",
                "image": "public.ecr.aws/aws-observability/aws-otel-collector:v0.32.0",
                "imageDigest": "sha256:7a1b3560655071bcacd66902c20ebe9a69470d5691fe3bd36baace7c2f3c4640",
                "runtimeId": "36ad4ef947bb470b89010d864574237e-4027662657",
                "lastStatus": "RUNNING",
                "networkBindings": [],
                "networkInterfaces": [
                    {
                        "attachmentId": "9711cfc0-8c7d-470b-93e4-9d2041731db6",
                        "privateIpv4Address": "10.0.1.114"
                    }
                ],
                "cpu": "0"
            }
        ],
        "cpu": "256",
        "createdAt": "2025-02-03T15:26:33.277000-05:00",
        "desiredStatus": "STOPPED",
        "enableExecuteCommand": false,
        "group": "family:webserver",
        "lastStatus": "RUNNING",
        "launchType": "FARGATE",
        "memory": "512",
        "overrides": {
            "containerOverrides": [
                {
                    "name": "aws-otel-collector"
                },
                {
                    "name": "web"
                }
            ],
            "inferenceAcceleratorOverrides": []
        },
        "platformVersion": "1.4.0",
        "platformFamily": "Linux",
        "pullStartedAt": "2025-02-03T15:26:44.970000-05:00",
        "pullStoppedAt": "2025-02-03T15:26:51.926000-05:00",
        "startedAt": "2025-02-03T15:26:53.096000-05:00",
        "stopCode": "UserInitiated",
        "stoppedReason": "Task stopped by user",
        "stoppingAt": "2025-02-03T15:27:51.392000-05:00",
        "tags": [],
        "taskArn": "arn:aws:ecs:us-east-1:123456789012:task/MyCluster/36ad4ef947bb470b89010d864574237e",
        "taskDefinitionArn": "arn:aws:ecs:us-east-1:123456789012:task-definition/webserver:5",
        "version": 4,
        "ephemeralStorage": {
            "sizeInGiB": 20
        },
        "fargateEphemeralStorage": {
            "sizeInGiB": 20
        }
    }
}
```

## See Also


For more information about using this API in one of the language-specific Amazon SDKs, see the following:
+  [Amazon Command Line Interface V2](https://docs.amazonaws.cn/goto/cli2/ecs-2014-11-13/StopTask) 
+  [Amazon SDK for .NET V4](https://docs.amazonaws.cn/goto/DotNetSDKV4/ecs-2014-11-13/StopTask) 
+  [Amazon SDK for C\$1\$1](https://docs.amazonaws.cn/goto/SdkForCpp/ecs-2014-11-13/StopTask) 
+  [Amazon SDK for Go v2](https://docs.amazonaws.cn/goto/SdkForGoV2/ecs-2014-11-13/StopTask) 
+  [Amazon SDK for Java V2](https://docs.amazonaws.cn/goto/SdkForJavaV2/ecs-2014-11-13/StopTask) 
+  [Amazon SDK for JavaScript V3](https://docs.amazonaws.cn/goto/SdkForJavaScriptV3/ecs-2014-11-13/StopTask) 
+  [Amazon SDK for Kotlin](https://docs.amazonaws.cn/goto/SdkForKotlin/ecs-2014-11-13/StopTask) 
+  [Amazon SDK for PHP V3](https://docs.amazonaws.cn/goto/SdkForPHPV3/ecs-2014-11-13/StopTask) 
+  [Amazon SDK for Python](https://docs.amazonaws.cn/goto/boto3/ecs-2014-11-13/StopTask) 
+  [Amazon SDK for Ruby V3](https://docs.amazonaws.cn/goto/SdkForRubyV3/ecs-2014-11-13/StopTask) 

# SubmitAttachmentStateChanges


**Note**  
This action is only used by the Amazon ECS agent, and it is not intended for use outside of the agent.

Sent to acknowledge that an attachment changed states.

## Request Syntax


```
{
   "attachments": [ 
      { 
         "attachmentArn": "string",
         "status": "string"
      }
   ],
   "cluster": "string"
}
```

## Request Parameters


For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [attachments](#API_SubmitAttachmentStateChanges_RequestSyntax) **   <a name="ECS-SubmitAttachmentStateChanges-request-attachments"></a>
Any attachments associated with the state change request.  
Type: Array of [AttachmentStateChange](API_AttachmentStateChange.md) objects  
Required: Yes

 ** [cluster](#API_SubmitAttachmentStateChanges_RequestSyntax) **   <a name="ECS-SubmitAttachmentStateChanges-request-cluster"></a>
The short name or full ARN of the cluster that hosts the container instance the attachment belongs to.  
Type: String  
Required: No

## Response Syntax


```
{
   "acknowledgment": "string"
}
```

## 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.

 ** [acknowledgment](#API_SubmitAttachmentStateChanges_ResponseSyntax) **   <a name="ECS-SubmitAttachmentStateChanges-response-acknowledgment"></a>
Acknowledgement of the state change.  
Type: String

## Errors


For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** AccessDeniedException **   
You don't have authorization to perform the requested action.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ClientException **   
These errors are usually caused by a client action. This client action might be using an action or resource on behalf of a user that doesn't have permissions to use the action or resource. Or, it might be specifying an identifier that isn't valid.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** InvalidParameterException **   
The specified parameter isn't valid. Review the available parameters for the API request.  
For more information about service event errors, see [Amazon ECS service event messages](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/service-event-messages-list.html).     
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ServerException **   
These errors are usually caused by a server issue.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 500

## See Also


For more information about using this API in one of the language-specific Amazon SDKs, see the following:
+  [Amazon Command Line Interface V2](https://docs.amazonaws.cn/goto/cli2/ecs-2014-11-13/SubmitAttachmentStateChanges) 
+  [Amazon SDK for .NET V4](https://docs.amazonaws.cn/goto/DotNetSDKV4/ecs-2014-11-13/SubmitAttachmentStateChanges) 
+  [Amazon SDK for C\$1\$1](https://docs.amazonaws.cn/goto/SdkForCpp/ecs-2014-11-13/SubmitAttachmentStateChanges) 
+  [Amazon SDK for Go v2](https://docs.amazonaws.cn/goto/SdkForGoV2/ecs-2014-11-13/SubmitAttachmentStateChanges) 
+  [Amazon SDK for Java V2](https://docs.amazonaws.cn/goto/SdkForJavaV2/ecs-2014-11-13/SubmitAttachmentStateChanges) 
+  [Amazon SDK for JavaScript V3](https://docs.amazonaws.cn/goto/SdkForJavaScriptV3/ecs-2014-11-13/SubmitAttachmentStateChanges) 
+  [Amazon SDK for Kotlin](https://docs.amazonaws.cn/goto/SdkForKotlin/ecs-2014-11-13/SubmitAttachmentStateChanges) 
+  [Amazon SDK for PHP V3](https://docs.amazonaws.cn/goto/SdkForPHPV3/ecs-2014-11-13/SubmitAttachmentStateChanges) 
+  [Amazon SDK for Python](https://docs.amazonaws.cn/goto/boto3/ecs-2014-11-13/SubmitAttachmentStateChanges) 
+  [Amazon SDK for Ruby V3](https://docs.amazonaws.cn/goto/SdkForRubyV3/ecs-2014-11-13/SubmitAttachmentStateChanges) 

# SubmitContainerStateChange


**Note**  
This action is only used by the Amazon ECS agent, and it is not intended for use outside of the agent.

Sent to acknowledge that a container changed states.

## Request Syntax


```
{
   "cluster": "string",
   "containerName": "string",
   "exitCode": number,
   "networkBindings": [ 
      { 
         "bindIP": "string",
         "containerPort": number,
         "containerPortRange": "string",
         "hostPort": number,
         "hostPortRange": "string",
         "protocol": "string"
      }
   ],
   "reason": "string",
   "runtimeId": "string",
   "status": "string",
   "task": "string"
}
```

## Request Parameters


For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [cluster](#API_SubmitContainerStateChange_RequestSyntax) **   <a name="ECS-SubmitContainerStateChange-request-cluster"></a>
The short name or full ARN of the cluster that hosts the container.  
Type: String  
Required: No

 ** [containerName](#API_SubmitContainerStateChange_RequestSyntax) **   <a name="ECS-SubmitContainerStateChange-request-containerName"></a>
The name of the container.  
Type: String  
Required: No

 ** [exitCode](#API_SubmitContainerStateChange_RequestSyntax) **   <a name="ECS-SubmitContainerStateChange-request-exitCode"></a>
The exit code that's returned for the state change request.  
Type: Integer  
Required: No

 ** [networkBindings](#API_SubmitContainerStateChange_RequestSyntax) **   <a name="ECS-SubmitContainerStateChange-request-networkBindings"></a>
The network bindings of the container.  
Type: Array of [NetworkBinding](API_NetworkBinding.md) objects  
Required: No

 ** [reason](#API_SubmitContainerStateChange_RequestSyntax) **   <a name="ECS-SubmitContainerStateChange-request-reason"></a>
The reason for the state change request.  
Type: String  
Required: No

 ** [runtimeId](#API_SubmitContainerStateChange_RequestSyntax) **   <a name="ECS-SubmitContainerStateChange-request-runtimeId"></a>
The ID of the Docker container.  
Type: String  
Required: No

 ** [status](#API_SubmitContainerStateChange_RequestSyntax) **   <a name="ECS-SubmitContainerStateChange-request-status"></a>
The status of the state change request.  
Type: String  
Required: No

 ** [task](#API_SubmitContainerStateChange_RequestSyntax) **   <a name="ECS-SubmitContainerStateChange-request-task"></a>
The task ID or full Amazon Resource Name (ARN) of the task that hosts the container.  
Type: String  
Required: No

## Response Syntax


```
{
   "acknowledgment": "string"
}
```

## 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.

 ** [acknowledgment](#API_SubmitContainerStateChange_ResponseSyntax) **   <a name="ECS-SubmitContainerStateChange-response-acknowledgment"></a>
Acknowledgement of the state change.  
Type: String

## Errors


For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** AccessDeniedException **   
You don't have authorization to perform the requested action.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ClientException **   
These errors are usually caused by a client action. This client action might be using an action or resource on behalf of a user that doesn't have permissions to use the action or resource. Or, it might be specifying an identifier that isn't valid.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ServerException **   
These errors are usually caused by a server issue.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 500

## See Also


For more information about using this API in one of the language-specific Amazon SDKs, see the following:
+  [Amazon Command Line Interface V2](https://docs.amazonaws.cn/goto/cli2/ecs-2014-11-13/SubmitContainerStateChange) 
+  [Amazon SDK for .NET V4](https://docs.amazonaws.cn/goto/DotNetSDKV4/ecs-2014-11-13/SubmitContainerStateChange) 
+  [Amazon SDK for C\$1\$1](https://docs.amazonaws.cn/goto/SdkForCpp/ecs-2014-11-13/SubmitContainerStateChange) 
+  [Amazon SDK for Go v2](https://docs.amazonaws.cn/goto/SdkForGoV2/ecs-2014-11-13/SubmitContainerStateChange) 
+  [Amazon SDK for Java V2](https://docs.amazonaws.cn/goto/SdkForJavaV2/ecs-2014-11-13/SubmitContainerStateChange) 
+  [Amazon SDK for JavaScript V3](https://docs.amazonaws.cn/goto/SdkForJavaScriptV3/ecs-2014-11-13/SubmitContainerStateChange) 
+  [Amazon SDK for Kotlin](https://docs.amazonaws.cn/goto/SdkForKotlin/ecs-2014-11-13/SubmitContainerStateChange) 
+  [Amazon SDK for PHP V3](https://docs.amazonaws.cn/goto/SdkForPHPV3/ecs-2014-11-13/SubmitContainerStateChange) 
+  [Amazon SDK for Python](https://docs.amazonaws.cn/goto/boto3/ecs-2014-11-13/SubmitContainerStateChange) 
+  [Amazon SDK for Ruby V3](https://docs.amazonaws.cn/goto/SdkForRubyV3/ecs-2014-11-13/SubmitContainerStateChange) 

# SubmitTaskStateChange


**Note**  
This action is only used by the Amazon ECS agent, and it is not intended for use outside of the agent.

Sent to acknowledge that a task changed states.

## Request Syntax


```
{
   "attachments": [ 
      { 
         "attachmentArn": "string",
         "status": "string"
      }
   ],
   "cluster": "string",
   "containers": [ 
      { 
         "containerName": "string",
         "exitCode": number,
         "imageDigest": "string",
         "networkBindings": [ 
            { 
               "bindIP": "string",
               "containerPort": number,
               "containerPortRange": "string",
               "hostPort": number,
               "hostPortRange": "string",
               "protocol": "string"
            }
         ],
         "reason": "string",
         "runtimeId": "string",
         "status": "string"
      }
   ],
   "executionStoppedAt": number,
   "managedAgents": [ 
      { 
         "containerName": "string",
         "managedAgentName": "string",
         "reason": "string",
         "status": "string"
      }
   ],
   "pullStartedAt": number,
   "pullStoppedAt": number,
   "reason": "string",
   "status": "string",
   "task": "string"
}
```

## Request Parameters


For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [attachments](#API_SubmitTaskStateChange_RequestSyntax) **   <a name="ECS-SubmitTaskStateChange-request-attachments"></a>
Any attachments associated with the state change request.  
Type: Array of [AttachmentStateChange](API_AttachmentStateChange.md) objects  
Required: No

 ** [cluster](#API_SubmitTaskStateChange_RequestSyntax) **   <a name="ECS-SubmitTaskStateChange-request-cluster"></a>
The short name or full Amazon Resource Name (ARN) of the cluster that hosts the task.  
Type: String  
Required: No

 ** [containers](#API_SubmitTaskStateChange_RequestSyntax) **   <a name="ECS-SubmitTaskStateChange-request-containers"></a>
Any containers that's associated with the state change request.  
Type: Array of [ContainerStateChange](API_ContainerStateChange.md) objects  
Required: No

 ** [executionStoppedAt](#API_SubmitTaskStateChange_RequestSyntax) **   <a name="ECS-SubmitTaskStateChange-request-executionStoppedAt"></a>
The Unix timestamp for the time when the task execution stopped.  
Type: Timestamp  
Required: No

 ** [managedAgents](#API_SubmitTaskStateChange_RequestSyntax) **   <a name="ECS-SubmitTaskStateChange-request-managedAgents"></a>
The details for the managed agent that's associated with the task.  
Type: Array of [ManagedAgentStateChange](API_ManagedAgentStateChange.md) objects  
Required: No

 ** [pullStartedAt](#API_SubmitTaskStateChange_RequestSyntax) **   <a name="ECS-SubmitTaskStateChange-request-pullStartedAt"></a>
The Unix timestamp for the time when the container image pull started.  
Type: Timestamp  
Required: No

 ** [pullStoppedAt](#API_SubmitTaskStateChange_RequestSyntax) **   <a name="ECS-SubmitTaskStateChange-request-pullStoppedAt"></a>
The Unix timestamp for the time when the container image pull completed.  
Type: Timestamp  
Required: No

 ** [reason](#API_SubmitTaskStateChange_RequestSyntax) **   <a name="ECS-SubmitTaskStateChange-request-reason"></a>
The reason for the state change request.  
Type: String  
Required: No

 ** [status](#API_SubmitTaskStateChange_RequestSyntax) **   <a name="ECS-SubmitTaskStateChange-request-status"></a>
The status of the state change request.  
Type: String  
Required: No

 ** [task](#API_SubmitTaskStateChange_RequestSyntax) **   <a name="ECS-SubmitTaskStateChange-request-task"></a>
The task ID or full ARN of the task in the state change request.  
Type: String  
Required: No

## Response Syntax


```
{
   "acknowledgment": "string"
}
```

## 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.

 ** [acknowledgment](#API_SubmitTaskStateChange_ResponseSyntax) **   <a name="ECS-SubmitTaskStateChange-response-acknowledgment"></a>
Acknowledgement of the state change.  
Type: String

## Errors


For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** AccessDeniedException **   
You don't have authorization to perform the requested action.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ClientException **   
These errors are usually caused by a client action. This client action might be using an action or resource on behalf of a user that doesn't have permissions to use the action or resource. Or, it might be specifying an identifier that isn't valid.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** InvalidParameterException **   
The specified parameter isn't valid. Review the available parameters for the API request.  
For more information about service event errors, see [Amazon ECS service event messages](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/service-event-messages-list.html).     
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ServerException **   
These errors are usually caused by a server issue.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 500

## See Also


For more information about using this API in one of the language-specific Amazon SDKs, see the following:
+  [Amazon Command Line Interface V2](https://docs.amazonaws.cn/goto/cli2/ecs-2014-11-13/SubmitTaskStateChange) 
+  [Amazon SDK for .NET V4](https://docs.amazonaws.cn/goto/DotNetSDKV4/ecs-2014-11-13/SubmitTaskStateChange) 
+  [Amazon SDK for C\$1\$1](https://docs.amazonaws.cn/goto/SdkForCpp/ecs-2014-11-13/SubmitTaskStateChange) 
+  [Amazon SDK for Go v2](https://docs.amazonaws.cn/goto/SdkForGoV2/ecs-2014-11-13/SubmitTaskStateChange) 
+  [Amazon SDK for Java V2](https://docs.amazonaws.cn/goto/SdkForJavaV2/ecs-2014-11-13/SubmitTaskStateChange) 
+  [Amazon SDK for JavaScript V3](https://docs.amazonaws.cn/goto/SdkForJavaScriptV3/ecs-2014-11-13/SubmitTaskStateChange) 
+  [Amazon SDK for Kotlin](https://docs.amazonaws.cn/goto/SdkForKotlin/ecs-2014-11-13/SubmitTaskStateChange) 
+  [Amazon SDK for PHP V3](https://docs.amazonaws.cn/goto/SdkForPHPV3/ecs-2014-11-13/SubmitTaskStateChange) 
+  [Amazon SDK for Python](https://docs.amazonaws.cn/goto/boto3/ecs-2014-11-13/SubmitTaskStateChange) 
+  [Amazon SDK for Ruby V3](https://docs.amazonaws.cn/goto/SdkForRubyV3/ecs-2014-11-13/SubmitTaskStateChange) 

# TagResource


Associates the specified tags to a resource with the specified `resourceArn`. If existing tags on a resource aren't specified in the request parameters, they aren't changed. When a resource is deleted, the tags that are associated with that resource are deleted as well.

## Request Syntax


```
{
   "resourceArn": "string",
   "tags": [ 
      { 
         "key": "string",
         "value": "string"
      }
   ]
}
```

## Request Parameters


For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [resourceArn](#API_TagResource_RequestSyntax) **   <a name="ECS-TagResource-request-resourceArn"></a>
The Amazon Resource Name (ARN) of the resource to add tags to. Currently, the supported resources are Amazon ECS capacity providers, tasks, services, task definitions, clusters, and container instances.  
In order to tag a service that has the following ARN format, you need to migrate the service to the long ARN. For more information, see [Migrate an Amazon ECS short service ARN to a long ARN](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/service-arn-migration.html) in the *Amazon Elastic Container Service Developer Guide*.  
 `arn:aws:ecs:region:aws_account_id:service/service-name`   
After the migration is complete, the service has the long ARN format, as shown below. Use this ARN to tag the service.  
 `arn:aws:ecs:region:aws_account_id:service/cluster-name/service-name`   
If you try to tag a service with a short ARN, you receive an `InvalidParameterException` error.  
Type: String  
Required: Yes

 ** [tags](#API_TagResource_RequestSyntax) **   <a name="ECS-TagResource-request-tags"></a>
The tags to add to the resource. A tag is an array of key-value pairs.  
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 Amazon 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.
Type: Array of [Tag](API_Tag.md) objects  
Array Members: Minimum number of 0 items. Maximum number of 50 items.  
Required: Yes

## Response Elements


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

## Errors


For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** ClientException **   
These errors are usually caused by a client action. This client action might be using an action or resource on behalf of a user that doesn't have permissions to use the action or resource. Or, it might be specifying an identifier that isn't valid.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ClusterNotFoundException **   
The specified cluster wasn't found. You can view your available clusters with [ListClusters](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_ListClusters.html). Amazon ECS clusters are Region specific.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** InvalidParameterException **   
The specified parameter isn't valid. Review the available parameters for the API request.  
For more information about service event errors, see [Amazon ECS service event messages](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/service-event-messages-list.html).     
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ResourceNotFoundException **   
The specified resource wasn't found.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ServerException **   
These errors are usually caused by a server issue.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 500

## Examples


In the following example or examples, the Authorization header contents (`AUTHPARAMS`) must be replaced with an Amazon Signature Version 4 signature. For more information, see [Signature Version 4 Signing Process](https://docs.amazonaws.cn/general/latest/gr/signature-version-4.html) in the * Amazon General Reference*.

You only need to learn how to sign HTTP requests if you intend to create them manually. When you use the [Amazon Command Line Interface](http://www.amazonaws.cn/cli/) or one of the [Amazon SDKs](http://www.amazonaws.cn/tools/) to make requests to Amazon, these tools automatically sign the requests for you, with the access key that you specify when you configure the tools. When you use these tools, you don't have to sign requests yourself.

### Example


This example tags the `test` service in the `dev` cluster with key `team` and value `dev`.

#### Sample Request


```
POST / HTTP/1.1
Host: ecs.us-west-2.amazonaws.com
Accept-Encoding: identity
X-Amz-Target: AmazonEC2ContainerServiceV20141113.TagResource
Content-Type: application/x-amz-json-1.1
X-Amz-Date: 20241209T194744Z
Authorization: AUTHPARAMS
Content-Length: 115

{
   "resourceArn":"arn:aws:ecs:us-west-2:012345678910:service/dev/test",
   "tags":[
      {
         "key":"team",
         "value":"dev"
      }
   ]
}
```

#### Sample Response


```
HTTP/1.1 200 OK
x-amzn-RequestId: 123a4b56-7c89-01d2-3ef4-example5678f
Content-Type: application/x-amz-json-1.1
Content-Length: 2
Date: Fri, 20 Dec 2024 20:01:34 GMT

{}
```

### Example


This example tags the `dev` cluster with key `team` and value `dev` and the key `second-key` and value `dev-key2`.

#### Sample Request


```
POST / HTTP/1.1
Host: ecs.us-west-2.amazonaws.com
Accept-Encoding: identity
X-Amz-Target: AmazonEC2ContainerServiceV20141113.TagResource
Content-Type: application/x-amz-json-1.1
X-Amz-Date: 20181026T194744Z
Authorization: AUTHPARAMS
Content-Length: 115

{
   "resourceArn":"arn:aws:ecs:us-west-2:012345678910:cluster/dev",
   "tags":[
      {
         "key":"team",
         "value":"dev"
       },
       {
        "key": "second-key",
        "value": "dev-key2"
      }
   ]
}
```

#### Sample Response


```
HTTP/1.1 200 OK
x-amzn-RequestId: 123a4b56-7c89-01d2-3ef4-example5678f
Content-Type: application/x-amz-json-1.1
Content-Length: 2
Date: Wed, 19 Oct 2022 20:01:34 GMT

{}
```

## See Also


For more information about using this API in one of the language-specific Amazon SDKs, see the following:
+  [Amazon Command Line Interface V2](https://docs.amazonaws.cn/goto/cli2/ecs-2014-11-13/TagResource) 
+  [Amazon SDK for .NET V4](https://docs.amazonaws.cn/goto/DotNetSDKV4/ecs-2014-11-13/TagResource) 
+  [Amazon SDK for C\$1\$1](https://docs.amazonaws.cn/goto/SdkForCpp/ecs-2014-11-13/TagResource) 
+  [Amazon SDK for Go v2](https://docs.amazonaws.cn/goto/SdkForGoV2/ecs-2014-11-13/TagResource) 
+  [Amazon SDK for Java V2](https://docs.amazonaws.cn/goto/SdkForJavaV2/ecs-2014-11-13/TagResource) 
+  [Amazon SDK for JavaScript V3](https://docs.amazonaws.cn/goto/SdkForJavaScriptV3/ecs-2014-11-13/TagResource) 
+  [Amazon SDK for Kotlin](https://docs.amazonaws.cn/goto/SdkForKotlin/ecs-2014-11-13/TagResource) 
+  [Amazon SDK for PHP V3](https://docs.amazonaws.cn/goto/SdkForPHPV3/ecs-2014-11-13/TagResource) 
+  [Amazon SDK for Python](https://docs.amazonaws.cn/goto/boto3/ecs-2014-11-13/TagResource) 
+  [Amazon SDK for Ruby V3](https://docs.amazonaws.cn/goto/SdkForRubyV3/ecs-2014-11-13/TagResource) 

# UntagResource


Deletes specified tags from a resource.

## Request Syntax


```
{
   "resourceArn": "string",
   "tagKeys": [ "string" ]
}
```

## Request Parameters


For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [resourceArn](#API_UntagResource_RequestSyntax) **   <a name="ECS-UntagResource-request-resourceArn"></a>
The Amazon Resource Name (ARN) of the resource to delete tags from. Currently, the supported resources are Amazon ECS capacity providers, tasks, services, task definitions, clusters, and container instances.  
Type: String  
Required: Yes

 ** [tagKeys](#API_UntagResource_RequestSyntax) **   <a name="ECS-UntagResource-request-tagKeys"></a>
The keys of the tags to be removed.  
Type: Array of strings  
Length Constraints: Minimum length of 1. Maximum length of 128.  
Pattern: `([\p{L}\p{Z}\p{N}_.:/=+\-@]*)`   
Required: Yes

## Response Elements


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

## Errors


For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** ClientException **   
These errors are usually caused by a client action. This client action might be using an action or resource on behalf of a user that doesn't have permissions to use the action or resource. Or, it might be specifying an identifier that isn't valid.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ClusterNotFoundException **   
The specified cluster wasn't found. You can view your available clusters with [ListClusters](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_ListClusters.html). Amazon ECS clusters are Region specific.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** InvalidParameterException **   
The specified parameter isn't valid. Review the available parameters for the API request.  
For more information about service event errors, see [Amazon ECS service event messages](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/service-event-messages-list.html).     
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ResourceNotFoundException **   
The specified resource wasn't found.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ServerException **   
These errors are usually caused by a server issue.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 500

## Examples


In the following example or examples, the Authorization header contents (`AUTHPARAMS`) must be replaced with an Amazon Signature Version 4 signature. For more information, see [Signature Version 4 Signing Process](https://docs.amazonaws.cn/general/latest/gr/signature-version-4.html) in the * Amazon General Reference*.

You only need to learn how to sign HTTP requests if you intend to create them manually. When you use the [Amazon Command Line Interface](http://www.amazonaws.cn/cli/) or one of the [Amazon SDKs](http://www.amazonaws.cn/tools/) to make requests to Amazon, these tools automatically sign the requests for you, with the access key that you specify when you configure the tools. When you use these tools, you don't have to sign requests yourself.

### Example


This example tags the `dev` cluster with key `team` and value `dev`.

#### Sample Request


```
POST / HTTP/1.1
Host: ecs.us-west-2.amazonaws.com
Accept-Encoding: identity
X-Amz-Target: AmazonEC2ContainerServiceV20141113.UntagResource
Content-Type: application/x-amz-json-1.1
X-Amz-Date: 20181026T200134Z
Authorization: AUTHPARAMS
Content-Length: 93

{  
   "resourceArn":"arn:aws:ecs:us-west-2:012345678910:cluster/devcluster",
   "tagKeys":[  
      "team"
   ]
}
```

#### Sample Response


```
HTTP/1.1 200 OK
x-amzn-RequestId: 123a4b56-7c89-01d2-3ef4-example5678f
Content-Type: application/x-amz-json-1.1
Content-Length: 2
Date: Fri, 26 Oct 2018 20:01:34 GMT

{}
```

## See Also


For more information about using this API in one of the language-specific Amazon SDKs, see the following:
+  [Amazon Command Line Interface V2](https://docs.amazonaws.cn/goto/cli2/ecs-2014-11-13/UntagResource) 
+  [Amazon SDK for .NET V4](https://docs.amazonaws.cn/goto/DotNetSDKV4/ecs-2014-11-13/UntagResource) 
+  [Amazon SDK for C\$1\$1](https://docs.amazonaws.cn/goto/SdkForCpp/ecs-2014-11-13/UntagResource) 
+  [Amazon SDK for Go v2](https://docs.amazonaws.cn/goto/SdkForGoV2/ecs-2014-11-13/UntagResource) 
+  [Amazon SDK for Java V2](https://docs.amazonaws.cn/goto/SdkForJavaV2/ecs-2014-11-13/UntagResource) 
+  [Amazon SDK for JavaScript V3](https://docs.amazonaws.cn/goto/SdkForJavaScriptV3/ecs-2014-11-13/UntagResource) 
+  [Amazon SDK for Kotlin](https://docs.amazonaws.cn/goto/SdkForKotlin/ecs-2014-11-13/UntagResource) 
+  [Amazon SDK for PHP V3](https://docs.amazonaws.cn/goto/SdkForPHPV3/ecs-2014-11-13/UntagResource) 
+  [Amazon SDK for Python](https://docs.amazonaws.cn/goto/boto3/ecs-2014-11-13/UntagResource) 
+  [Amazon SDK for Ruby V3](https://docs.amazonaws.cn/goto/SdkForRubyV3/ecs-2014-11-13/UntagResource) 

# UpdateCapacityProvider


Modifies the parameters for a capacity provider.

These changes only apply to new Amazon ECS Managed Instances, or EC2 instances, not existing ones.

## Request Syntax


```
{
   "autoScalingGroupProvider": { 
      "managedDraining": "string",
      "managedScaling": { 
         "instanceWarmupPeriod": number,
         "maximumScalingStepSize": number,
         "minimumScalingStepSize": number,
         "status": "string",
         "targetCapacity": number
      },
      "managedTerminationProtection": "string"
   },
   "cluster": "string",
   "managedInstancesProvider": { 
      "infrastructureOptimization": { 
         "scaleInAfter": number
      },
      "infrastructureRoleArn": "string",
      "instanceLaunchTemplate": { 
         "capacityReservations": { 
            "reservationGroupArn": "string",
            "reservationPreference": "string"
         },
         "ec2InstanceProfileArn": "string",
         "instanceMetadataTagsPropagation": boolean,
         "instanceRequirements": { 
            "acceleratorCount": { 
               "max": number,
               "min": number
            },
            "acceleratorManufacturers": [ "string" ],
            "acceleratorNames": [ "string" ],
            "acceleratorTotalMemoryMiB": { 
               "max": number,
               "min": number
            },
            "acceleratorTypes": [ "string" ],
            "allowedInstanceTypes": [ "string" ],
            "bareMetal": "string",
            "baselineEbsBandwidthMbps": { 
               "max": number,
               "min": number
            },
            "burstablePerformance": "string",
            "cpuManufacturers": [ "string" ],
            "excludedInstanceTypes": [ "string" ],
            "instanceGenerations": [ "string" ],
            "localStorage": "string",
            "localStorageTypes": [ "string" ],
            "maxSpotPriceAsPercentageOfOptimalOnDemandPrice": number,
            "memoryGiBPerVCpu": { 
               "max": number,
               "min": number
            },
            "memoryMiB": { 
               "max": number,
               "min": number
            },
            "networkBandwidthGbps": { 
               "max": number,
               "min": number
            },
            "networkInterfaceCount": { 
               "max": number,
               "min": number
            },
            "onDemandMaxPricePercentageOverLowestPrice": number,
            "requireHibernateSupport": boolean,
            "spotMaxPricePercentageOverLowestPrice": number,
            "totalLocalStorageGB": { 
               "max": number,
               "min": number
            },
            "vCpuCount": { 
               "max": number,
               "min": number
            }
         },
         "localStorageConfiguration": { 
            "useLocalStorage": boolean
         },
         "monitoring": "string",
         "networkConfiguration": { 
            "securityGroups": [ "string" ],
            "subnets": [ "string" ]
         },
         "storageConfiguration": { 
            "storageSizeGiB": number
         }
      },
      "propagateTags": "string"
   },
   "name": "string"
}
```

## Request Parameters


For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [autoScalingGroupProvider](#API_UpdateCapacityProvider_RequestSyntax) **   <a name="ECS-UpdateCapacityProvider-request-autoScalingGroupProvider"></a>
An object that represent the parameters to update for the Auto Scaling group capacity provider.  
Type: [AutoScalingGroupProviderUpdate](API_AutoScalingGroupProviderUpdate.md) object  
Required: No

 ** [cluster](#API_UpdateCapacityProvider_RequestSyntax) **   <a name="ECS-UpdateCapacityProvider-request-cluster"></a>
The name of the cluster that contains the capacity provider to update. Managed instances capacity providers are cluster-scoped and can only be updated within their associated cluster.  
Type: String  
Required: No

 ** [managedInstancesProvider](#API_UpdateCapacityProvider_RequestSyntax) **   <a name="ECS-UpdateCapacityProvider-request-managedInstancesProvider"></a>
The updated configuration for the Amazon ECS Managed Instances provider. You can modify the infrastructure role, instance launch template, and tag propagation settings. Changes take effect for new instances launched after the update.  
Type: [UpdateManagedInstancesProviderConfiguration](API_UpdateManagedInstancesProviderConfiguration.md) object  
Required: No

 ** [name](#API_UpdateCapacityProvider_RequestSyntax) **   <a name="ECS-UpdateCapacityProvider-request-name"></a>
The name of the capacity provider to update.  
Type: String  
Required: Yes

## Response Syntax


```
{
   "capacityProvider": { 
      "autoScalingGroupProvider": { 
         "autoScalingGroupArn": "string",
         "managedDraining": "string",
         "managedScaling": { 
            "instanceWarmupPeriod": number,
            "maximumScalingStepSize": number,
            "minimumScalingStepSize": number,
            "status": "string",
            "targetCapacity": number
         },
         "managedTerminationProtection": "string"
      },
      "capacityProviderArn": "string",
      "cluster": "string",
      "managedInstancesProvider": { 
         "infrastructureOptimization": { 
            "scaleInAfter": number
         },
         "infrastructureRoleArn": "string",
         "instanceLaunchTemplate": { 
            "capacityOptionType": "string",
            "capacityReservations": { 
               "reservationGroupArn": "string",
               "reservationPreference": "string"
            },
            "ec2InstanceProfileArn": "string",
            "fipsEnabled": boolean,
            "instanceMetadataTagsPropagation": boolean,
            "instanceRequirements": { 
               "acceleratorCount": { 
                  "max": number,
                  "min": number
               },
               "acceleratorManufacturers": [ "string" ],
               "acceleratorNames": [ "string" ],
               "acceleratorTotalMemoryMiB": { 
                  "max": number,
                  "min": number
               },
               "acceleratorTypes": [ "string" ],
               "allowedInstanceTypes": [ "string" ],
               "bareMetal": "string",
               "baselineEbsBandwidthMbps": { 
                  "max": number,
                  "min": number
               },
               "burstablePerformance": "string",
               "cpuManufacturers": [ "string" ],
               "excludedInstanceTypes": [ "string" ],
               "instanceGenerations": [ "string" ],
               "localStorage": "string",
               "localStorageTypes": [ "string" ],
               "maxSpotPriceAsPercentageOfOptimalOnDemandPrice": number,
               "memoryGiBPerVCpu": { 
                  "max": number,
                  "min": number
               },
               "memoryMiB": { 
                  "max": number,
                  "min": number
               },
               "networkBandwidthGbps": { 
                  "max": number,
                  "min": number
               },
               "networkInterfaceCount": { 
                  "max": number,
                  "min": number
               },
               "onDemandMaxPricePercentageOverLowestPrice": number,
               "requireHibernateSupport": boolean,
               "spotMaxPricePercentageOverLowestPrice": number,
               "totalLocalStorageGB": { 
                  "max": number,
                  "min": number
               },
               "vCpuCount": { 
                  "max": number,
                  "min": number
               }
            },
            "localStorageConfiguration": { 
               "useLocalStorage": boolean
            },
            "monitoring": "string",
            "networkConfiguration": { 
               "securityGroups": [ "string" ],
               "subnets": [ "string" ]
            },
            "storageConfiguration": { 
               "storageSizeGiB": number
            }
         },
         "propagateTags": "string"
      },
      "name": "string",
      "status": "string",
      "tags": [ 
         { 
            "key": "string",
            "value": "string"
         }
      ],
      "type": "string",
      "updateStatus": "string",
      "updateStatusReason": "string"
   }
}
```

## 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.

 ** [capacityProvider](#API_UpdateCapacityProvider_ResponseSyntax) **   <a name="ECS-UpdateCapacityProvider-response-capacityProvider"></a>
Details about the capacity provider.  
Type: [CapacityProvider](API_CapacityProvider.md) object

## Errors


For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** ClientException **   
These errors are usually caused by a client action. This client action might be using an action or resource on behalf of a user that doesn't have permissions to use the action or resource. Or, it might be specifying an identifier that isn't valid.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ClusterNotFoundException **   
The specified cluster wasn't found. You can view your available clusters with [ListClusters](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_ListClusters.html). Amazon ECS clusters are Region specific.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** InvalidParameterException **   
The specified parameter isn't valid. Review the available parameters for the API request.  
For more information about service event errors, see [Amazon ECS service event messages](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/service-event-messages-list.html).     
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ServerException **   
These errors are usually caused by a server issue.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 500

 ** UnsupportedFeatureException **   
The specified task isn't supported in this Region.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

## See Also


For more information about using this API in one of the language-specific Amazon SDKs, see the following:
+  [Amazon Command Line Interface V2](https://docs.amazonaws.cn/goto/cli2/ecs-2014-11-13/UpdateCapacityProvider) 
+  [Amazon SDK for .NET V4](https://docs.amazonaws.cn/goto/DotNetSDKV4/ecs-2014-11-13/UpdateCapacityProvider) 
+  [Amazon SDK for C\$1\$1](https://docs.amazonaws.cn/goto/SdkForCpp/ecs-2014-11-13/UpdateCapacityProvider) 
+  [Amazon SDK for Go v2](https://docs.amazonaws.cn/goto/SdkForGoV2/ecs-2014-11-13/UpdateCapacityProvider) 
+  [Amazon SDK for Java V2](https://docs.amazonaws.cn/goto/SdkForJavaV2/ecs-2014-11-13/UpdateCapacityProvider) 
+  [Amazon SDK for JavaScript V3](https://docs.amazonaws.cn/goto/SdkForJavaScriptV3/ecs-2014-11-13/UpdateCapacityProvider) 
+  [Amazon SDK for Kotlin](https://docs.amazonaws.cn/goto/SdkForKotlin/ecs-2014-11-13/UpdateCapacityProvider) 
+  [Amazon SDK for PHP V3](https://docs.amazonaws.cn/goto/SdkForPHPV3/ecs-2014-11-13/UpdateCapacityProvider) 
+  [Amazon SDK for Python](https://docs.amazonaws.cn/goto/boto3/ecs-2014-11-13/UpdateCapacityProvider) 
+  [Amazon SDK for Ruby V3](https://docs.amazonaws.cn/goto/SdkForRubyV3/ecs-2014-11-13/UpdateCapacityProvider) 

# UpdateCluster


Updates the cluster.

## Request Syntax


```
{
   "cluster": "string",
   "configuration": { 
      "executeCommandConfiguration": { 
         "kmsKeyId": "string",
         "logConfiguration": { 
            "cloudWatchEncryptionEnabled": boolean,
            "cloudWatchLogGroupName": "string",
            "s3BucketName": "string",
            "s3EncryptionEnabled": boolean,
            "s3KeyPrefix": "string"
         },
         "logging": "string"
      },
      "managedStorageConfiguration": { 
         "fargateEphemeralStorageKmsKeyId": "string",
         "kmsKeyId": "string"
      }
   },
   "serviceConnectDefaults": { 
      "namespace": "string"
   },
   "settings": [ 
      { 
         "name": "string",
         "value": "string"
      }
   ]
}
```

## Request Parameters


For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [cluster](#API_UpdateCluster_RequestSyntax) **   <a name="ECS-UpdateCluster-request-cluster"></a>
The name of the cluster to modify the settings for.  
Type: String  
Required: Yes

 ** [configuration](#API_UpdateCluster_RequestSyntax) **   <a name="ECS-UpdateCluster-request-configuration"></a>
The execute command configuration for the cluster.  
Type: [ClusterConfiguration](API_ClusterConfiguration.md) object  
Required: No

 ** [serviceConnectDefaults](#API_UpdateCluster_RequestSyntax) **   <a name="ECS-UpdateCluster-request-serviceConnectDefaults"></a>
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](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/service-connect.html) in the *Amazon Elastic Container Service Developer Guide*.  
Type: [ClusterServiceConnectDefaultsRequest](API_ClusterServiceConnectDefaultsRequest.md) object  
Required: No

 ** [settings](#API_UpdateCluster_RequestSyntax) **   <a name="ECS-UpdateCluster-request-settings"></a>
The cluster settings for your cluster.  
Type: Array of [ClusterSetting](API_ClusterSetting.md) objects  
Required: No

## Response Syntax


```
{
   "cluster": { 
      "activeServicesCount": number,
      "attachments": [ 
         { 
            "details": [ 
               { 
                  "name": "string",
                  "value": "string"
               }
            ],
            "id": "string",
            "status": "string",
            "type": "string"
         }
      ],
      "attachmentsStatus": "string",
      "capacityProviders": [ "string" ],
      "clusterArn": "string",
      "clusterName": "string",
      "configuration": { 
         "executeCommandConfiguration": { 
            "kmsKeyId": "string",
            "logConfiguration": { 
               "cloudWatchEncryptionEnabled": boolean,
               "cloudWatchLogGroupName": "string",
               "s3BucketName": "string",
               "s3EncryptionEnabled": boolean,
               "s3KeyPrefix": "string"
            },
            "logging": "string"
         },
         "managedStorageConfiguration": { 
            "fargateEphemeralStorageKmsKeyId": "string",
            "kmsKeyId": "string"
         }
      },
      "defaultCapacityProviderStrategy": [ 
         { 
            "base": number,
            "capacityProvider": "string",
            "weight": number
         }
      ],
      "pendingTasksCount": number,
      "registeredContainerInstancesCount": number,
      "runningTasksCount": number,
      "serviceConnectDefaults": { 
         "namespace": "string"
      },
      "settings": [ 
         { 
            "name": "string",
            "value": "string"
         }
      ],
      "statistics": [ 
         { 
            "name": "string",
            "value": "string"
         }
      ],
      "status": "string",
      "tags": [ 
         { 
            "key": "string",
            "value": "string"
         }
      ]
   }
}
```

## 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.

 ** [cluster](#API_UpdateCluster_ResponseSyntax) **   <a name="ECS-UpdateCluster-response-cluster"></a>
Details about the cluster.  
Type: [Cluster](API_Cluster.md) object

## Errors


For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** ClientException **   
These errors are usually caused by a client action. This client action might be using an action or resource on behalf of a user that doesn't have permissions to use the action or resource. Or, it might be specifying an identifier that isn't valid.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ClusterNotFoundException **   
The specified cluster wasn't found. You can view your available clusters with [ListClusters](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_ListClusters.html). Amazon ECS clusters are Region specific.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** InvalidParameterException **   
The specified parameter isn't valid. Review the available parameters for the API request.  
For more information about service event errors, see [Amazon ECS service event messages](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/service-event-messages-list.html).     
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** NamespaceNotFoundException **   
The specified namespace wasn't found.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ServerException **   
These errors are usually caused by a server issue.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 500

## See Also


For more information about using this API in one of the language-specific Amazon SDKs, see the following:
+  [Amazon Command Line Interface V2](https://docs.amazonaws.cn/goto/cli2/ecs-2014-11-13/UpdateCluster) 
+  [Amazon SDK for .NET V4](https://docs.amazonaws.cn/goto/DotNetSDKV4/ecs-2014-11-13/UpdateCluster) 
+  [Amazon SDK for C\$1\$1](https://docs.amazonaws.cn/goto/SdkForCpp/ecs-2014-11-13/UpdateCluster) 
+  [Amazon SDK for Go v2](https://docs.amazonaws.cn/goto/SdkForGoV2/ecs-2014-11-13/UpdateCluster) 
+  [Amazon SDK for Java V2](https://docs.amazonaws.cn/goto/SdkForJavaV2/ecs-2014-11-13/UpdateCluster) 
+  [Amazon SDK for JavaScript V3](https://docs.amazonaws.cn/goto/SdkForJavaScriptV3/ecs-2014-11-13/UpdateCluster) 
+  [Amazon SDK for Kotlin](https://docs.amazonaws.cn/goto/SdkForKotlin/ecs-2014-11-13/UpdateCluster) 
+  [Amazon SDK for PHP V3](https://docs.amazonaws.cn/goto/SdkForPHPV3/ecs-2014-11-13/UpdateCluster) 
+  [Amazon SDK for Python](https://docs.amazonaws.cn/goto/boto3/ecs-2014-11-13/UpdateCluster) 
+  [Amazon SDK for Ruby V3](https://docs.amazonaws.cn/goto/SdkForRubyV3/ecs-2014-11-13/UpdateCluster) 

# UpdateClusterSettings


Modifies the settings to use for a cluster.

## Request Syntax


```
{
   "cluster": "string",
   "settings": [ 
      { 
         "name": "string",
         "value": "string"
      }
   ]
}
```

## Request Parameters


For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [cluster](#API_UpdateClusterSettings_RequestSyntax) **   <a name="ECS-UpdateClusterSettings-request-cluster"></a>
The name of the cluster to modify the settings for.  
Type: String  
Required: Yes

 ** [settings](#API_UpdateClusterSettings_RequestSyntax) **   <a name="ECS-UpdateClusterSettings-request-settings"></a>
The setting to use by default for a cluster. This parameter is used to turn on CloudWatch Container Insights for a cluster. If this value is specified, it overrides the `containerInsights` value set with [PutAccountSetting](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_PutAccountSetting.html) or [PutAccountSettingDefault](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_PutAccountSettingDefault.html).  
Currently, if you delete an existing cluster that does not have Container Insights turned on, and then create a new cluster with the same name with Container Insights tuned on, Container Insights will not actually be turned on. If you want to preserve the same name for your existing cluster and turn on Container Insights, you must wait 7 days before you can re-create it.
Type: Array of [ClusterSetting](API_ClusterSetting.md) objects  
Required: Yes

## Response Syntax


```
{
   "cluster": { 
      "activeServicesCount": number,
      "attachments": [ 
         { 
            "details": [ 
               { 
                  "name": "string",
                  "value": "string"
               }
            ],
            "id": "string",
            "status": "string",
            "type": "string"
         }
      ],
      "attachmentsStatus": "string",
      "capacityProviders": [ "string" ],
      "clusterArn": "string",
      "clusterName": "string",
      "configuration": { 
         "executeCommandConfiguration": { 
            "kmsKeyId": "string",
            "logConfiguration": { 
               "cloudWatchEncryptionEnabled": boolean,
               "cloudWatchLogGroupName": "string",
               "s3BucketName": "string",
               "s3EncryptionEnabled": boolean,
               "s3KeyPrefix": "string"
            },
            "logging": "string"
         },
         "managedStorageConfiguration": { 
            "fargateEphemeralStorageKmsKeyId": "string",
            "kmsKeyId": "string"
         }
      },
      "defaultCapacityProviderStrategy": [ 
         { 
            "base": number,
            "capacityProvider": "string",
            "weight": number
         }
      ],
      "pendingTasksCount": number,
      "registeredContainerInstancesCount": number,
      "runningTasksCount": number,
      "serviceConnectDefaults": { 
         "namespace": "string"
      },
      "settings": [ 
         { 
            "name": "string",
            "value": "string"
         }
      ],
      "statistics": [ 
         { 
            "name": "string",
            "value": "string"
         }
      ],
      "status": "string",
      "tags": [ 
         { 
            "key": "string",
            "value": "string"
         }
      ]
   }
}
```

## 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.

 ** [cluster](#API_UpdateClusterSettings_ResponseSyntax) **   <a name="ECS-UpdateClusterSettings-response-cluster"></a>
Details about the cluster  
Type: [Cluster](API_Cluster.md) object

## Errors


For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** ClientException **   
These errors are usually caused by a client action. This client action might be using an action or resource on behalf of a user that doesn't have permissions to use the action or resource. Or, it might be specifying an identifier that isn't valid.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ClusterNotFoundException **   
The specified cluster wasn't found. You can view your available clusters with [ListClusters](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_ListClusters.html). Amazon ECS clusters are Region specific.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** InvalidParameterException **   
The specified parameter isn't valid. Review the available parameters for the API request.  
For more information about service event errors, see [Amazon ECS service event messages](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/service-event-messages-list.html).     
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ServerException **   
These errors are usually caused by a server issue.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 500

## See Also


For more information about using this API in one of the language-specific Amazon SDKs, see the following:
+  [Amazon Command Line Interface V2](https://docs.amazonaws.cn/goto/cli2/ecs-2014-11-13/UpdateClusterSettings) 
+  [Amazon SDK for .NET V4](https://docs.amazonaws.cn/goto/DotNetSDKV4/ecs-2014-11-13/UpdateClusterSettings) 
+  [Amazon SDK for C\$1\$1](https://docs.amazonaws.cn/goto/SdkForCpp/ecs-2014-11-13/UpdateClusterSettings) 
+  [Amazon SDK for Go v2](https://docs.amazonaws.cn/goto/SdkForGoV2/ecs-2014-11-13/UpdateClusterSettings) 
+  [Amazon SDK for Java V2](https://docs.amazonaws.cn/goto/SdkForJavaV2/ecs-2014-11-13/UpdateClusterSettings) 
+  [Amazon SDK for JavaScript V3](https://docs.amazonaws.cn/goto/SdkForJavaScriptV3/ecs-2014-11-13/UpdateClusterSettings) 
+  [Amazon SDK for Kotlin](https://docs.amazonaws.cn/goto/SdkForKotlin/ecs-2014-11-13/UpdateClusterSettings) 
+  [Amazon SDK for PHP V3](https://docs.amazonaws.cn/goto/SdkForPHPV3/ecs-2014-11-13/UpdateClusterSettings) 
+  [Amazon SDK for Python](https://docs.amazonaws.cn/goto/boto3/ecs-2014-11-13/UpdateClusterSettings) 
+  [Amazon SDK for Ruby V3](https://docs.amazonaws.cn/goto/SdkForRubyV3/ecs-2014-11-13/UpdateClusterSettings) 

# UpdateContainerAgent


Updates the Amazon ECS container agent on a specified container instance. Updating the Amazon ECS container agent doesn't interrupt running tasks or services on the container instance. The process for updating the agent differs depending on whether your container instance was launched with the Amazon ECS-optimized AMI or another operating system.

**Note**  
The `UpdateContainerAgent` API isn't supported for container instances using the Amazon ECS-optimized Amazon Linux 2 (arm64) AMI. To update the container agent, you can update the `ecs-init` package. This updates the agent. For more information, see [Updating the Amazon ECS container agent](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/agent-update-ecs-ami.html) in the *Amazon Elastic Container Service Developer Guide*.

**Note**  
Agent updates with the `UpdateContainerAgent` API operation do not apply to Windows container instances. We recommend that you launch new container instances to update the agent version in your Windows clusters.

The `UpdateContainerAgent` API requires an Amazon ECS-optimized AMI or Amazon Linux AMI with the `ecs-init` service installed and running. For help updating the Amazon ECS container agent on other operating systems, see [Manually updating the Amazon ECS container agent](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/ecs-agent-update.html#manually_update_agent) in the *Amazon Elastic Container Service Developer Guide*.

## Request Syntax


```
{
   "cluster": "string",
   "containerInstance": "string"
}
```

## Request Parameters


For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [cluster](#API_UpdateContainerAgent_RequestSyntax) **   <a name="ECS-UpdateContainerAgent-request-cluster"></a>
The short name or full Amazon Resource Name (ARN) of the cluster that your container instance is running on. If you do not specify a cluster, the default cluster is assumed.  
Type: String  
Required: No

 ** [containerInstance](#API_UpdateContainerAgent_RequestSyntax) **   <a name="ECS-UpdateContainerAgent-request-containerInstance"></a>
The container instance ID or full ARN entries for the container instance where you would like to update the Amazon ECS container agent.  
Type: String  
Required: Yes

## Response Syntax


```
{
   "containerInstance": { 
      "agentConnected": boolean,
      "agentUpdateStatus": "string",
      "attachments": [ 
         { 
            "details": [ 
               { 
                  "name": "string",
                  "value": "string"
               }
            ],
            "id": "string",
            "status": "string",
            "type": "string"
         }
      ],
      "attributes": [ 
         { 
            "name": "string",
            "targetId": "string",
            "targetType": "string",
            "value": "string"
         }
      ],
      "capacityProviderName": "string",
      "containerInstanceArn": "string",
      "ec2InstanceId": "string",
      "healthStatus": { 
         "details": [ 
            { 
               "lastStatusChange": number,
               "lastUpdated": number,
               "status": "string",
               "type": "string"
            }
         ],
         "overallStatus": "string"
      },
      "pendingTasksCount": number,
      "registeredAt": number,
      "registeredResources": [ 
         { 
            "doubleValue": number,
            "integerValue": number,
            "longValue": number,
            "name": "string",
            "stringSetValue": [ "string" ],
            "type": "string"
         }
      ],
      "remainingResources": [ 
         { 
            "doubleValue": number,
            "integerValue": number,
            "longValue": number,
            "name": "string",
            "stringSetValue": [ "string" ],
            "type": "string"
         }
      ],
      "runningTasksCount": number,
      "status": "string",
      "statusReason": "string",
      "tags": [ 
         { 
            "key": "string",
            "value": "string"
         }
      ],
      "version": number,
      "versionInfo": { 
         "agentHash": "string",
         "agentVersion": "string",
         "dockerVersion": "string"
      }
   }
}
```

## 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.

 ** [containerInstance](#API_UpdateContainerAgent_ResponseSyntax) **   <a name="ECS-UpdateContainerAgent-response-containerInstance"></a>
The container instance that the container agent was updated for.  
Type: [ContainerInstance](API_ContainerInstance.md) object

## Errors


For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** ClientException **   
These errors are usually caused by a client action. This client action might be using an action or resource on behalf of a user that doesn't have permissions to use the action or resource. Or, it might be specifying an identifier that isn't valid.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ClusterNotFoundException **   
The specified cluster wasn't found. You can view your available clusters with [ListClusters](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_ListClusters.html). Amazon ECS clusters are Region specific.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** InvalidParameterException **   
The specified parameter isn't valid. Review the available parameters for the API request.  
For more information about service event errors, see [Amazon ECS service event messages](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/service-event-messages-list.html).     
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** MissingVersionException **   
Amazon ECS can't determine the current version of the Amazon ECS container agent on the container instance and doesn't have enough information to proceed with an update. This could be because the agent running on the container instance is a previous or custom version that doesn't use our version information.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** NoUpdateAvailableException **   
There's no update available for this Amazon ECS container agent. This might be because the agent is already running the latest version or because it's so old that there's no update path to the current version.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ServerException **   
These errors are usually caused by a server issue.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 500

 ** UpdateInProgressException **   
There's already a current Amazon ECS container agent update in progress on the container instance that's specified. If the container agent becomes disconnected while it's in a transitional stage, such as `PENDING` or `STAGING`, the update process can get stuck in that state. However, when the agent reconnects, it resumes where it stopped previously.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

## Examples


In the following example or examples, the Authorization header contents (`AUTHPARAMS`) must be replaced with an Amazon Signature Version 4 signature. For more information, see [Signature Version 4 Signing Process](https://docs.amazonaws.cn/general/latest/gr/signature-version-4.html) in the * Amazon General Reference*.

You only need to learn how to sign HTTP requests if you intend to create them manually. When you use the [Amazon Command Line Interface](http://www.amazonaws.cn/cli/) or one of the [Amazon SDKs](http://www.amazonaws.cn/tools/) to make requests to Amazon, these tools automatically sign the requests for you, with the access key that you specify when you configure the tools. When you use these tools, you don't have to sign requests yourself.

### Example


This example updates the container agent version for the container instance with the ID `53ac7152-dcd1-4102-81f5-208962864132` in the `update` cluster.

#### Sample Request


```
POST / HTTP/1.1
Host: ecs.us-west-2.amazonaws.com
Accept-Encoding: identity
Content-Length: 82
X-Amz-Target: AmazonEC2ContainerServiceV20141113.UpdateContainerAgent
X-Amz-Date: 20150528T152756Z
User-Agent: aws-cli/1.7.30 Python/2.7.9 Darwin/14.3.0
Content-Type: application/x-amz-json-1.1
Authorization: AUTHPARAMS

{
  "cluster": "update",
  "containerInstance": "53ac7152-dcd1-4102-81f5-208962864132"
}
```

#### Sample Response


```
HTTP/1.1 200 OK
Server: Server
Date: Thu, 28 May 2015 15:27:54 GMT
Content-Type: application/x-amz-json-1.1
Content-Length: 1033
Connection: keep-alive
x-amzn-RequestId: 123a4b56-7c89-01d2-3ef4-example5678f

{
  "containerInstance": {
    "agentConnected": true,
    "agentUpdateStatus": "PENDING",
...
    "versionInfo": {
      "agentHash": "4023248",
      "agentVersion": "1.0.0",
      "dockerVersion": "DockerVersion: 1.5.0"
    }
  }
}
```

## See Also


For more information about using this API in one of the language-specific Amazon SDKs, see the following:
+  [Amazon Command Line Interface V2](https://docs.amazonaws.cn/goto/cli2/ecs-2014-11-13/UpdateContainerAgent) 
+  [Amazon SDK for .NET V4](https://docs.amazonaws.cn/goto/DotNetSDKV4/ecs-2014-11-13/UpdateContainerAgent) 
+  [Amazon SDK for C\$1\$1](https://docs.amazonaws.cn/goto/SdkForCpp/ecs-2014-11-13/UpdateContainerAgent) 
+  [Amazon SDK for Go v2](https://docs.amazonaws.cn/goto/SdkForGoV2/ecs-2014-11-13/UpdateContainerAgent) 
+  [Amazon SDK for Java V2](https://docs.amazonaws.cn/goto/SdkForJavaV2/ecs-2014-11-13/UpdateContainerAgent) 
+  [Amazon SDK for JavaScript V3](https://docs.amazonaws.cn/goto/SdkForJavaScriptV3/ecs-2014-11-13/UpdateContainerAgent) 
+  [Amazon SDK for Kotlin](https://docs.amazonaws.cn/goto/SdkForKotlin/ecs-2014-11-13/UpdateContainerAgent) 
+  [Amazon SDK for PHP V3](https://docs.amazonaws.cn/goto/SdkForPHPV3/ecs-2014-11-13/UpdateContainerAgent) 
+  [Amazon SDK for Python](https://docs.amazonaws.cn/goto/boto3/ecs-2014-11-13/UpdateContainerAgent) 
+  [Amazon SDK for Ruby V3](https://docs.amazonaws.cn/goto/SdkForRubyV3/ecs-2014-11-13/UpdateContainerAgent) 

# UpdateContainerInstancesState


Modifies the status of an Amazon ECS container instance.

Once a container instance has reached an `ACTIVE` state, you can change the status of a container instance to `DRAINING` to manually remove an instance from a cluster, for example to perform system updates, update the Docker daemon, or scale down the cluster size.

**Important**  
A container instance can't be changed to `DRAINING` until it has reached an `ACTIVE` status. If the instance is in any other status, an error will be received.

When you set a container instance to `DRAINING`, Amazon ECS prevents new tasks from being scheduled for placement on the container instance and replacement service tasks are started on other container instances in the cluster if the resources are available. Service tasks on the container instance that are in the `PENDING` state are stopped immediately.

Service tasks on the container instance that are in the `RUNNING` state are stopped and replaced according to the service's deployment configuration parameters, `minimumHealthyPercent` and `maximumPercent`. You can change the deployment configuration of your service using [UpdateService](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_UpdateService.html).
+ If `minimumHealthyPercent` is below 100%, the scheduler can ignore `desiredCount` temporarily during task replacement. For example, `desiredCount` is four tasks, a minimum of 50% allows the scheduler to stop two existing tasks before starting two new tasks. If the minimum is 100%, the service scheduler can't remove existing tasks until the replacement tasks are considered healthy. Tasks for services that do not use a load balancer are considered healthy if they're in the `RUNNING` state. Tasks for services that use a load balancer are considered healthy if they're in the `RUNNING` state and are reported as healthy by the load balancer.
+ The `maximumPercent` parameter represents an upper limit on the number of running tasks during task replacement. You can use this to define the replacement batch size. For example, if `desiredCount` is four tasks, a maximum of 200% starts four new tasks before stopping the four tasks to be drained, provided that the cluster resources required to do this are available. If the maximum is 100%, then replacement tasks can't start until the draining tasks have stopped.

Any `PENDING` or `RUNNING` tasks that do not belong to a service aren't affected. You must wait for them to finish or stop them manually.

A container instance has completed draining when it has no more `RUNNING` tasks. You can verify this using [ListTasks](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_ListTasks.html).

When a container instance has been drained, you can set a container instance to `ACTIVE` status and once it has reached that status the Amazon ECS scheduler can begin scheduling tasks on the instance again.

## Request Syntax


```
{
   "cluster": "string",
   "containerInstances": [ "string" ],
   "status": "string"
}
```

## Request Parameters


For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [cluster](#API_UpdateContainerInstancesState_RequestSyntax) **   <a name="ECS-UpdateContainerInstancesState-request-cluster"></a>
The short name or full Amazon Resource Name (ARN) of the cluster that hosts the container instance to update. If you do not specify a cluster, the default cluster is assumed.  
Type: String  
Required: No

 ** [containerInstances](#API_UpdateContainerInstancesState_RequestSyntax) **   <a name="ECS-UpdateContainerInstancesState-request-containerInstances"></a>
A list of up to 10 container instance IDs or full ARN entries.  
Type: Array of strings  
Required: Yes

 ** [status](#API_UpdateContainerInstancesState_RequestSyntax) **   <a name="ECS-UpdateContainerInstancesState-request-status"></a>
The container instance state to update the container instance with. The only valid values for this action are `ACTIVE` and `DRAINING`. A container instance can only be updated to `DRAINING` status once it has reached an `ACTIVE` state. If a container instance is in `REGISTERING`, `DEREGISTERING`, or `REGISTRATION_FAILED` state you can describe the container instance but can't update the container instance state.  
Type: String  
Valid Values: `ACTIVE | DRAINING | REGISTERING | DEREGISTERING | REGISTRATION_FAILED`   
Required: Yes

## Response Syntax


```
{
   "containerInstances": [ 
      { 
         "agentConnected": boolean,
         "agentUpdateStatus": "string",
         "attachments": [ 
            { 
               "details": [ 
                  { 
                     "name": "string",
                     "value": "string"
                  }
               ],
               "id": "string",
               "status": "string",
               "type": "string"
            }
         ],
         "attributes": [ 
            { 
               "name": "string",
               "targetId": "string",
               "targetType": "string",
               "value": "string"
            }
         ],
         "capacityProviderName": "string",
         "containerInstanceArn": "string",
         "ec2InstanceId": "string",
         "healthStatus": { 
            "details": [ 
               { 
                  "lastStatusChange": number,
                  "lastUpdated": number,
                  "status": "string",
                  "type": "string"
               }
            ],
            "overallStatus": "string"
         },
         "pendingTasksCount": number,
         "registeredAt": number,
         "registeredResources": [ 
            { 
               "doubleValue": number,
               "integerValue": number,
               "longValue": number,
               "name": "string",
               "stringSetValue": [ "string" ],
               "type": "string"
            }
         ],
         "remainingResources": [ 
            { 
               "doubleValue": number,
               "integerValue": number,
               "longValue": number,
               "name": "string",
               "stringSetValue": [ "string" ],
               "type": "string"
            }
         ],
         "runningTasksCount": number,
         "status": "string",
         "statusReason": "string",
         "tags": [ 
            { 
               "key": "string",
               "value": "string"
            }
         ],
         "version": number,
         "versionInfo": { 
            "agentHash": "string",
            "agentVersion": "string",
            "dockerVersion": "string"
         }
      }
   ],
   "failures": [ 
      { 
         "arn": "string",
         "detail": "string",
         "reason": "string"
      }
   ]
}
```

## 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.

 ** [containerInstances](#API_UpdateContainerInstancesState_ResponseSyntax) **   <a name="ECS-UpdateContainerInstancesState-response-containerInstances"></a>
The list of container instances.  
Type: Array of [ContainerInstance](API_ContainerInstance.md) objects

 ** [failures](#API_UpdateContainerInstancesState_ResponseSyntax) **   <a name="ECS-UpdateContainerInstancesState-response-failures"></a>
Any failures associated with the call.  
Type: Array of [Failure](API_Failure.md) objects

## Errors


For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** ClientException **   
These errors are usually caused by a client action. This client action might be using an action or resource on behalf of a user that doesn't have permissions to use the action or resource. Or, it might be specifying an identifier that isn't valid.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ClusterNotFoundException **   
The specified cluster wasn't found. You can view your available clusters with [ListClusters](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_ListClusters.html). Amazon ECS clusters are Region specific.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** InvalidParameterException **   
The specified parameter isn't valid. Review the available parameters for the API request.  
For more information about service event errors, see [Amazon ECS service event messages](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/service-event-messages-list.html).     
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ServerException **   
These errors are usually caused by a server issue.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 500

## Examples


In the following example or examples, the Authorization header contents (`AUTHPARAMS`) must be replaced with an Amazon Signature Version 4 signature. For more information, see [Signature Version 4 Signing Process](https://docs.amazonaws.cn/general/latest/gr/signature-version-4.html) in the * Amazon General Reference*.

You only need to learn how to sign HTTP requests if you intend to create them manually. When you use the [Amazon Command Line Interface](http://www.amazonaws.cn/cli/) or one of the [Amazon SDKs](http://www.amazonaws.cn/tools/) to make requests to Amazon, these tools automatically sign the requests for you, with the access key that you specify when you configure the tools. When you use these tools, you don't have to sign requests yourself.

### Example


This example sets a container instance in the `default` cluster with the ID `1c3be8ed-df30-47b4-8f1e-6e68ebd01f34` to the `DRAINING` status so that it can't receive tasks for placement.

#### Sample Request


```
POST / HTTP/1.1
Host: ecs.us-west-2.amazonaws.com
Accept-Encoding: identity
Content-Length: 114
X-Amz-Target: AmazonEC2ContainerServiceV20141113.UpdateContainerInstancesState
X-Amz-Date: 20161220T221142Z
User-Agent: aws-cli/1.11.31 Python/2.7.12 Darwin/16.3.0 botocore/1.4.88
Content-Type: application/x-amz-json-1.1
Authorization: AUTHPARAMS

{
  "status": "DRAINING",
  "cluster": "default",
  "containerInstances": [
    "1c3be8ed-df30-47b4-8f1e-6e68ebd01f34"
  ]
}
```

#### Sample Response


```
HTTP/1.1 200 OK
Server: Server
Date: Tue, 20 Dec 2016 22:11:42 GMT
Content-Type: application/x-amz-json-1.1
Content-Length: 2344
Connection: keep-alive
x-amzn-RequestId: 49d68928-c701-11e6-8f99-6103d648cdad

{
  "containerInstances": [
    {
      "agentConnected": true,
      "attributes": [
        {
          "name": "ecs.availability-zone",
          "value": "us-west-2b"
        },
        {
          "name": "com.amazonaws.ecs.capability.logging-driver.syslog"
        },
        {
          "name": "ecs.instance-type",
          "value": "c4.xlarge"
        },
        {
          "name": "ecs.ami-id",
          "value": "ami-a2ca61c2"
        },
        {
          "name": "com.amazonaws.ecs.capability.task-iam-role-network-host"
        },
        {
          "name": "com.amazonaws.ecs.capability.logging-driver.awslogs"
        },
        {
          "name": "com.amazonaws.ecs.capability.logging-driver.json-file"
        },
        {
          "name": "com.amazonaws.ecs.capability.docker-remote-api.1.17"
        },
        {
          "name": "com.amazonaws.ecs.capability.privileged-container"
        },
        {
          "name": "com.amazonaws.ecs.capability.docker-remote-api.1.18"
        },
        {
          "name": "com.amazonaws.ecs.capability.docker-remote-api.1.19"
        },
        {
          "name": "com.amazonaws.ecs.capability.ecr-auth"
        },
        {
          "name": "ecs.os-type",
          "value": "linux"
        },
        {
          "name": "com.amazonaws.ecs.capability.docker-remote-api.1.20"
        },
        {
          "name": "com.amazonaws.ecs.capability.docker-remote-api.1.21"
        },
        {
          "name": "com.amazonaws.ecs.capability.docker-remote-api.1.22"
        },
        {
          "name": "com.amazonaws.ecs.capability.task-iam-role"
        },
        {
          "name": "com.amazonaws.ecs.capability.docker-remote-api.1.23"
        }
      ],
      "containerInstanceArn": "arn:aws:ecs:us-west-2:012345678910:container-instance/default/1c3be8ed-df30-47b4-8f1e-6e68ebd01f34",
      "ec2InstanceId": "i-05d99c76955727ec6",
      "pendingTasksCount": 0,
      "registeredResources": [
        {
          "doubleValue": 0,
          "integerValue": 4096,
          "longValue": 0,
          "name": "CPU",
          "type": "INTEGER"
        },
        {
          "doubleValue": 0,
          "integerValue": 7482,
          "longValue": 0,
          "name": "MEMORY",
          "type": "INTEGER"
        },
        {
          "doubleValue": 0,
          "integerValue": 0,
          "longValue": 0,
          "name": "PORTS",
          "stringSetValue": [
            "22",
            "2376",
            "2375",
            "51678",
            "51679"
          ],
          "type": "STRINGSET"
        },
        {
          "doubleValue": 0,
          "integerValue": 0,
          "longValue": 0,
          "name": "PORTS_UDP",
          "stringSetValue": [],
          "type": "STRINGSET"
        }
      ],
      "remainingResources": [
        {
          "doubleValue": 0,
          "integerValue": 4096,
          "longValue": 0,
          "name": "CPU",
          "type": "INTEGER"
        },
        {
          "doubleValue": 0,
          "integerValue": 7482,
          "longValue": 0,
          "name": "MEMORY",
          "type": "INTEGER"
        },
        {
          "doubleValue": 0,
          "integerValue": 0,
          "longValue": 0,
          "name": "PORTS",
          "stringSetValue": [
            "22",
            "2376",
            "2375",
            "51678",
            "51679"
          ],
          "type": "STRINGSET"
        },
        {
          "doubleValue": 0,
          "integerValue": 0,
          "longValue": 0,
          "name": "PORTS_UDP",
          "stringSetValue": [],
          "type": "STRINGSET"
        }
      ],
      "runningTasksCount": 0,
      "status": "DRAINING",
      "version": 30,
      "versionInfo": {
        "agentHash": "efe53c6",
        "agentVersion": "1.13.1",
        "dockerVersion": "DockerVersion: 1.11.2"
      }
    }
  ],
  "failures": []
}
```

## See Also


For more information about using this API in one of the language-specific Amazon SDKs, see the following:
+  [Amazon Command Line Interface V2](https://docs.amazonaws.cn/goto/cli2/ecs-2014-11-13/UpdateContainerInstancesState) 
+  [Amazon SDK for .NET V4](https://docs.amazonaws.cn/goto/DotNetSDKV4/ecs-2014-11-13/UpdateContainerInstancesState) 
+  [Amazon SDK for C\$1\$1](https://docs.amazonaws.cn/goto/SdkForCpp/ecs-2014-11-13/UpdateContainerInstancesState) 
+  [Amazon SDK for Go v2](https://docs.amazonaws.cn/goto/SdkForGoV2/ecs-2014-11-13/UpdateContainerInstancesState) 
+  [Amazon SDK for Java V2](https://docs.amazonaws.cn/goto/SdkForJavaV2/ecs-2014-11-13/UpdateContainerInstancesState) 
+  [Amazon SDK for JavaScript V3](https://docs.amazonaws.cn/goto/SdkForJavaScriptV3/ecs-2014-11-13/UpdateContainerInstancesState) 
+  [Amazon SDK for Kotlin](https://docs.amazonaws.cn/goto/SdkForKotlin/ecs-2014-11-13/UpdateContainerInstancesState) 
+  [Amazon SDK for PHP V3](https://docs.amazonaws.cn/goto/SdkForPHPV3/ecs-2014-11-13/UpdateContainerInstancesState) 
+  [Amazon SDK for Python](https://docs.amazonaws.cn/goto/boto3/ecs-2014-11-13/UpdateContainerInstancesState) 
+  [Amazon SDK for Ruby V3](https://docs.amazonaws.cn/goto/SdkForRubyV3/ecs-2014-11-13/UpdateContainerInstancesState) 

# UpdateDaemon


Updates the specified daemon. When you update a daemon, a new deployment is triggered that progressively rolls out the changes to the container instances associated with the daemon's capacity providers. For more information, see [Daemon deployments](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/daemon-deployments.html) in the *Amazon Elastic Container Service Developer Guide*.

Amazon ECS drains existing container instances and provisions new instances with the updated daemon. Amazon ECS automatically launches replacement tasks for your services.

**Important**  
Updating a daemon triggers a rolling deployment that drains and replaces container instances. Plan updates during maintenance windows to minimize impact on running services.

**Note**  
ECS Managed Daemons is only supported for Amazon ECS Managed Instances Capacity Providers.

## Request Syntax


```
{
   "capacityProviderArns": [ "string" ],
   "daemonArn": "string",
   "daemonTaskDefinitionArn": "string",
   "deploymentConfiguration": { 
      "alarms": { 
         "alarmNames": [ "string" ],
         "enable": boolean
      },
      "bakeTimeInMinutes": number,
      "drainPercent": number
   },
   "enableECSManagedTags": boolean,
   "enableExecuteCommand": boolean,
   "propagateTags": "string"
}
```

## Request Parameters


For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [capacityProviderArns](#API_UpdateDaemon_RequestSyntax) **   <a name="ECS-UpdateDaemon-request-capacityProviderArns"></a>
The Amazon Resource Names (ARNs) of the capacity providers to associate with the daemon.  
Type: Array of strings  
Required: Yes

 ** [daemonArn](#API_UpdateDaemon_RequestSyntax) **   <a name="ECS-UpdateDaemon-request-daemonArn"></a>
The Amazon Resource Name (ARN) of the daemon to update.  
Type: String  
Required: Yes

 ** [daemonTaskDefinitionArn](#API_UpdateDaemon_RequestSyntax) **   <a name="ECS-UpdateDaemon-request-daemonTaskDefinitionArn"></a>
The Amazon Resource Name (ARN) of the daemon task definition to use for the updated daemon.  
Type: String  
Required: Yes

 ** [deploymentConfiguration](#API_UpdateDaemon_RequestSyntax) **   <a name="ECS-UpdateDaemon-request-deploymentConfiguration"></a>
Optional deployment parameters that control how the daemon rolls out updates, including the drain percentage, alarm-based rollback, and bake time.  
Type: [DaemonDeploymentConfiguration](API_DaemonDeploymentConfiguration.md) object  
Required: No

 ** [enableECSManagedTags](#API_UpdateDaemon_RequestSyntax) **   <a name="ECS-UpdateDaemon-request-enableECSManagedTags"></a>
Specifies whether to turn on Amazon ECS managed tags for the tasks in the daemon. For more information, see [Tagging your Amazon ECS resources](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/ecs-using-tags.html) in the *Amazon Elastic Container Service Developer Guide*.  
Type: Boolean  
Required: No

 ** [enableExecuteCommand](#API_UpdateDaemon_RequestSyntax) **   <a name="ECS-UpdateDaemon-request-enableExecuteCommand"></a>
If `true`, the execute command functionality is turned on for all tasks in the daemon. If `false`, the execute command functionality is turned off.  
Type: Boolean  
Required: No

 ** [propagateTags](#API_UpdateDaemon_RequestSyntax) **   <a name="ECS-UpdateDaemon-request-propagateTags"></a>
Specifies whether to propagate the tags from the daemon to the daemon tasks. If you don't specify a value, the tags aren't propagated. You can only propagate tags to daemon tasks during task creation.  
Type: String  
Valid Values: `DAEMON | NONE`   
Required: No

## Response Syntax


```
{
   "createdAt": number,
   "daemonArn": "string",
   "deploymentArn": "string",
   "status": "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.

 ** [createdAt](#API_UpdateDaemon_ResponseSyntax) **   <a name="ECS-UpdateDaemon-response-createdAt"></a>
The Unix timestamp for the time when the daemon was created.  
Type: Timestamp

 ** [daemonArn](#API_UpdateDaemon_ResponseSyntax) **   <a name="ECS-UpdateDaemon-response-daemonArn"></a>
The Amazon Resource Name (ARN) of the daemon.  
Type: String

 ** [deploymentArn](#API_UpdateDaemon_ResponseSyntax) **   <a name="ECS-UpdateDaemon-response-deploymentArn"></a>
The Amazon Resource Name (ARN) of the daemon deployment that was triggered by the update.  
Type: String

 ** [status](#API_UpdateDaemon_ResponseSyntax) **   <a name="ECS-UpdateDaemon-response-status"></a>
The status of the daemon.  
Type: String  
Valid Values: `ACTIVE | DELETE_IN_PROGRESS` 

 ** [updatedAt](#API_UpdateDaemon_ResponseSyntax) **   <a name="ECS-UpdateDaemon-response-updatedAt"></a>
The Unix timestamp for the time when the daemon was last updated.  
Type: Timestamp

## Errors


For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** AccessDeniedException **   
You don't have authorization to perform the requested action.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ClientException **   
These errors are usually caused by a client action. This client action might be using an action or resource on behalf of a user that doesn't have permissions to use the action or resource. Or, it might be specifying an identifier that isn't valid.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ClusterNotFoundException **   
The specified cluster wasn't found. You can view your available clusters with [ListClusters](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_ListClusters.html). Amazon ECS clusters are Region specific.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** DaemonNotActiveException **   
The specified daemon isn't active. You can't update a daemon that's inactive. If you have previously deleted a daemon, you can re-create it with [CreateDaemon](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_CreateDaemon.html).  
HTTP Status Code: 400

 ** DaemonNotFoundException **   
The specified daemon wasn't found. You can view your available daemons with [ListDaemons](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_ListDaemons.html). Amazon ECS daemons are cluster specific and Region specific.  
HTTP Status Code: 400

 ** InvalidParameterException **   
The specified parameter isn't valid. Review the available parameters for the API request.  
For more information about service event errors, see [Amazon ECS service event messages](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/service-event-messages-list.html).     
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** PlatformUnknownException **   
The specified platform version doesn't exist.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ServerException **   
These errors are usually caused by a server issue.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 500

 ** UnsupportedFeatureException **   
The specified task isn't supported in this Region.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

## Examples


In the following example or examples, the Authorization header contents (`AUTHPARAMS`) must be replaced with an Amazon Signature Version 4 signature. For more information, see [Signature Version 4 Signing Process](https://docs.amazonaws.cn/general/latest/gr/signature-version-4.html) in the * Amazon General Reference*.

You only need to learn how to sign HTTP requests if you intend to create them manually. When you use the [Amazon Command Line Interface](http://www.amazonaws.cn/cli/) or one of the [Amazon SDKs](http://www.amazonaws.cn/tools/) to make requests to Amazon, these tools automatically sign the requests for you, with the access key that you specify when you configure the tools. When you use these tools, you don't have to sign requests yourself.

### Example


This example updates the my-monitoring-daemon daemon to use a new daemon task definition revision.

#### Sample Request


```
POST / HTTP/1.1
Host: ecs.us-east-1.amazonaws.com
Accept-Encoding: identity
Content-Length: 405
X-Amz-Target: AmazonEC2ContainerServiceV20141113.UpdateDaemon
X-Amz-Date: 20250320T153000Z
Content-Type: application/x-amz-json-1.1
Authorization: AUTHPARAMS

{
  "daemonArn": "arn:aws:ecs:us-east-1:123456789012:daemon/my-cluster/my-monitoring-daemon",
  "daemonTaskDefinitionArn": "arn:aws:ecs:us-east-1:123456789012:daemon-task-definition/monitoring-agent:2",
  "capacityProviderArns": [
    "arn:aws:ecs:us-east-1:123456789012:capacity-provider/my-capacity-provider"
  ],
  "deploymentConfiguration": {
    "drainPercent": 10.0,
    "bakeTimeInMinutes": 5
  }
}
```

#### Sample Response


```
HTTP/1.1 200 OK
Server: Server
Date: Thu, 20 Mar 2025 15:30:00 GMT
Content-Type: application/x-amz-json-1.1
Content-Length: 326
Connection: keep-alive
x-amzn-RequestId: 123a4b56-7c89-01d2-3ef4-example5678f

{
  "daemonArn": "arn:aws:ecs:us-east-1:123456789012:daemon/my-cluster/my-monitoring-daemon",
  "status": "ACTIVE",
  "createdAt": "2025-03-15T12:00:00.000Z",
  "updatedAt": "2025-03-20T15:30:00.000Z",
  "deploymentArn": "arn:aws:ecs:us-east-1:123456789012:daemon-deployment/my-cluster/my-monitoring-daemon/xY9zA8bC7dE6fG5h"
}
```

## See Also


For more information about using this API in one of the language-specific Amazon SDKs, see the following:
+  [Amazon Command Line Interface V2](https://docs.amazonaws.cn/goto/cli2/ecs-2014-11-13/UpdateDaemon) 
+  [Amazon SDK for .NET V4](https://docs.amazonaws.cn/goto/DotNetSDKV4/ecs-2014-11-13/UpdateDaemon) 
+  [Amazon SDK for C\$1\$1](https://docs.amazonaws.cn/goto/SdkForCpp/ecs-2014-11-13/UpdateDaemon) 
+  [Amazon SDK for Go v2](https://docs.amazonaws.cn/goto/SdkForGoV2/ecs-2014-11-13/UpdateDaemon) 
+  [Amazon SDK for Java V2](https://docs.amazonaws.cn/goto/SdkForJavaV2/ecs-2014-11-13/UpdateDaemon) 
+  [Amazon SDK for JavaScript V3](https://docs.amazonaws.cn/goto/SdkForJavaScriptV3/ecs-2014-11-13/UpdateDaemon) 
+  [Amazon SDK for Kotlin](https://docs.amazonaws.cn/goto/SdkForKotlin/ecs-2014-11-13/UpdateDaemon) 
+  [Amazon SDK for PHP V3](https://docs.amazonaws.cn/goto/SdkForPHPV3/ecs-2014-11-13/UpdateDaemon) 
+  [Amazon SDK for Python](https://docs.amazonaws.cn/goto/boto3/ecs-2014-11-13/UpdateDaemon) 
+  [Amazon SDK for Ruby V3](https://docs.amazonaws.cn/goto/SdkForRubyV3/ecs-2014-11-13/UpdateDaemon) 

# UpdateExpressGatewayService


Updates an existing Express service configuration. Modifies container settings, resource allocation, auto-scaling configuration, and other service parameters without recreating the service.

Amazon ECS creates a new service revision with updated configuration and performs a rolling deployment to replace existing tasks. The service remains available during updates, ensuring zero-downtime deployments.

Some parameters like the infrastructure role cannot be modified after service creation and require creating a new service.

## Request Syntax


```
{
   "cpu": "string",
   "executionRoleArn": "string",
   "healthCheckPath": "string",
   "memory": "string",
   "networkConfiguration": { 
      "securityGroups": [ "string" ],
      "subnets": [ "string" ]
   },
   "primaryContainer": { 
      "awsLogsConfiguration": { 
         "logGroup": "string",
         "logStreamPrefix": "string"
      },
      "command": [ "string" ],
      "containerPort": number,
      "environment": [ 
         { 
            "name": "string",
            "value": "string"
         }
      ],
      "image": "string",
      "repositoryCredentials": { 
         "credentialsParameter": "string"
      },
      "secrets": [ 
         { 
            "name": "string",
            "valueFrom": "string"
         }
      ]
   },
   "scalingTarget": { 
      "autoScalingMetric": "string",
      "autoScalingTargetValue": number,
      "maxTaskCount": number,
      "minTaskCount": number
   },
   "serviceArn": "string",
   "taskRoleArn": "string"
}
```

## Request Parameters


For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [cpu](#API_UpdateExpressGatewayService_RequestSyntax) **   <a name="ECS-UpdateExpressGatewayService-request-cpu"></a>
The number of CPU units used by the task.  
Type: String  
Required: No

 ** [executionRoleArn](#API_UpdateExpressGatewayService_RequestSyntax) **   <a name="ECS-UpdateExpressGatewayService-request-executionRoleArn"></a>
The Amazon Resource Name (ARN) of the task execution role for the Express service.  
Type: String  
Required: No

 ** [healthCheckPath](#API_UpdateExpressGatewayService_RequestSyntax) **   <a name="ECS-UpdateExpressGatewayService-request-healthCheckPath"></a>
The path on the container for Application Load Balancer health checks.  
Type: String  
Required: No

 ** [memory](#API_UpdateExpressGatewayService_RequestSyntax) **   <a name="ECS-UpdateExpressGatewayService-request-memory"></a>
The amount of memory (in MiB) used by the task.  
Type: String  
Required: No

 ** [networkConfiguration](#API_UpdateExpressGatewayService_RequestSyntax) **   <a name="ECS-UpdateExpressGatewayService-request-networkConfiguration"></a>
The network configuration for the Express service tasks. By default, the network configuration for an Express service uses the default VPC.  
Type: [ExpressGatewayServiceNetworkConfiguration](API_ExpressGatewayServiceNetworkConfiguration.md) object  
Required: No

 ** [primaryContainer](#API_UpdateExpressGatewayService_RequestSyntax) **   <a name="ECS-UpdateExpressGatewayService-request-primaryContainer"></a>
The primary container configuration for the Express service.  
Type: [ExpressGatewayContainer](API_ExpressGatewayContainer.md) object  
Required: No

 ** [scalingTarget](#API_UpdateExpressGatewayService_RequestSyntax) **   <a name="ECS-UpdateExpressGatewayService-request-scalingTarget"></a>
The auto-scaling configuration for the Express service.  
Type: [ExpressGatewayScalingTarget](API_ExpressGatewayScalingTarget.md) object  
Required: No

 ** [serviceArn](#API_UpdateExpressGatewayService_RequestSyntax) **   <a name="ECS-UpdateExpressGatewayService-request-serviceArn"></a>
The Amazon Resource Name (ARN) of the Express service to update.  
Type: String  
Required: Yes

 ** [taskRoleArn](#API_UpdateExpressGatewayService_RequestSyntax) **   <a name="ECS-UpdateExpressGatewayService-request-taskRoleArn"></a>
The Amazon Resource Name (ARN) of the IAM role for containers in this task.  
Type: String  
Required: No

## Response Syntax


```
{
   "service": { 
      "cluster": "string",
      "createdAt": number,
      "serviceArn": "string",
      "serviceName": "string",
      "status": { 
         "statusCode": "string",
         "statusReason": "string"
      },
      "targetConfiguration": { 
         "cpu": "string",
         "createdAt": number,
         "executionRoleArn": "string",
         "healthCheckPath": "string",
         "ingressPaths": [ 
            { 
               "accessType": "string",
               "endpoint": "string"
            }
         ],
         "memory": "string",
         "networkConfiguration": { 
            "securityGroups": [ "string" ],
            "subnets": [ "string" ]
         },
         "primaryContainer": { 
            "awsLogsConfiguration": { 
               "logGroup": "string",
               "logStreamPrefix": "string"
            },
            "command": [ "string" ],
            "containerPort": number,
            "environment": [ 
               { 
                  "name": "string",
                  "value": "string"
               }
            ],
            "image": "string",
            "repositoryCredentials": { 
               "credentialsParameter": "string"
            },
            "secrets": [ 
               { 
                  "name": "string",
                  "valueFrom": "string"
               }
            ]
         },
         "scalingTarget": { 
            "autoScalingMetric": "string",
            "autoScalingTargetValue": number,
            "maxTaskCount": number,
            "minTaskCount": number
         },
         "serviceRevisionArn": "string",
         "taskRoleArn": "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.

 ** [service](#API_UpdateExpressGatewayService_ResponseSyntax) **   <a name="ECS-UpdateExpressGatewayService-response-service"></a>
The full description of your express gateway service following the update call.  
Type: [UpdatedExpressGatewayService](API_UpdatedExpressGatewayService.md) object

## Errors


For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** AccessDeniedException **   
You don't have authorization to perform the requested action.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ClientException **   
These errors are usually caused by a client action. This client action might be using an action or resource on behalf of a user that doesn't have permissions to use the action or resource. Or, it might be specifying an identifier that isn't valid.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ClusterNotFoundException **   
The specified cluster wasn't found. You can view your available clusters with [ListClusters](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_ListClusters.html). Amazon ECS clusters are Region specific.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** InvalidParameterException **   
The specified parameter isn't valid. Review the available parameters for the API request.  
For more information about service event errors, see [Amazon ECS service event messages](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/service-event-messages-list.html).     
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ServerException **   
These errors are usually caused by a server issue.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 500

 ** ServiceNotActiveException **   
The specified service isn't active. You can't update a service that's inactive. If you have previously deleted a service, you can re-create it with [CreateService](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_CreateService.html).    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ServiceNotFoundException **   
The specified service wasn't found. You can view your available services with [ListServices](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_ListServices.html). Amazon ECS services are cluster specific and Region specific.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** UnsupportedFeatureException **   
The specified task isn't supported in this Region.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

## See Also


For more information about using this API in one of the language-specific Amazon SDKs, see the following:
+  [Amazon Command Line Interface V2](https://docs.amazonaws.cn/goto/cli2/ecs-2014-11-13/UpdateExpressGatewayService) 
+  [Amazon SDK for .NET V4](https://docs.amazonaws.cn/goto/DotNetSDKV4/ecs-2014-11-13/UpdateExpressGatewayService) 
+  [Amazon SDK for C\$1\$1](https://docs.amazonaws.cn/goto/SdkForCpp/ecs-2014-11-13/UpdateExpressGatewayService) 
+  [Amazon SDK for Go v2](https://docs.amazonaws.cn/goto/SdkForGoV2/ecs-2014-11-13/UpdateExpressGatewayService) 
+  [Amazon SDK for Java V2](https://docs.amazonaws.cn/goto/SdkForJavaV2/ecs-2014-11-13/UpdateExpressGatewayService) 
+  [Amazon SDK for JavaScript V3](https://docs.amazonaws.cn/goto/SdkForJavaScriptV3/ecs-2014-11-13/UpdateExpressGatewayService) 
+  [Amazon SDK for Kotlin](https://docs.amazonaws.cn/goto/SdkForKotlin/ecs-2014-11-13/UpdateExpressGatewayService) 
+  [Amazon SDK for PHP V3](https://docs.amazonaws.cn/goto/SdkForPHPV3/ecs-2014-11-13/UpdateExpressGatewayService) 
+  [Amazon SDK for Python](https://docs.amazonaws.cn/goto/boto3/ecs-2014-11-13/UpdateExpressGatewayService) 
+  [Amazon SDK for Ruby V3](https://docs.amazonaws.cn/goto/SdkForRubyV3/ecs-2014-11-13/UpdateExpressGatewayService) 

# UpdateService


Modifies the parameters of a service.

**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 services using the rolling update (`ECS`) you can update the desired count, deployment configuration, network configuration, load balancers, service registries, enable ECS managed tags option, propagate tags option, task placement constraints and strategies, and task definition. When you update any of these parameters, Amazon ECS starts new tasks with the new configuration. 

You can attach Amazon EBS volumes to Amazon ECS tasks by configuring the volume when starting or running a task, or when creating or updating a service. For more information, see [Amazon EBS volumes](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/ebs-volumes.html#ebs-volume-types) in the *Amazon Elastic Container Service Developer Guide*. You can update your volume configurations and trigger a new deployment. `volumeConfigurations` is only supported for REPLICA service and not DAEMON service. If you leave `volumeConfigurations` `null`, it doesn't trigger a new deployment. For more information on volumes, see [Amazon EBS volumes](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/ebs-volumes.html#ebs-volume-types) in the *Amazon Elastic Container Service Developer Guide*.

For services using the blue/green (`CODE_DEPLOY`) deployment controller, only the desired count, deployment configuration, health check grace period, task placement constraints and strategies, enable ECS managed tags option, and propagate tags can be updated using this API. If the network configuration, platform version, task definition, or load balancer need to be updated, create a new Amazon CodeDeploy deployment. For more information, see [CreateDeployment](https://docs.amazonaws.cn/codedeploy/latest/APIReference/API_CreateDeployment.html) in the * Amazon CodeDeploy API Reference*.

For services using an external deployment controller, you can update only the desired count, task placement constraints and strategies, health check grace period, enable ECS managed tags option, and propagate tags option, using this API. If the launch type, load balancer, network configuration, platform version, or task definition need to be updated, create a new task set For more information, see [CreateTaskSet](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_CreateTaskSet.html).

You can add to or subtract from the number of instantiations of a task definition in a service by specifying the cluster that the service is running in and a new `desiredCount` parameter.

You can attach Amazon EBS volumes to Amazon ECS tasks by configuring the volume when starting or running a task, or when creating or updating a service. For more information, see [Amazon EBS volumes](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/ebs-volumes.html#ebs-volume-types) in the *Amazon Elastic Container Service Developer Guide*.

If you have updated the container image of your application, you can create a new task definition with that image and deploy it to your service. The service scheduler uses the minimum healthy percent and maximum percent parameters (in the service's deployment configuration) to determine the deployment strategy.

**Note**  
If your updated Docker image uses the same tag as what is in the existing task definition for your service (for example, `my_image:latest`), you don't need to create a new revision of your task definition. You can update the service using the `forceNewDeployment` option. The new tasks launched by the deployment pull the current image/tag combination from your repository when they start.

You can also update the deployment configuration of a service. When a deployment is triggered by updating the task definition of a service, the service scheduler uses the deployment configuration parameters, `minimumHealthyPercent` and `maximumPercent`, to determine the deployment strategy.
+ If `minimumHealthyPercent` is below 100%, the scheduler can ignore `desiredCount` temporarily during a deployment. For example, if `desiredCount` is four tasks, a minimum of 50% allows the scheduler to stop two existing tasks before starting two new tasks. Tasks for services that don't use a load balancer are considered healthy if they're in the `RUNNING` state. Tasks for services that use a load balancer are considered healthy if they're in the `RUNNING` state and are reported as healthy by the load balancer.
+ The `maximumPercent` parameter represents an upper limit on the number of running tasks during a deployment. You can use it to define the deployment batch size. For example, if `desiredCount` is four tasks, a maximum of 200% starts four new tasks before stopping the four older tasks (provided that the cluster resources required to do this are available).

When [UpdateService](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_UpdateService.html) stops a task during a deployment, the equivalent of `docker stop` is issued to the containers running in the task. This results in a `SIGTERM` and a 30-second timeout. After this, `SIGKILL` is sent and the containers are forcibly stopped. If the container handles the `SIGTERM` gracefully and exits within 30 seconds from receiving it, no `SIGKILL` is sent.

When the service scheduler launches new tasks, it determines task placement in your cluster with the following logic.
+ Determine which of the container instances in your cluster can support your service's task definition. For example, they have the required CPU, memory, ports, and container instance attributes.
+ By default, the service scheduler attempts to balance tasks across Availability Zones in this manner even though you can choose a different placement strategy.
  + Sort the valid container instances by the fewest number of running tasks for this service in the same Availability Zone as the instance. For example, if zone A has one running service task and zones B and C each have zero, valid container instances in either zone B or C are considered optimal for placement.
  + Place the new service task on a valid container instance in an optimal Availability Zone (based on the previous steps), favoring container instances with the fewest number of running tasks for this service.

When the service scheduler stops running tasks, it attempts to maintain balance across the Availability Zones in your cluster using the following logic: 
+ Sort the container instances by the largest number of running tasks for this service in the same Availability Zone as the instance. For example, if zone A has one running service task and zones B and C each have two, container instances in either zone B or C are considered optimal for termination.
+ Stop the task on a container instance in an optimal Availability Zone (based on the previous steps), favoring container instances with the largest number of running tasks for this service.

## Request Syntax


```
{
   "availabilityZoneRebalancing": "string",
   "capacityProviderStrategy": [ 
      { 
         "base": number,
         "capacityProvider": "string",
         "weight": number
      }
   ],
   "cluster": "string",
   "deploymentConfiguration": { 
      "alarms": { 
         "alarmNames": [ "string" ],
         "enable": boolean,
         "rollback": boolean
      },
      "bakeTimeInMinutes": number,
      "canaryConfiguration": { 
         "canaryBakeTimeInMinutes": number,
         "canaryPercent": number
      },
      "deploymentCircuitBreaker": { 
         "enable": boolean,
         "rollback": boolean
      },
      "lifecycleHooks": [ 
         { 
            "hookDetails": JSON value,
            "hookTargetArn": "string",
            "lifecycleStages": [ "string" ],
            "roleArn": "string"
         }
      ],
      "linearConfiguration": { 
         "stepBakeTimeInMinutes": number,
         "stepPercent": number
      },
      "maximumPercent": number,
      "minimumHealthyPercent": number,
      "strategy": "string"
   },
   "deploymentController": { 
      "type": "string"
   },
   "desiredCount": number,
   "enableECSManagedTags": boolean,
   "enableExecuteCommand": boolean,
   "forceNewDeployment": boolean,
   "healthCheckGracePeriodSeconds": number,
   "loadBalancers": [ 
      { 
         "advancedConfiguration": { 
            "alternateTargetGroupArn": "string",
            "productionListenerRule": "string",
            "roleArn": "string",
            "testListenerRule": "string"
         },
         "containerName": "string",
         "containerPort": number,
         "loadBalancerName": "string",
         "targetGroupArn": "string"
      }
   ],
   "networkConfiguration": { 
      "awsvpcConfiguration": { 
         "assignPublicIp": "string",
         "securityGroups": [ "string" ],
         "subnets": [ "string" ]
      }
   },
   "placementConstraints": [ 
      { 
         "expression": "string",
         "type": "string"
      }
   ],
   "placementStrategy": [ 
      { 
         "field": "string",
         "type": "string"
      }
   ],
   "platformVersion": "string",
   "propagateTags": "string",
   "service": "string",
   "serviceConnectConfiguration": { 
      "accessLogConfiguration": { 
         "format": "string",
         "includeQueryParameters": "string"
      },
      "enabled": boolean,
      "logConfiguration": { 
         "logDriver": "string",
         "options": { 
            "string" : "string" 
         },
         "secretOptions": [ 
            { 
               "name": "string",
               "valueFrom": "string"
            }
         ]
      },
      "namespace": "string",
      "services": [ 
         { 
            "clientAliases": [ 
               { 
                  "dnsName": "string",
                  "port": number,
                  "testTrafficRules": { 
                     "header": { 
                        "name": "string",
                        "value": { 
                           "exact": "string"
                        }
                     }
                  }
               }
            ],
            "discoveryName": "string",
            "ingressPortOverride": number,
            "portName": "string",
            "timeout": { 
               "idleTimeoutSeconds": number,
               "perRequestTimeoutSeconds": number
            },
            "tls": { 
               "issuerCertificateAuthority": { 
                  "awsPcaAuthorityArn": "string"
               },
               "kmsKey": "string",
               "roleArn": "string"
            }
         }
      ]
   },
   "serviceRegistries": [ 
      { 
         "containerName": "string",
         "containerPort": number,
         "port": number,
         "registryArn": "string"
      }
   ],
   "taskDefinition": "string",
   "volumeConfigurations": [ 
      { 
         "managedEBSVolume": { 
            "encrypted": boolean,
            "filesystemType": "string",
            "iops": number,
            "kmsKeyId": "string",
            "roleArn": "string",
            "sizeInGiB": number,
            "snapshotId": "string",
            "tagSpecifications": [ 
               { 
                  "propagateTags": "string",
                  "resourceType": "string",
                  "tags": [ 
                     { 
                        "key": "string",
                        "value": "string"
                     }
                  ]
               }
            ],
            "throughput": number,
            "volumeInitializationRate": number,
            "volumeType": "string"
         },
         "name": "string"
      }
   ],
   "vpcLatticeConfigurations": [ 
      { 
         "portName": "string",
         "roleArn": "string",
         "targetGroupArn": "string"
      }
   ]
}
```

## Request Parameters


For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [availabilityZoneRebalancing](#API_UpdateService_RequestSyntax) **   <a name="ECS-UpdateService-request-availabilityZoneRebalancing"></a>
Indicates whether to use Availability Zone rebalancing for the service.  
For more information, see [Balancing an Amazon ECS service across Availability Zones](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/service-rebalancing.html) in the * *Amazon Elastic Container Service Developer Guide* *.  
The default behavior of `AvailabilityZoneRebalancing` differs between create and update requests:  
+ For create service requests, when no value is specified for `AvailabilityZoneRebalancing`, Amazon ECS defaults the value to `ENABLED`.
+ For update service requests, when no value is specified for `AvailabilityZoneRebalancing`, Amazon ECS defaults to the existing service’s `AvailabilityZoneRebalancing` value. If the service never had an `AvailabilityZoneRebalancing` value set, Amazon ECS treats this as `DISABLED`.
This parameter doesn't trigger a new service deployment.  
Type: String  
Valid Values: `ENABLED | DISABLED`   
Required: No

 ** [capacityProviderStrategy](#API_UpdateService_RequestSyntax) **   <a name="ECS-UpdateService-request-capacityProviderStrategy"></a>
The details of a capacity provider strategy. You can set a capacity provider when you create a cluster, run a task, or update a service.  
If you want to use Amazon ECS Managed Instances, you must use the `capacityProviderStrategy` request parameter.
When you use Fargate, the capacity providers are `FARGATE` or `FARGATE_SPOT`.  
When you use Amazon EC2, the capacity providers are Auto Scaling groups.  
You can change capacity providers for rolling deployments and blue/green deployments.  
The following list provides the valid transitions:  
+ Update the Fargate launch type to an Auto Scaling group capacity provider.
+ Update the Amazon EC2 launch type to a Fargate capacity provider.
+ Update the Fargate capacity provider to an Auto Scaling group capacity provider.
+ Update the Amazon EC2 capacity provider to a Fargate capacity provider. 
+ Update the Auto Scaling group or Fargate capacity provider back to the launch type.

  Pass an empty list in the `capacityProviderStrategy` parameter.
For information about Amazon CDK considerations, see [Amazon CDK considerations](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/update-service-parameters.html).  
This parameter doesn't trigger a new service deployment.  
Type: Array of [CapacityProviderStrategyItem](API_CapacityProviderStrategyItem.md) objects  
Required: No

 ** [cluster](#API_UpdateService_RequestSyntax) **   <a name="ECS-UpdateService-request-cluster"></a>
The short name or full Amazon Resource Name (ARN) of the cluster that your service runs on. If you do not specify a cluster, the default cluster is assumed.  
You can't change the cluster name.  
Type: String  
Required: No

 ** [deploymentConfiguration](#API_UpdateService_RequestSyntax) **   <a name="ECS-UpdateService-request-deploymentConfiguration"></a>
Optional deployment parameters that control how many tasks run during the deployment and the ordering of stopping and starting tasks.  
This parameter doesn't trigger a new service deployment.  
Type: [DeploymentConfiguration](API_DeploymentConfiguration.md) object  
Required: No

 ** [deploymentController](#API_UpdateService_RequestSyntax) **   <a name="ECS-UpdateService-request-deploymentController"></a>
The deployment controller to use for the service.   
Type: [DeploymentController](API_DeploymentController.md) object  
Required: No

 ** [desiredCount](#API_UpdateService_RequestSyntax) **   <a name="ECS-UpdateService-request-desiredCount"></a>
The number of instantiations of the task to place and keep running in your service.  
This parameter doesn't trigger a new service deployment.  
Type: Integer  
Required: No

 ** [enableECSManagedTags](#API_UpdateService_RequestSyntax) **   <a name="ECS-UpdateService-request-enableECSManagedTags"></a>
Determines whether to turn on Amazon ECS managed tags for the tasks in the service. For more information, see [Tagging Your Amazon ECS Resources](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/ecs-using-tags.html) in the *Amazon Elastic Container Service Developer Guide*.  
Only tasks launched after the update will reflect the update. To update the tags on all tasks, set `forceNewDeployment` to `true`, so that Amazon ECS starts new tasks with the updated tags.  
This parameter doesn't trigger a new service deployment.  
Type: Boolean  
Required: No

 ** [enableExecuteCommand](#API_UpdateService_RequestSyntax) **   <a name="ECS-UpdateService-request-enableExecuteCommand"></a>
If `true`, this enables execute command functionality on all task containers.  
If you do not want to override the value that was set when the service was created, you can set this to `null` when performing this action.  
This parameter doesn't trigger a new service deployment.  
Type: Boolean  
Required: No

 ** [forceNewDeployment](#API_UpdateService_RequestSyntax) **   <a name="ECS-UpdateService-request-forceNewDeployment"></a>
Determines whether to force a new deployment of the service. By default, deployments aren't forced. You can use this option to start a new deployment with no service definition changes. For example, you can update a service's tasks to use a newer Docker image with the same image/tag combination (`my_image:latest`) or to roll Fargate tasks onto a newer platform version.  
Type: Boolean  
Required: No

 ** [healthCheckGracePeriodSeconds](#API_UpdateService_RequestSyntax) **   <a name="ECS-UpdateService-request-healthCheckGracePeriodSeconds"></a>
The period of time, in seconds, that the Amazon ECS service scheduler ignores unhealthy Elastic Load Balancing, VPC Lattice, and container health checks after a task has first started. If you don't specify a health check grace period value, the default value of `0` is used. If you don't use any of the health checks, then `healthCheckGracePeriodSeconds` is unused.  
If your service's tasks take a while to start and respond to health checks, you can specify a health check grace period of up to 2,147,483,647 seconds (about 69 years). During that time, the Amazon ECS service scheduler ignores health check status. This grace period can prevent the service scheduler from marking tasks as unhealthy and stopping them before they have time to come up.  
If your service has more running tasks than desired, unhealthy tasks in the grace period might be stopped to reach the desired count.  
This parameter doesn't trigger a new service deployment.  
Type: Integer  
Required: No

 ** [loadBalancers](#API_UpdateService_RequestSyntax) **   <a name="ECS-UpdateService-request-loadBalancers"></a>
You must have a service-linked role when you update this property
A list of Elastic Load Balancing load balancer objects. It contains the load balancer name, the container name, and the container port to access from the load balancer. The container name is as it appears in a container definition.  
When you add, update, or remove a load balancer configuration, Amazon ECS starts new tasks with the updated Elastic Load Balancing configuration, and then stops the old tasks when the new tasks are running.  
For services that use rolling updates, you can add, update, or remove Elastic Load Balancing target groups. You can update from a single target group to multiple target groups and from multiple target groups to a single target group.  
For services that use blue/green deployments, you can update Elastic Load Balancing target groups by using ` [CreateDeployment](https://docs.amazonaws.cn/codedeploy/latest/APIReference/API_CreateDeployment.html) ` through Amazon CodeDeploy. Note that multiple target groups are not supported for blue/green deployments. For more information see [Register multiple target groups with a service](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/register-multiple-targetgroups.html) in the *Amazon Elastic Container Service Developer Guide*.   
For services that use the external deployment controller, you can add, update, or remove load balancers by using [CreateTaskSet](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_CreateTaskSet.html). Note that multiple target groups are not supported for external deployments. For more information see [Register multiple target groups with a service](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/register-multiple-targetgroups.html) in the *Amazon Elastic Container Service Developer Guide*.   
You can remove existing `loadBalancers` by passing an empty list.  
This parameter triggers a new service deployment.  
Type: Array of [LoadBalancer](API_LoadBalancer.md) objects  
Required: No

 ** [networkConfiguration](#API_UpdateService_RequestSyntax) **   <a name="ECS-UpdateService-request-networkConfiguration"></a>
An object representing the network configuration for the service.  
This parameter triggers a new service deployment.  
Type: [NetworkConfiguration](API_NetworkConfiguration.md) object  
Required: No

 ** [placementConstraints](#API_UpdateService_RequestSyntax) **   <a name="ECS-UpdateService-request-placementConstraints"></a>
An array of task placement constraint objects to update the service to use. If no value is specified, the existing placement constraints for the service will remain unchanged. If this value is specified, it will override any existing placement constraints defined for the service. To remove all existing placement constraints, specify an empty array.  
You can specify a maximum of 10 constraints for each task. This limit includes constraints in the task definition and those specified at runtime.  
This parameter doesn't trigger a new service deployment.  
Type: Array of [PlacementConstraint](API_PlacementConstraint.md) objects  
Required: No

 ** [placementStrategy](#API_UpdateService_RequestSyntax) **   <a name="ECS-UpdateService-request-placementStrategy"></a>
The task placement strategy objects to update the service to use. If no value is specified, the existing placement strategy for the service will remain unchanged. If this value is specified, it will override the existing placement strategy defined for the service. To remove an existing placement strategy, specify an empty object.  
You can specify a maximum of five strategy rules for each service.  
This parameter doesn't trigger a new service deployment.  
Type: Array of [PlacementStrategy](API_PlacementStrategy.md) objects  
Required: No

 ** [platformVersion](#API_UpdateService_RequestSyntax) **   <a name="ECS-UpdateService-request-platformVersion"></a>
The platform version that your tasks in the service run on. A platform version is only specified for tasks using the Fargate launch type. If a platform version is not specified, the `LATEST` platform version is used. For more information, see [Amazon Fargate Platform Versions](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/platform_versions.html) in the *Amazon Elastic Container Service Developer Guide*.  
This parameter triggers a new service deployment.  
Type: String  
Required: No

 ** [propagateTags](#API_UpdateService_RequestSyntax) **   <a name="ECS-UpdateService-request-propagateTags"></a>
Determines 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.  
Only tasks launched after the update will reflect the update. To update the tags on all tasks, set `forceNewDeployment` to `true`, so that Amazon ECS starts new tasks with the updated tags.  
This parameter doesn't trigger a new service deployment.  
Type: String  
Valid Values: `TASK_DEFINITION | SERVICE | NONE`   
Required: No

 ** [service](#API_UpdateService_RequestSyntax) **   <a name="ECS-UpdateService-request-service"></a>
The name of the service to update.  
Type: String  
Required: Yes

 ** [serviceConnectConfiguration](#API_UpdateService_RequestSyntax) **   <a name="ECS-UpdateService-request-serviceConnectConfiguration"></a>
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](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/service-connect.html) in the *Amazon Elastic Container Service Developer Guide*.  
This parameter triggers a new service deployment.  
Type: [ServiceConnectConfiguration](API_ServiceConnectConfiguration.md) object  
Required: No

 ** [serviceRegistries](#API_UpdateService_RequestSyntax) **   <a name="ECS-UpdateService-request-serviceRegistries"></a>
You must have a service-linked role when you update this property.  
For more information about the role see the `CreateService` request parameter [https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_CreateService.html#ECS-CreateService-request-role](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_CreateService.html#ECS-CreateService-request-role). 
The details for the service discovery registries to assign to this service. For more information, see [Service Discovery](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/service-discovery.html).  
When you add, update, or remove the service registries configuration, Amazon ECS starts new tasks with the updated service registries configuration, and then stops the old tasks when the new tasks are running.  
You can remove existing `serviceRegistries` by passing an empty list.  
This parameter triggers a new service deployment.  
Type: Array of [ServiceRegistry](API_ServiceRegistry.md) objects  
Required: No

 ** [taskDefinition](#API_UpdateService_RequestSyntax) **   <a name="ECS-UpdateService-request-taskDefinition"></a>
The `family` and `revision` (`family:revision`) or full ARN of the task definition to run in your service. If a `revision` is not specified, the latest `ACTIVE` revision is used. If you modify the task definition with `UpdateService`, Amazon ECS spawns a task with the new version of the task definition and then stops an old task after the new version is running.  
This parameter triggers a new service deployment.  
Type: String  
Required: No

 ** [volumeConfigurations](#API_UpdateService_RequestSyntax) **   <a name="ECS-UpdateService-request-volumeConfigurations"></a>
The details of the volume that was `configuredAtLaunch`. You can configure the size, volumeType, IOPS, throughput, snapshot and encryption in [ServiceManagedEBSVolumeConfiguration](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_ServiceManagedEBSVolumeConfiguration.html). The `name` of the volume must match the `name` from the task definition. If set to null, no new deployment is triggered. Otherwise, if this configuration differs from the existing one, it triggers a new deployment.  
This parameter triggers a new service deployment.  
Type: Array of [ServiceVolumeConfiguration](API_ServiceVolumeConfiguration.md) objects  
Required: No

 ** [vpcLatticeConfigurations](#API_UpdateService_RequestSyntax) **   <a name="ECS-UpdateService-request-vpcLatticeConfigurations"></a>
An object representing the VPC Lattice configuration for the service being updated.  
This parameter triggers a new service deployment.  
Type: Array of [VpcLatticeConfiguration](API_VpcLatticeConfiguration.md) objects  
Required: No

## Response Syntax


```
{
   "service": { 
      "availabilityZoneRebalancing": "string",
      "capacityProviderStrategy": [ 
         { 
            "base": number,
            "capacityProvider": "string",
            "weight": number
         }
      ],
      "clusterArn": "string",
      "createdAt": number,
      "createdBy": "string",
      "currentServiceDeployment": "string",
      "currentServiceRevisions": [ 
         { 
            "arn": "string",
            "pendingTaskCount": number,
            "requestedTaskCount": number,
            "runningTaskCount": number
         }
      ],
      "deploymentConfiguration": { 
         "alarms": { 
            "alarmNames": [ "string" ],
            "enable": boolean,
            "rollback": boolean
         },
         "bakeTimeInMinutes": number,
         "canaryConfiguration": { 
            "canaryBakeTimeInMinutes": number,
            "canaryPercent": number
         },
         "deploymentCircuitBreaker": { 
            "enable": boolean,
            "rollback": boolean
         },
         "lifecycleHooks": [ 
            { 
               "hookDetails": JSON value,
               "hookTargetArn": "string",
               "lifecycleStages": [ "string" ],
               "roleArn": "string"
            }
         ],
         "linearConfiguration": { 
            "stepBakeTimeInMinutes": number,
            "stepPercent": number
         },
         "maximumPercent": number,
         "minimumHealthyPercent": number,
         "strategy": "string"
      },
      "deploymentController": { 
         "type": "string"
      },
      "deployments": [ 
         { 
            "capacityProviderStrategy": [ 
               { 
                  "base": number,
                  "capacityProvider": "string",
                  "weight": number
               }
            ],
            "createdAt": number,
            "desiredCount": number,
            "failedTasks": number,
            "fargateEphemeralStorage": { 
               "kmsKeyId": "string"
            },
            "id": "string",
            "launchType": "string",
            "networkConfiguration": { 
               "awsvpcConfiguration": { 
                  "assignPublicIp": "string",
                  "securityGroups": [ "string" ],
                  "subnets": [ "string" ]
               }
            },
            "pendingCount": number,
            "platformFamily": "string",
            "platformVersion": "string",
            "rolloutState": "string",
            "rolloutStateReason": "string",
            "runningCount": number,
            "serviceConnectConfiguration": { 
               "accessLogConfiguration": { 
                  "format": "string",
                  "includeQueryParameters": "string"
               },
               "enabled": boolean,
               "logConfiguration": { 
                  "logDriver": "string",
                  "options": { 
                     "string" : "string" 
                  },
                  "secretOptions": [ 
                     { 
                        "name": "string",
                        "valueFrom": "string"
                     }
                  ]
               },
               "namespace": "string",
               "services": [ 
                  { 
                     "clientAliases": [ 
                        { 
                           "dnsName": "string",
                           "port": number,
                           "testTrafficRules": { 
                              "header": { 
                                 "name": "string",
                                 "value": { 
                                    "exact": "string"
                                 }
                              }
                           }
                        }
                     ],
                     "discoveryName": "string",
                     "ingressPortOverride": number,
                     "portName": "string",
                     "timeout": { 
                        "idleTimeoutSeconds": number,
                        "perRequestTimeoutSeconds": number
                     },
                     "tls": { 
                        "issuerCertificateAuthority": { 
                           "awsPcaAuthorityArn": "string"
                        },
                        "kmsKey": "string",
                        "roleArn": "string"
                     }
                  }
               ]
            },
            "serviceConnectResources": [ 
               { 
                  "discoveryArn": "string",
                  "discoveryName": "string"
               }
            ],
            "status": "string",
            "taskDefinition": "string",
            "updatedAt": number,
            "volumeConfigurations": [ 
               { 
                  "managedEBSVolume": { 
                     "encrypted": boolean,
                     "filesystemType": "string",
                     "iops": number,
                     "kmsKeyId": "string",
                     "roleArn": "string",
                     "sizeInGiB": number,
                     "snapshotId": "string",
                     "tagSpecifications": [ 
                        { 
                           "propagateTags": "string",
                           "resourceType": "string",
                           "tags": [ 
                              { 
                                 "key": "string",
                                 "value": "string"
                              }
                           ]
                        }
                     ],
                     "throughput": number,
                     "volumeInitializationRate": number,
                     "volumeType": "string"
                  },
                  "name": "string"
               }
            ],
            "vpcLatticeConfigurations": [ 
               { 
                  "portName": "string",
                  "roleArn": "string",
                  "targetGroupArn": "string"
               }
            ]
         }
      ],
      "desiredCount": number,
      "enableECSManagedTags": boolean,
      "enableExecuteCommand": boolean,
      "events": [ 
         { 
            "createdAt": number,
            "id": "string",
            "message": "string"
         }
      ],
      "healthCheckGracePeriodSeconds": number,
      "launchType": "string",
      "loadBalancers": [ 
         { 
            "advancedConfiguration": { 
               "alternateTargetGroupArn": "string",
               "productionListenerRule": "string",
               "roleArn": "string",
               "testListenerRule": "string"
            },
            "containerName": "string",
            "containerPort": number,
            "loadBalancerName": "string",
            "targetGroupArn": "string"
         }
      ],
      "networkConfiguration": { 
         "awsvpcConfiguration": { 
            "assignPublicIp": "string",
            "securityGroups": [ "string" ],
            "subnets": [ "string" ]
         }
      },
      "pendingCount": number,
      "placementConstraints": [ 
         { 
            "expression": "string",
            "type": "string"
         }
      ],
      "placementStrategy": [ 
         { 
            "field": "string",
            "type": "string"
         }
      ],
      "platformFamily": "string",
      "platformVersion": "string",
      "propagateTags": "string",
      "resourceManagementType": "string",
      "roleArn": "string",
      "runningCount": number,
      "schedulingStrategy": "string",
      "serviceArn": "string",
      "serviceName": "string",
      "serviceRegistries": [ 
         { 
            "containerName": "string",
            "containerPort": number,
            "port": number,
            "registryArn": "string"
         }
      ],
      "status": "string",
      "tags": [ 
         { 
            "key": "string",
            "value": "string"
         }
      ],
      "taskDefinition": "string",
      "taskSets": [ 
         { 
            "capacityProviderStrategy": [ 
               { 
                  "base": number,
                  "capacityProvider": "string",
                  "weight": number
               }
            ],
            "clusterArn": "string",
            "computedDesiredCount": number,
            "createdAt": number,
            "externalId": "string",
            "fargateEphemeralStorage": { 
               "kmsKeyId": "string"
            },
            "id": "string",
            "launchType": "string",
            "loadBalancers": [ 
               { 
                  "advancedConfiguration": { 
                     "alternateTargetGroupArn": "string",
                     "productionListenerRule": "string",
                     "roleArn": "string",
                     "testListenerRule": "string"
                  },
                  "containerName": "string",
                  "containerPort": number,
                  "loadBalancerName": "string",
                  "targetGroupArn": "string"
               }
            ],
            "networkConfiguration": { 
               "awsvpcConfiguration": { 
                  "assignPublicIp": "string",
                  "securityGroups": [ "string" ],
                  "subnets": [ "string" ]
               }
            },
            "pendingCount": number,
            "platformFamily": "string",
            "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",
            "tags": [ 
               { 
                  "key": "string",
                  "value": "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.

 ** [service](#API_UpdateService_ResponseSyntax) **   <a name="ECS-UpdateService-response-service"></a>
The full description of your service following the update call.  
Type: [Service](API_Service.md) object

## Errors


For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** AccessDeniedException **   
You don't have authorization to perform the requested action.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ClientException **   
These errors are usually caused by a client action. This client action might be using an action or resource on behalf of a user that doesn't have permissions to use the action or resource. Or, it might be specifying an identifier that isn't valid.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ClusterNotFoundException **   
The specified cluster wasn't found. You can view your available clusters with [ListClusters](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_ListClusters.html). Amazon ECS clusters are Region specific.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** InvalidParameterException **   
The specified parameter isn't valid. Review the available parameters for the API request.  
For more information about service event errors, see [Amazon ECS service event messages](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/service-event-messages-list.html).     
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** NamespaceNotFoundException **   
The specified namespace wasn't found.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** PlatformTaskDefinitionIncompatibilityException **   
The specified platform version doesn't satisfy the required capabilities of the task definition.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** PlatformUnknownException **   
The specified platform version doesn't exist.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ServerException **   
These errors are usually caused by a server issue.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 500

 ** ServiceNotActiveException **   
The specified service isn't active. You can't update a service that's inactive. If you have previously deleted a service, you can re-create it with [CreateService](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_CreateService.html).    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ServiceNotFoundException **   
The specified service wasn't found. You can view your available services with [ListServices](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_ListServices.html). Amazon ECS services are cluster specific and Region specific.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** UnsupportedFeatureException **   
The specified task isn't supported in this Region.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

## Examples


In the following example or examples, the Authorization header contents (`AUTHPARAMS`) must be replaced with an Amazon Signature Version 4 signature. For more information, see [Signature Version 4 Signing Process](https://docs.amazonaws.cn/general/latest/gr/signature-version-4.html) in the * Amazon General Reference*.

You only need to learn how to sign HTTP requests if you intend to create them manually. When you use the [Amazon Command Line Interface](http://www.amazonaws.cn/cli/) or one of the [Amazon SDKs](http://www.amazonaws.cn/tools/) to make requests to Amazon, these tools automatically sign the requests for you, with the access key that you specify when you configure the tools. When you use these tools, you don't have to sign requests yourself.

### Example


This example request updates the `hello_world` service to a desired count of 3.

#### Sample Request


```
POST / HTTP/1.1
Host: ecs.us-east-1.amazonaws.com
Accept-Encoding: identity
Content-Length: 45
X-Amz-Target: AmazonEC2ContainerServiceV20141113.UpdateService
X-Amz-Date: 20150429T194543Z
Content-Type: application/x-amz-json-1.1
Authorization: AUTHPARAMS

{
  "service": "hello_world",
  "desiredCount": 3
}
```

#### Sample Response


```
HTTP/1.1 200 OK
Server: Server
Date: Wed, 29 Apr 2015 19:45:43 GMT
Content-Type: application/x-amz-json-1.1
Content-Length: 13376
Connection: keep-alive
x-amzn-RequestId: 123a4b56-7c89-01d2-3ef4-example5678f

{
  "service": {
    "clusterArn": "arn:aws:ecs:us-east-1:012345678910:cluster/default",
    "deploymentConfiguration": {
        "maximumPercent": 200,
        "minimumHealthyPercent": 100
    },
    "deployments": [
      {
        "createdAt": 1430333711.033,
        "desiredCount": 3,
        "id": "ecs-svc/9223370606521064774",
        "pendingCount": 0,
        "runningCount": 0,
        "status": "PRIMARY",
        "taskDefinition": "arn:aws:ecs:us-east-1:012345678910:task-definition/hello_world:10",
        "updatedAt": 1430336267.173
      }
    ],
    "desiredCount": 3,
    "events": [],
    "loadBalancers": [],
    "pendingCount": 0,
    "runningCount": 0,
    "serviceArn": "arn:aws:ecs:us-east-1:012345678910:service/default/hello_world",
    "serviceName": "hello_world",
    "status": "ACTIVE",
    "taskDefinition": "arn:aws:ecs:us-east-1:012345678910:task-definition/hello_world:10"
  }
}
```

## See Also


For more information about using this API in one of the language-specific Amazon SDKs, see the following:
+  [Amazon Command Line Interface V2](https://docs.amazonaws.cn/goto/cli2/ecs-2014-11-13/UpdateService) 
+  [Amazon SDK for .NET V4](https://docs.amazonaws.cn/goto/DotNetSDKV4/ecs-2014-11-13/UpdateService) 
+  [Amazon SDK for C\$1\$1](https://docs.amazonaws.cn/goto/SdkForCpp/ecs-2014-11-13/UpdateService) 
+  [Amazon SDK for Go v2](https://docs.amazonaws.cn/goto/SdkForGoV2/ecs-2014-11-13/UpdateService) 
+  [Amazon SDK for Java V2](https://docs.amazonaws.cn/goto/SdkForJavaV2/ecs-2014-11-13/UpdateService) 
+  [Amazon SDK for JavaScript V3](https://docs.amazonaws.cn/goto/SdkForJavaScriptV3/ecs-2014-11-13/UpdateService) 
+  [Amazon SDK for Kotlin](https://docs.amazonaws.cn/goto/SdkForKotlin/ecs-2014-11-13/UpdateService) 
+  [Amazon SDK for PHP V3](https://docs.amazonaws.cn/goto/SdkForPHPV3/ecs-2014-11-13/UpdateService) 
+  [Amazon SDK for Python](https://docs.amazonaws.cn/goto/boto3/ecs-2014-11-13/UpdateService) 
+  [Amazon SDK for Ruby V3](https://docs.amazonaws.cn/goto/SdkForRubyV3/ecs-2014-11-13/UpdateService) 

# UpdateServicePrimaryTaskSet


Modifies which task set in a service is the primary task set. Any parameters that are updated on the primary task set in a service will transition to the service. This is used when a service uses the `EXTERNAL` deployment controller type. For more information, see [Amazon ECS Deployment Types](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/deployment-types.html) in the *Amazon Elastic Container Service Developer Guide*.

## Request Syntax


```
{
   "cluster": "string",
   "primaryTaskSet": "string",
   "service": "string"
}
```

## Request Parameters


For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [cluster](#API_UpdateServicePrimaryTaskSet_RequestSyntax) **   <a name="ECS-UpdateServicePrimaryTaskSet-request-cluster"></a>
The short name or full Amazon Resource Name (ARN) of the cluster that hosts the service that the task set exists in.  
Type: String  
Required: Yes

 ** [primaryTaskSet](#API_UpdateServicePrimaryTaskSet_RequestSyntax) **   <a name="ECS-UpdateServicePrimaryTaskSet-request-primaryTaskSet"></a>
The short name or full Amazon Resource Name (ARN) of the task set to set as the primary task set in the deployment.  
Type: String  
Required: Yes

 ** [service](#API_UpdateServicePrimaryTaskSet_RequestSyntax) **   <a name="ECS-UpdateServicePrimaryTaskSet-request-service"></a>
The short name or full Amazon Resource Name (ARN) of the service that the task set exists in.  
Type: String  
Required: Yes

## Response Syntax


```
{
   "taskSet": { 
      "capacityProviderStrategy": [ 
         { 
            "base": number,
            "capacityProvider": "string",
            "weight": number
         }
      ],
      "clusterArn": "string",
      "computedDesiredCount": number,
      "createdAt": number,
      "externalId": "string",
      "fargateEphemeralStorage": { 
         "kmsKeyId": "string"
      },
      "id": "string",
      "launchType": "string",
      "loadBalancers": [ 
         { 
            "advancedConfiguration": { 
               "alternateTargetGroupArn": "string",
               "productionListenerRule": "string",
               "roleArn": "string",
               "testListenerRule": "string"
            },
            "containerName": "string",
            "containerPort": number,
            "loadBalancerName": "string",
            "targetGroupArn": "string"
         }
      ],
      "networkConfiguration": { 
         "awsvpcConfiguration": { 
            "assignPublicIp": "string",
            "securityGroups": [ "string" ],
            "subnets": [ "string" ]
         }
      },
      "pendingCount": number,
      "platformFamily": "string",
      "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",
      "tags": [ 
         { 
            "key": "string",
            "value": "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](#API_UpdateServicePrimaryTaskSet_ResponseSyntax) **   <a name="ECS-UpdateServicePrimaryTaskSet-response-taskSet"></a>
The details about the task set.  
Type: [TaskSet](API_TaskSet.md) object

## Errors


For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** AccessDeniedException **   
You don't have authorization to perform the requested action.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ClientException **   
These errors are usually caused by a client action. This client action might be using an action or resource on behalf of a user that doesn't have permissions to use the action or resource. Or, it might be specifying an identifier that isn't valid.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ClusterNotFoundException **   
The specified cluster wasn't found. You can view your available clusters with [ListClusters](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_ListClusters.html). Amazon ECS clusters are Region specific.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** InvalidParameterException **   
The specified parameter isn't valid. Review the available parameters for the API request.  
For more information about service event errors, see [Amazon ECS service event messages](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/service-event-messages-list.html).     
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ServerException **   
These errors are usually caused by a server issue.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 500

 ** ServiceNotActiveException **   
The specified service isn't active. You can't update a service that's inactive. If you have previously deleted a service, you can re-create it with [CreateService](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_CreateService.html).    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ServiceNotFoundException **   
The specified service wasn't found. You can view your available services with [ListServices](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_ListServices.html). Amazon ECS services are cluster specific and Region specific.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** TaskSetNotFoundException **   
The specified task set wasn't found. You can view your available task sets with [DescribeTaskSets](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_DescribeTaskSets.html). Task sets are specific to each cluster, service and Region.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** UnsupportedFeatureException **   
The specified task isn't supported in this Region.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

## See Also


For more information about using this API in one of the language-specific Amazon SDKs, see the following:
+  [Amazon Command Line Interface V2](https://docs.amazonaws.cn/goto/cli2/ecs-2014-11-13/UpdateServicePrimaryTaskSet) 
+  [Amazon SDK for .NET V4](https://docs.amazonaws.cn/goto/DotNetSDKV4/ecs-2014-11-13/UpdateServicePrimaryTaskSet) 
+  [Amazon SDK for C\$1\$1](https://docs.amazonaws.cn/goto/SdkForCpp/ecs-2014-11-13/UpdateServicePrimaryTaskSet) 
+  [Amazon SDK for Go v2](https://docs.amazonaws.cn/goto/SdkForGoV2/ecs-2014-11-13/UpdateServicePrimaryTaskSet) 
+  [Amazon SDK for Java V2](https://docs.amazonaws.cn/goto/SdkForJavaV2/ecs-2014-11-13/UpdateServicePrimaryTaskSet) 
+  [Amazon SDK for JavaScript V3](https://docs.amazonaws.cn/goto/SdkForJavaScriptV3/ecs-2014-11-13/UpdateServicePrimaryTaskSet) 
+  [Amazon SDK for Kotlin](https://docs.amazonaws.cn/goto/SdkForKotlin/ecs-2014-11-13/UpdateServicePrimaryTaskSet) 
+  [Amazon SDK for PHP V3](https://docs.amazonaws.cn/goto/SdkForPHPV3/ecs-2014-11-13/UpdateServicePrimaryTaskSet) 
+  [Amazon SDK for Python](https://docs.amazonaws.cn/goto/boto3/ecs-2014-11-13/UpdateServicePrimaryTaskSet) 
+  [Amazon SDK for Ruby V3](https://docs.amazonaws.cn/goto/SdkForRubyV3/ecs-2014-11-13/UpdateServicePrimaryTaskSet) 

# UpdateTaskProtection


Updates the protection status of a task. You can set `protectionEnabled` to `true` to protect your task from termination during scale-in events from [Service Autoscaling](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/service-auto-scaling.html) or [deployments](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/deployment-types.html).

Task-protection, by default, expires after 2 hours at which point Amazon ECS clears the `protectionEnabled` property making the task eligible for termination by a subsequent scale-in event.

You can specify a custom expiration period for task protection from 1 minute to up to 2,880 minutes (48 hours). To specify the custom expiration period, set the `expiresInMinutes` property. The `expiresInMinutes` property is always reset when you invoke this operation for a task that already has `protectionEnabled` set to `true`. You can keep extending the protection expiration period of a task by invoking this operation repeatedly.

To learn more about Amazon ECS task protection, see [Task scale-in protection](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/task-scale-in-protection.html) in the * *Amazon Elastic Container Service Developer Guide* *.

**Note**  
This operation is only supported for tasks belonging to an Amazon ECS service. Invoking this operation for a standalone task will result in an `TASK_NOT_VALID` failure. For more information, see [API failure reasons](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/api_failures_messages.html).

**Important**  
If you prefer to set task protection from within the container, we recommend using the [Task scale-in protection endpoint](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/task-scale-in-protection-endpoint.html).

## Request Syntax


```
{
   "cluster": "string",
   "expiresInMinutes": number,
   "protectionEnabled": boolean,
   "tasks": [ "string" ]
}
```

## Request Parameters


For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [cluster](#API_UpdateTaskProtection_RequestSyntax) **   <a name="ECS-UpdateTaskProtection-request-cluster"></a>
The short name or full Amazon Resource Name (ARN) of the cluster that hosts the service that the task sets exist in.  
Type: String  
Required: Yes

 ** [expiresInMinutes](#API_UpdateTaskProtection_RequestSyntax) **   <a name="ECS-UpdateTaskProtection-request-expiresInMinutes"></a>
If you set `protectionEnabled` to `true`, you can specify the duration for task protection in minutes. You can specify a value from 1 minute to up to 2,880 minutes (48 hours). During this time, your task will not be terminated by scale-in events from Service Auto Scaling or deployments. After this time period lapses, `protectionEnabled` will be reset to `false`.  
If you don’t specify the time, then the task is automatically protected for 120 minutes (2 hours).  
Type: Integer  
Required: No

 ** [protectionEnabled](#API_UpdateTaskProtection_RequestSyntax) **   <a name="ECS-UpdateTaskProtection-request-protectionEnabled"></a>
Specify `true` to mark a task for protection and `false` to unset protection, making it eligible for termination.  
Type: Boolean  
Required: Yes

 ** [tasks](#API_UpdateTaskProtection_RequestSyntax) **   <a name="ECS-UpdateTaskProtection-request-tasks"></a>
A list of up to 10 task IDs or full ARN entries.  
Type: Array of strings  
Required: Yes

## Response Syntax


```
{
   "failures": [ 
      { 
         "arn": "string",
         "detail": "string",
         "reason": "string"
      }
   ],
   "protectedTasks": [ 
      { 
         "expirationDate": number,
         "protectionEnabled": boolean,
         "taskArn": "string"
      }
   ]
}
```

## 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.

 ** [failures](#API_UpdateTaskProtection_ResponseSyntax) **   <a name="ECS-UpdateTaskProtection-response-failures"></a>
Any failures associated with the call.  
Type: Array of [Failure](API_Failure.md) objects

 ** [protectedTasks](#API_UpdateTaskProtection_ResponseSyntax) **   <a name="ECS-UpdateTaskProtection-response-protectedTasks"></a>
A list of tasks with the following information.  
+  `taskArn`: The task ARN.
+  `protectionEnabled`: The protection status of the task. If scale-in protection is turned on for a task, the value is `true`. Otherwise, it is `false`.
+  `expirationDate`: The epoch time when protection for the task will expire.
Type: Array of [ProtectedTask](API_ProtectedTask.md) objects

## Errors


For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** AccessDeniedException **   
You don't have authorization to perform the requested action.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ClientException **   
These errors are usually caused by a client action. This client action might be using an action or resource on behalf of a user that doesn't have permissions to use the action or resource. Or, it might be specifying an identifier that isn't valid.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ClusterNotFoundException **   
The specified cluster wasn't found. You can view your available clusters with [ListClusters](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_ListClusters.html). Amazon ECS clusters are Region specific.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** InvalidParameterException **   
The specified parameter isn't valid. Review the available parameters for the API request.  
For more information about service event errors, see [Amazon ECS service event messages](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/service-event-messages-list.html).     
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ResourceNotFoundException **   
The specified resource wasn't found.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ServerException **   
These errors are usually caused by a server issue.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 500

 ** UnsupportedFeatureException **   
The specified task isn't supported in this Region.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

## Examples


In the following example or examples, the Authorization header contents (`AUTHPARAMS`) must be replaced with an Amazon Signature Version 4 signature. For more information, see [Signature Version 4 Signing Process](https://docs.amazonaws.cn/general/latest/gr/signature-version-4.html) in the * Amazon General Reference*.

You only need to learn how to sign HTTP requests if you intend to create them manually. When you use the [Amazon Command Line Interface](http://www.amazonaws.cn/cli/) or one of the [Amazon SDKs](http://www.amazonaws.cn/tools/) to make requests to Amazon, these tools automatically sign the requests for you, with the access key that you specify when you configure the tools. When you use these tools, you don't have to sign requests yourself.

### Example 1


This example request enables scale-in protection for a task for 60 minutes.

#### Sample Request


```
POST / HTTP/1.1
Host: ecs.us-west-2.amazonaws.com 
Accept-Encoding: identity 
Content-Length: 132
X-Amz-Target: AmazonEC2ContainerServiceV20141113.UpdateTaskProtection 
X-Amz-Date: 20221102T184632Z Content-Type: 
application/x-amz-json-1.1 
Authorization: AUTHPARAMS 

{
    "cluster": "test-task-protection",
    "tasks": [
        "b8b1cf532d0e46ba8d44a40d1de16772"
    ],
    "protectionEnabled": true,
    "expiresInMinutes": 60
}
```

#### Sample Response


```
HTTP/1.1 200 OK 
Server: Server 
Date: Wed, 02 Nov 2022 17:56:32 GMT 
Content-Type: application/x-amz-json-1.1 
Content-Length: 180 
Connection: keep-alive
x-amzn-RequestId: 123a4b56-7c89-01d2-3ef4-example5678f

{
    "protectedTasks": [
        {
            "taskArn": "arn:aws:ecs:us-west-2:012345678910:task/default/b8b1cf532d0e46ba8d44a40d1de16772",
            "protectionEnabled": true,
            "expirationDate": 1667415392.553
        }
    ],
    "failures": []
}
```

### Example 2


This example request enables scale-in protection for a task without specifying the `expiresInMinutes` parameter. By default, the task will be protected from scale-in events for 120 minutes.

#### Sample Request


```
POST / HTTP/1.1
Host: ecs.us-west-2.amazonaws.com 
Accept-Encoding: identity 
Content-Length: 132
X-Amz-Target: AmazonEC2ContainerServiceV20141113.UpdateTaskProtection 
X-Amz-Date: 20221103T212558Z 
Content-Type: application/x-amz-json-1.1 
Authorization: AUTHPARAMS 

{
    "cluster": "test-task-protection",
    "tasks": [
        "b8b1cf532d0e46ba8d44a40d1de16772"
    ],
    "protectionEnabled": true
}
```

#### Sample Response


```
HTTP/1.1 200 OK 
Server: Server 
Date: Thu, 03 Nov 2022 21:25:57 GMT 
Content-Type: application/x-amz-json-1.1 
Content-Length: 180 
Connection: keep-alive
x-amzn-RequestId: 123a4b56-7c89-01d2-3ef4-example5678f

{
    "protectedTasks": [
        {
            "taskArn": "arn:aws:ecs:us-west-2:012345678910:task/default/b8b1cf532d0e46ba8d44a40d1de16772",
            "protectionEnabled": true,
            "expirationDate": 1667517958.355
        }
    ],
    "failures": []
}
```

### Example 3


This example request turns off scale-in protection for a task.

#### Sample Request


```
POST / HTTP/1.1
Host: ecs.us-west-2.amazonaws.com 
Accept-Encoding: identity 
Content-Length:109
X-Amz-Target: AmazonEC2ContainerServiceV20141113.UpdateTaskProtection 
X-Amz-Date: 20221103T213134Z 
Content-Type: application/x-amz-json-1.1 
Authorization: AUTHPARAMS 

{
    "cluster": "test-task-protection",
    "tasks": [
        "b8b1cf532d0e46ba8d44a40d1de16772"
    ],
    "protectionEnabled":false
}
```

#### Sample Response


```
HTTP/1.1 200 OK 
Server: Server 
Date: Thu, 03 Nov 2022 21:31:34 GMT 
Content-Type: application/x-amz-json-1.1 
Content-Length: 180 
Connection: keep-alive
x-amzn-RequestId: 123a4b56-7c89-01d2-3ef4-example5678f

{
    "protectedTasks": [
        {
            "taskArn": "arn:aws:ecs:us-west-2:012345678910:task/default/b8b1cf532d0e46ba8d44a40d1de16772",
            "protectionEnabled": false
        }
    ],
    "failures": []
}
```

## See Also


For more information about using this API in one of the language-specific Amazon SDKs, see the following:
+  [Amazon Command Line Interface V2](https://docs.amazonaws.cn/goto/cli2/ecs-2014-11-13/UpdateTaskProtection) 
+  [Amazon SDK for .NET V4](https://docs.amazonaws.cn/goto/DotNetSDKV4/ecs-2014-11-13/UpdateTaskProtection) 
+  [Amazon SDK for C\$1\$1](https://docs.amazonaws.cn/goto/SdkForCpp/ecs-2014-11-13/UpdateTaskProtection) 
+  [Amazon SDK for Go v2](https://docs.amazonaws.cn/goto/SdkForGoV2/ecs-2014-11-13/UpdateTaskProtection) 
+  [Amazon SDK for Java V2](https://docs.amazonaws.cn/goto/SdkForJavaV2/ecs-2014-11-13/UpdateTaskProtection) 
+  [Amazon SDK for JavaScript V3](https://docs.amazonaws.cn/goto/SdkForJavaScriptV3/ecs-2014-11-13/UpdateTaskProtection) 
+  [Amazon SDK for Kotlin](https://docs.amazonaws.cn/goto/SdkForKotlin/ecs-2014-11-13/UpdateTaskProtection) 
+  [Amazon SDK for PHP V3](https://docs.amazonaws.cn/goto/SdkForPHPV3/ecs-2014-11-13/UpdateTaskProtection) 
+  [Amazon SDK for Python](https://docs.amazonaws.cn/goto/boto3/ecs-2014-11-13/UpdateTaskProtection) 
+  [Amazon SDK for Ruby V3](https://docs.amazonaws.cn/goto/SdkForRubyV3/ecs-2014-11-13/UpdateTaskProtection) 

# UpdateTaskSet


Modifies a task set. This is used when a service uses the `EXTERNAL` deployment controller type. For more information, see [Amazon ECS Deployment Types](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/deployment-types.html) in the *Amazon Elastic Container Service Developer Guide*.

## Request Syntax


```
{
   "cluster": "string",
   "scale": { 
      "unit": "string",
      "value": number
   },
   "service": "string",
   "taskSet": "string"
}
```

## Request Parameters


For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [cluster](#API_UpdateTaskSet_RequestSyntax) **   <a name="ECS-UpdateTaskSet-request-cluster"></a>
The short name or full Amazon Resource Name (ARN) of the cluster that hosts the service that the task set is found in.  
Type: String  
Required: Yes

 ** [scale](#API_UpdateTaskSet_RequestSyntax) **   <a name="ECS-UpdateTaskSet-request-scale"></a>
A floating-point percentage of the desired number of tasks to place and keep running in the task set.  
Type: [Scale](API_Scale.md) object  
Required: Yes

 ** [service](#API_UpdateTaskSet_RequestSyntax) **   <a name="ECS-UpdateTaskSet-request-service"></a>
The short name or full Amazon Resource Name (ARN) of the service that the task set is found in.  
Type: String  
Required: Yes

 ** [taskSet](#API_UpdateTaskSet_RequestSyntax) **   <a name="ECS-UpdateTaskSet-request-taskSet"></a>
The short name or full Amazon Resource Name (ARN) of the task set to update.  
Type: String  
Required: Yes

## Response Syntax


```
{
   "taskSet": { 
      "capacityProviderStrategy": [ 
         { 
            "base": number,
            "capacityProvider": "string",
            "weight": number
         }
      ],
      "clusterArn": "string",
      "computedDesiredCount": number,
      "createdAt": number,
      "externalId": "string",
      "fargateEphemeralStorage": { 
         "kmsKeyId": "string"
      },
      "id": "string",
      "launchType": "string",
      "loadBalancers": [ 
         { 
            "advancedConfiguration": { 
               "alternateTargetGroupArn": "string",
               "productionListenerRule": "string",
               "roleArn": "string",
               "testListenerRule": "string"
            },
            "containerName": "string",
            "containerPort": number,
            "loadBalancerName": "string",
            "targetGroupArn": "string"
         }
      ],
      "networkConfiguration": { 
         "awsvpcConfiguration": { 
            "assignPublicIp": "string",
            "securityGroups": [ "string" ],
            "subnets": [ "string" ]
         }
      },
      "pendingCount": number,
      "platformFamily": "string",
      "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",
      "tags": [ 
         { 
            "key": "string",
            "value": "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](#API_UpdateTaskSet_ResponseSyntax) **   <a name="ECS-UpdateTaskSet-response-taskSet"></a>
Details about the task set.  
Type: [TaskSet](API_TaskSet.md) object

## Errors


For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** AccessDeniedException **   
You don't have authorization to perform the requested action.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ClientException **   
These errors are usually caused by a client action. This client action might be using an action or resource on behalf of a user that doesn't have permissions to use the action or resource. Or, it might be specifying an identifier that isn't valid.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ClusterNotFoundException **   
The specified cluster wasn't found. You can view your available clusters with [ListClusters](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_ListClusters.html). Amazon ECS clusters are Region specific.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** InvalidParameterException **   
The specified parameter isn't valid. Review the available parameters for the API request.  
For more information about service event errors, see [Amazon ECS service event messages](https://docs.amazonaws.cn/AmazonECS/latest/developerguide/service-event-messages-list.html).     
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ServerException **   
These errors are usually caused by a server issue.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 500

 ** ServiceNotActiveException **   
The specified service isn't active. You can't update a service that's inactive. If you have previously deleted a service, you can re-create it with [CreateService](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_CreateService.html).    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** ServiceNotFoundException **   
The specified service wasn't found. You can view your available services with [ListServices](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_ListServices.html). Amazon ECS services are cluster specific and Region specific.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** TaskSetNotFoundException **   
The specified task set wasn't found. You can view your available task sets with [DescribeTaskSets](https://docs.amazonaws.cn/AmazonECS/latest/APIReference/API_DescribeTaskSets.html). Task sets are specific to each cluster, service and Region.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

 ** UnsupportedFeatureException **   
The specified task isn't supported in this Region.    
 ** message **   
 Message that describes the cause of the exception.
HTTP Status Code: 400

## See Also


For more information about using this API in one of the language-specific Amazon SDKs, see the following:
+  [Amazon Command Line Interface V2](https://docs.amazonaws.cn/goto/cli2/ecs-2014-11-13/UpdateTaskSet) 
+  [Amazon SDK for .NET V4](https://docs.amazonaws.cn/goto/DotNetSDKV4/ecs-2014-11-13/UpdateTaskSet) 
+  [Amazon SDK for C\$1\$1](https://docs.amazonaws.cn/goto/SdkForCpp/ecs-2014-11-13/UpdateTaskSet) 
+  [Amazon SDK for Go v2](https://docs.amazonaws.cn/goto/SdkForGoV2/ecs-2014-11-13/UpdateTaskSet) 
+  [Amazon SDK for Java V2](https://docs.amazonaws.cn/goto/SdkForJavaV2/ecs-2014-11-13/UpdateTaskSet) 
+  [Amazon SDK for JavaScript V3](https://docs.amazonaws.cn/goto/SdkForJavaScriptV3/ecs-2014-11-13/UpdateTaskSet) 
+  [Amazon SDK for Kotlin](https://docs.amazonaws.cn/goto/SdkForKotlin/ecs-2014-11-13/UpdateTaskSet) 
+  [Amazon SDK for PHP V3](https://docs.amazonaws.cn/goto/SdkForPHPV3/ecs-2014-11-13/UpdateTaskSet) 
+  [Amazon SDK for Python](https://docs.amazonaws.cn/goto/boto3/ecs-2014-11-13/UpdateTaskSet) 
+  [Amazon SDK for Ruby V3](https://docs.amazonaws.cn/goto/SdkForRubyV3/ecs-2014-11-13/UpdateTaskSet) 