AWS code-library documentation change
Summary
Significant restructuring of ECS UpdateService examples: Changed Example 1 from task definition update to task count modification, removed detailed output examples, deleted Examples 3-4 about EBS volume configuration, and renumbered Availability Zone rebalancing example as Example 2.
Security assessment
Changes focus on reorganizing examples and updating operational procedures. No security vulnerabilities, patches, or explicit security guidance are mentioned. Removal of EBS volume examples doesn't indicate security fixes but rather documentation cleanup.
Diff
diff --git a/code-library/latest/ug/ecs_example_ecs_UpdateService_section.md b/code-library/latest/ug/ecs_example_ecs_UpdateService_section.md index e2dfe71e6..be7675a48 100644 --- a/code-library/latest/ug/ecs_example_ecs_UpdateService_section.md +++ b/code-library/latest/ug/ecs_example_ecs_UpdateService_section.md @@ -17 +17 @@ CLI -**Example 1: To change the task definition used in a service** +**Example 1: To change the number of instantiations in a service** @@ -19 +19 @@ CLI -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. @@ -23,146 +23 @@ The following `update-service` example updates the `my-http-service` service to - --cluster test \ - --service my-http-service \ - --task-definition amazon-ecs-sample - - -Output: - - - { - "service": { - "serviceArn": "arn:aws:ecs:us-west-2:123456789012:service/test/my-http-service", - "serviceName": "my-http-service", - "clusterArn": "arn:aws:ecs:us-west-2:123456789012:cluster/test", - "loadBalancers": [], - "serviceRegistries": [], - "status": "ACTIVE", - "desiredCount": 2, - "runningCount": 2, - "pendingCount": 0, - "launchType": "FARGATE", - "platformVersion": "1.4.0", - "platformFamily": "Linux", - "taskDefinition": "arn:aws:ecs:us-west-2:123456789012:task-definition/amazon-ecs-sample:2", - "deploymentConfiguration": { - "deploymentCircuitBreaker": { - "enable": true, - "rollback": true - }, - "maximumPercent": 200, - "minimumHealthyPercent": 100, - "alarms": { - "alarmNames": [], - "rollback": false, - "enable": false - } - }, - "deployments": [ - { - "id": "ecs-svc/7419115625193919142", - "status": "PRIMARY", - "taskDefinition": "arn:aws:ecs:us-west-2:123456789012:task-definition/amazon-ecs-sample:2", - "desiredCount": 0, - "pendingCount": 0, - "runningCount": 0, - "failedTasks": 0, - "createdAt": "2025-02-21T13:26:02.734000-06:00", - "updatedAt": "2025-02-21T13:26:02.734000-06:00", - "launchType": "FARGATE", - "platformVersion": "1.4.0", - "platformFamily": "Linux", - "networkConfiguration": { - "awsvpcConfiguration": { - "subnets": [ - "subnet-12344321" - ], - "securityGroups": [ - "sg-12344321" - ], - "assignPublicIp": "ENABLED" - } - }, - "rolloutState": "IN_PROGRESS", - "rolloutStateReason": "ECS deployment ecs-svc/7419115625193919142 in progress." - }, - { - "id": "ecs-svc/1709597507655421668", - "status": "ACTIVE", - "taskDefinition": "arn:aws:ecs:us-west-2:123456789012:task-definition/old-amazon-ecs-sample:4", - "desiredCount": 2, - "pendingCount": 0, - "runningCount": 2, - "failedTasks": 0, - "createdAt": "2025-01-24T11:13:07.621000-06:00", - "updatedAt": "2025-02-02T16:11:30.838000-06:00", - "launchType": "FARGATE", - "platformVersion": "1.4.0", - "platformFamily": "Linux", - "networkConfiguration": { - "awsvpcConfiguration": { - "subnets": [ - "subnet-12344321" - ], - "securityGroups": [ - "sg-12344321" - ], - "assignPublicIp": "ENABLED" - } - }, - "rolloutState": "COMPLETED", - "rolloutStateReason": "ECS deployment ecs-svc/1709597507655421668 completed." - } - ], - "roleArn": "arn:aws:iam::123456789012:role/aws-service-role/ecs.amazonaws.com/AWSServiceRoleForECS", - "events": [ - { - "id": "e40b4d1c-80d9-4834-aaf3-6a268e530e17", - "createdAt": "2025-02-21T10:31:26.037000-06:00", - "message": "(my-http-service) has reached a steady state." - }, - { - "id": "6ac069ad-fc8b-4e49-a35d-b5574a964c8e", - "createdAt": "2025-02-21T04:31:22.703000-06:00", - "message": "(my-http-service) has reached a steady state." - }, - { - "id": "265f7d37-dfd1-4880-a846-ec486f341919", - "createdAt": "2025-02-20T22:31:22.514000-06:00", - "message": "(my-http-service) has reached a steady state." - } - ], - "createdAt": "2024-10-30T17:12:43.218000-05:00", - "placementConstraints": [], - "placementStrategy": [], - "networkConfiguration": { - "awsvpcConfiguration": { - "subnets": [ - "subnet-12344321", - ], - "securityGroups": [ - "sg-12344321" - ], - "assignPublicIp": "ENABLED" - } - }, - "healthCheckGracePeriodSeconds": 0, - "schedulingStrategy": "REPLICA", - "deploymentController": { - "type": "ECS" - }, - "createdBy": "arn:aws:iam::123456789012:role/AIDACKCEVSQ6C2EXAMPLE", - "enableECSManagedTags": true, - "propagateTags": "NONE", - "enableExecuteCommand": false, - "availabilityZoneRebalancing": "DISABLED" - } - } - -For more information, see [Update 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_. - -**Example 2: To change the number of tasks in a service** - -The following `update-service` example updates the desired task count of the service `my-http-service` from to 2. - - - aws ecs update-service \ - --cluster MyCluster \ + --cluster MyCluster @@ -294,375 +149 @@ For more information, see [Updating an Amazon ECS service using the console](htt -**Example 3: To configure Amazon EBS volumes for attachment at service update** - -The following `update-service` example updates the service `my-http-service` to use Amazon EBS volumes. You must have an Amazon ECS infrastructure role configured with the `AmazonECSInfrastructureRolePolicyForVolumes` managed policy attached. You must also specify a task definition with the same volume name as in the `update-service` request and with `configuredAtLaunch` set to `true`. This example uses the `--cli-input-json` option and a JSON input file called `ebs.json`. - - - aws ecs update-service \ - --cli-input-json file://ebs.json - - -Contents of `ebs.json`: - - - { - "cluster": "mycluster", - "taskDefinition": "mytaskdef", - "service": "my-http-service", - "desiredCount": 2, - "volumeConfigurations": [ - { - "name": "myEbsVolume", - "managedEBSVolume": { - "roleArn":"arn:aws:iam::123456789012:role/ecsInfrastructureRole", - "volumeType": "gp3", - "sizeInGiB": 100, - "iops": 3000, - "throughput": 125, - "filesystemType": "ext4" - } - } - ] - } - -Output: - - - { - "service": { - "serviceArn": "arn:aws:ecs:us-west-2:123456789012:service/mycluster/my-http-service", - "serviceName": "my-http-service", - "clusterArn": "arn:aws:ecs:us-west-2:123456789012:cluster/mycluster", - "loadBalancers": [],