AWS Security ChangesHomeSearch

AWS cli documentation change

Service: cli · 2025-03-10 · Documentation low

File: cli/v1/userguide/cli_ecs_code_examples.md

Summary

Updated create-cluster examples to include enhanced container insights settings and restructured command formatting

Security assessment

Changes add enhanced observability features but no explicit security vulnerability fixes or security-specific documentation

Diff

diff --git a/cli/v1/userguide/cli_ecs_code_examples.md
index 62fc3a8f3..6dd006a50 100644
--- a/cli/v1/userguide/cli_ecs_code_examples.md
+++ b/cli/v1/userguide/cli_ecs_code_examples.md
@@ -124 +124 @@ The following code example shows how to use `create-cluster`.
-The following `create-cluster` example creates a cluster.
+The following `create-cluster` example creates a cluster named `MyCluster` and enables CloudWatch Container Insights with enhanced observability.
@@ -128 +128,2 @@ The following `create-cluster` example creates a cluster.
-        --cluster-name MyCluster
+        --cluster-name MyCluster \
+        --settings name=containerInsights,value=enhanced
@@ -143,0 +145,6 @@ Output:
+            "settings": [
+                {
+                    "name": "containerInsights",
+                    "value": "enhanced"
+                }
+            ],
@@ -154 +161,6 @@ The following `create-cluster` example creates a cluster and associates two exis
-aws ecs create-cluster --cluster-name MyCluster --capacity-providers MyCapacityProvider1 MyCapacityProvider2 --default-capacity-provider-strategy capacityProvider=MyCapacityProvider1,weight=1 capacityProvider=MyCapacityProvider2,weight=1
+    
+    aws ecs create-cluster \
+        --cluster-name MyCluster \
+        --capacity-providers MyCapacityProvider1 MyCapacityProvider2 \
+        --default-capacity-provider-strategy capacityProvider=MyCapacityProvider1,weight=1 capacityProvider=MyCapacityProvider2,weight=1
+    
@@ -236 +248 @@ The following `create-cluster` example creates a cluster with multiple tags. For
-        --tags key=key1,value=value1 key=key2,value=value2 key=key3,value=value3
+        --tags key=key1,value=value1 key=key2,value=value2
@@ -260,4 +271,0 @@ Output:
-                },
-                {
-                    "key": "key3",
-                    "value": "value3"
@@ -2757 +2765 @@ The following code example shows how to use `put-account-setting`.
-The following `put-account-setting` example enables the `serviceLongArnFormat` account setting for your IAM user account.
+The following `put-account-setting` example sets the `containerInsights` account setting to `enhanced` for your IAM user account. This turns on Container Insights with enhanced observability.
@@ -2760 +2768,3 @@ The following `put-account-setting` example enables the `serviceLongArnFormat` a
-    aws ecs put-account-setting --name serviceLongArnFormat --value enabled
+    aws ecs put-account-setting \
+        --name containerInsights \
+        --value enhanced
@@ -2768,3 +2778,4 @@ Output:
-            "name": "serviceLongArnFormat",
-            "value": "enabled",
-            "principalArn": "arn:aws:iam::130757420319:user/your_username"
+            "name": "containerInsights",
+            "value": "enhanced",
+            "principalArn": "arn:aws:iam::123456789012:user/johndoe",
+            "type": "user"
@@ -3435 +3446 @@ The following code example shows how to use `update-cluster-settings`.
-The following `update-cluster-settings` example enables CloudWatch Container Insights for the `default` cluster.
+The following `update-cluster-settings` example enables CloudWatch Container Insights with enhanced observability for the `MyCluster` cluster.
@@ -3439,2 +3450,2 @@ The following `update-cluster-settings` example enables CloudWatch Container Ins
-        --cluster default \
-        --settings name=containerInsights,value=enabled
+        --cluster MyCluster \
+        --settings name=containerInsights,value=enhanced
@@ -3448 +3459 @@ Output:
-            "clusterArn": "arn:aws:ecs:us-west-2:123456789012:cluster/MyCluster",
+            "clusterArn": "arn:aws:ecs:us-esat-1:123456789012:cluster/MyCluster",
@@ -3460 +3471 @@ Output:
-                    "value": "enabled"
+                    "value": "enhanced"
@@ -4047 +4058 @@ The following code example shows how to use `update-service`.
-**Example 1: To change the task definition used in a service**
+**Example 1: To change the number of instantiations in a service**
@@ -4049 +4060 @@ The following code example shows how to use `update-service`.
-The following `update-service` example updates the `my-http-service` service to use the `amazon-ecs-sample` task definition.
+The following `update-service` example updates the desired task count of the service `my-http-service` to 2.
@@ -4052 +4063,4 @@ The following `update-service` example updates the `my-http-service` service to
-    aws ecs update-service --service my-http-service --task-definition amazon-ecs-sample
+    aws ecs update-service \
+       --cluster MyCluster
+       --service my-http-service \
+       --desired-count 2
@@ -4055 +4069 @@ The following `update-service` example updates the `my-http-service` service to
-**Example 2: To change the number of tasks in a service**
+Output:
@@ -4057 +4070,0 @@ The following `update-service` example updates the `my-http-service` service to
-The following `update-service` example updates the desired task count of the service `my-http-service` to 3.
@@ -4058,0 +4072,117 @@ The following `update-service` example updates the desired task count of the ser
+    {
+        "service": {
+            "serviceArn": "arn:aws:ecs:us-east-1:123456789012:service/MyCluster/my-http-service",
+            "serviceName": "my-http-service",
+            "clusterArn": "arn:aws:ecs:us-east-1:123456789012:cluster/MyCluster",
+            "loadBalancers": [],
+            "serviceRegistries": [],
+            "status": "ACTIVE",
+            "desiredCount": 2,
+            "runningCount": 1,
+            "pendingCount": 0,
+            "capacityProviderStrategy": [
+                {
+                    "capacityProvider": "FARGATE",
+                    "weight": 1,
+                    "base": 0
+                }
+            ],
+            "platformVersion": "LATEST",
+            "platformFamily": "Linux",
+            "taskDefinition": "arn:aws:ecs:us-east-1:123456789012:task-definition/MyTaskDefinition",
+            "deploymentConfiguration": {
+                "deploymentCircuitBreaker": {
+                    "enable": true,
+                    "rollback": true
+                },
+                "maximumPercent": 200,
+                "minimumHealthyPercent": 100,
+                "alarms": {
+                    "alarmNames": [],
+                    "rollback": false,
+                    "enable": false
+                }
+            },
+            "deployments": [
+                {
+                    "id": "ecs-svc/1976744184940610707",
+                    "status": "PRIMARY",
+                    "taskkDefinition": "arn:aws:ecs:us-east-1:123456789012:task-definition/MyTaskDefinition",
+                    "desiredCount": 1,
+                    "pendingCount": 0,
+                    "runningCount": 1,
+                    "failedTasks": 0,
+                    "createdAt": "2024-12-03T16:24:25.225000-05:00",
+                    "updatedAt": "2024-12-03T16:25:15.837000-05:00",
+                    "capacityProviderStrategy": [
+                        {
+                            "capacityProvider": "FARGATE",
+                            "weight": 1,
+                            "base": 0
+                        }
+                    ],
+                    "platformVersion": "1.4.0",
+                    "platformFamily": "Linux",
+                    "networkConfiguration": {
+                        "awsvpcConfiguration": {
+                            "subnets": [
+                                "subnet-0d0eab1bb38d5ca64",
+                                "subnet-0db5010045995c2d5"
+                            ],
+                            "securityGroups": [
+                                "sg-02556bf85a191f59a"
+                            ],
+                            "assignPublicIp": "ENABLED"
+                        }
+                    },
+                    "rolloutState": "COMPLETED",
+                    "rolloutStateReason": "ECS deployment ecs-svc/1976744184940610707 completed."
+                }
+            ],
+            "roleArn": "arn:aws:iam::123456789012:role/aws-service-role/ecs.amazonaws.com/AWSServiceRoleForECS",
+            "events": [
+                {
+                    "id": "f27350b9-4b2a-4e2e-b72e-a4b68380de45",
+                    "createdAt": "2024-12-30T13:24:07.345000-05:00",
+                    "message": "(service my-http-service) has reached a steady state."
+                },
+                {
+                    "id": "e764ec63-f53f-45e3-9af2-d99f922d2957",
+                    "createdAt": "2024-12-30T12:32:21.600000-05:00",
+                    "message": "(service my-http-service) has reached a steady state."
+                },
+                {
+                    "id": "28444756-c2fa-47f8-bd60-93a8e05f3991",
+                    "createdAt": "2024-12-08T19:26:10.367000-05:00",
+                    "message": "(service my-http-service) has reached a steady state."
+                }
+            ],
+            "createdAt": "2024-12-03T16:24:25.225000-05:00",
+            "placementConstraints": [],
+            "placementStrategy": [],
+            "networkConfiguration": {
+                "awsvpcConfiguration": {
+                    "subnets": [
+                        "subnet-0d0eab1bb38d5ca64",
+                        "subnet-0db5010045995c2d5"
+                    ],
+                    "securityGroups": [
+                        "sg-02556bf85a191f59a"
+                    ],
+                    "assignPublicIp": "ENABLED"
+                }
+            },
+            "healthCheckGracePeriodSeconds": 0,
+            "schedulingStrategy": "REPLICA",
+            "deploymentController": {
+                "type": "ECS"
+            },
+            "createdBy": "arn:aws:iam::123456789012:role/Admin",
+            "enableECSManagedTags": true,
+            "propagateTags": "NONE",
+            "enableExecuteCommand": false,
+            "availabilityZoneRebalancing": "ENABLED"
+        }
+    }
+
+For more information, see [Updating an Amazon ECS service using the console](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/update-service-console-v2.html) in the _Amazon ECS Developer Guide_.
@@ -4060 +4190 @@ The following `update-service` example updates the desired task count of the ser