

# UpdateCluster
<a name="API_UpdateCluster"></a>

Updates the cluster.

## Request Syntax
<a name="API_UpdateCluster_RequestSyntax"></a>

```
{
   "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
<a name="API_UpdateCluster_RequestParameters"></a>

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.aws.amazon.com/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
<a name="API_UpdateCluster_ResponseSyntax"></a>

```
{
   "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
<a name="API_UpdateCluster_ResponseElements"></a>

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
<a name="API_UpdateCluster_Errors"></a>

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.aws.amazon.com/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.aws.amazon.com/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
<a name="API_UpdateCluster_SeeAlso"></a>

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