CmdID

CmdID / aws / aws ecs

aws ecs update-cluster

Updates the cluster. AWS CLI reference

2 examples 4 options Its page in the AWS CLI reference

Opens CmdID with your command. It is read in your browser and sent nowhere.

Examples

from aws-cli, each command read by CmdID

Example 1: To update an ECS cluster to enable containerInsights

The following update-cluster example updates the containerInsights value to enabled in an already created cluster. By default, it is disabled.

aws ecs update-cluster --cluster ECS-project-update-cluster --settings name=containerInsights,value=enabledIdentify
--clusterThe name of the cluster to modify the settings for.
--settingsThe cluster settings for your cluster.
Its output, shortened
{
    "cluster": {
        "clusterArn": "arn:aws:ecs:us-west-2:123456789012:cluster/ECS-project-update-cluster",
        "clusterName": "ECS-project-update-cluster",
        "status": "ACTIVE",
        "registeredContainerInstancesCount": 0,
        "runningTasksCount": 0,
        "pendingTasksCount": 0,
        "activeServicesCount": 0,
        "statistics": [],
        "tags": [],
        "settings": [
            {
                "name": "containerInsights",
                "value": "enabled"
            }
        ],
        "capacityProviders": [
            "Infra-ECS-Cluster-ECS-project-update-cluster-d6bb6d5b-EC2CapacityProvider-3fIpdkLywwFt"
        ],
        "defaultCapacityProviderStrategy": [
            {
                "capacityProvider": "Infra-ECS-Cluster-ECS-project-update-cluster-d6bb6d5b-EC2CapacityProvider-3fIpdkLywwFt",
                "weight": 1,
                "base": 0
            }
        ],
        "attachments": [
            {
                "id": "a1b2c3d4-5678-90ab-cdef-EXAMPLE11111",
… 41 more lines

Example 2: To update an ECS cluster to set a default Service Connect namespace

The following update-cluster example updates an ECS cluster by setting a default Service Connect namespace.

aws ecs update-cluster --cluster ECS-project-update-cluster --service-connect-defaults namespace=testIdentify
--clusterThe name of the cluster to modify the settings for.
--service-connect-defaultsUse this parameter to set a default Service Connect namespace.
Its output, shortened
{
    "cluster": {
        "clusterArn": "arn:aws:ecs:us-west-2:123456789012:cluster/ECS-project-update-cluster",
        "clusterName": "ECS-project-update-cluster",
        "status": "ACTIVE",
        "registeredContainerInstancesCount": 0,
        "runningTasksCount": 0,
        "pendingTasksCount": 0,
        "activeServicesCount": 0,
        "statistics": [],
        "tags": [],
        "settings": [
            {
                "name": "containerInsights",
                "value": "enabled"
            }
        ],
        "capacityProviders": [
            "Infra-ECS-Cluster-ECS-project-update-cluster-d6bb6d5b-EC2CapacityProvider-3fIpdkLywwFt"
        ],
        "defaultCapacityProviderStrategy": [
            {
                "capacityProvider": "Infra-ECS-Cluster-ECS-project-update-cluster-d6bb6d5b-EC2CapacityProvider-3fIpdkLywwFt",
                "weight": 1,
                "base": 0
            }
        ],
        "attachments": [
            {
                "id": "a1b2c3d4-5678-90ab-cdef-EXAMPLE11111",
… 53 more lines

For more information on Service Connect, see Use Service Connect to connect Amazon ECS services with short names in the Amazon ECS Developer Guide.

Options

4 in the AWS CLI reference
--clusterThe name of the cluster to modify the settings for.
--configurationThe execute command configuration for the cluster.
--service-connect-defaultsUse this parameter to set a default Service Connect namespace.
--settingsThe cluster settings for your cluster.