After registering revision 7 of a task definition, a developer needs the existing ECS service to start running that revision. Which CLI call makes the switch?
Show answer and explanation
Answer: D
aws ecs update-service changes an existing service's configuration, including the task definition it uses. ECS then performs a rolling deployment that replaces tasks with the new revision. Creating a service would fail because the service already exists, run-task starts standalone tasks outside the service, and register-task-definition only stores the new revision without changing anything that is running.
Why the other options are wrong
- A. create-service makes a brand-new service and fails when the name is already taken. It does not modify the existing service.
- B. run-task launches one-off tasks that are not managed by the service. The service keeps running its old revision.
- C. register-task-definition stores the new revision in ECS. It does not change the service, so nothing running is updated.