
- ECS supports multiple deployment controllers and strategies:
- Rolling update (ECS scheduler): replace tasks in place.
- Blue/green: use native task sets (console) or integrate with AWS CodeDeploy for advanced traffic control.
- External/third‑party controllers: Spinnaker, Harness, etc. — supported but outside this demo (and typically not required for certification).
- Rolling updates create new tasks, wait until they become healthy, and then deregister old tasks from the load balancer.
- Blue/green deployments create a new task set (green) and shift traffic from the running set (blue) to the new set using ALB listeners or CodeDeploy traffic shifting.
- The console exposes strategy options and related controls when you choose Update service on a service page: task definition revision, desired count, health thresholds, and deployment behavior (rolling, blue/green, canary, linear).
- You can also configure a deployment circuit breaker, automatic rollback on failure, and CloudWatch alarms to influence deployments.

- In this demo the service starts with a desired count of 2 and is updated to 4.
- ECS obeys
minimum healthy percentandmaximum percentduring rolling updates. These settings control how many tasks can be added or removed concurrently and therefore determine concurrency and cost. - If capacity or cost is a concern, lowering the
minimum healthy percentreduces the number of running tasks during deployment at the expense of redundancy.
- When an Application Load Balancer (ALB) is attached, new tasks are registered with the configured target group; ALB listener rules and target group weights govern traffic switching.
- The service update page includes direct links to inspect and modify ALB listeners and target groups.

- Rolling update: in-place task replacement; quick and cost‑efficient.
- Blue/green: create a separate task set and shift traffic atomically or in stages; supports near‑zero downtime and instant rollback.
- Canary: shift a small initial percentage of traffic, wait (bake), then shift the remainder if healthy.
- Linear: step traffic up by a fixed percentage every configured interval.

- Native blue/green lifecycle hooks let you run custom actions (for example AWS Lambda functions) at defined stages: pre-scale-up, post-scale-up, test-traffic, allow-traffic, post-traffic, pre-terminate, etc.
- These hooks are useful for validation, integration testing, notifications, or any action that must run while traffic is shifting.

- After you submit the update (for example, changed desired count or chosen strategy), the console displays deployment progress and a deployment summary showing deployment IDs, status, duration, revision, and task counts.
- Use the service Events and Tasks tabs to monitor registration, health checks, and lifecycle messages (launches, deregistrations, rollovers).

- The Tasks tab shows each task and its health status. Running and Healthy indicates successful registration and passing health checks.
- The Events pane logs lifecycle messages useful for debugging: task start, deregistration, rollbacks, and failures.

- Canary: send a small percentage (example: 5%) to the new task set, bake for a configured duration (example: 10 minutes). If metrics and health checks remain stable, send the remaining traffic.
- Linear: increment traffic by a set percentage at regular intervals (example: 10% every 6 minutes). This stair‑step approach gives repeated short validation windows.

For exam prep: ECS supports rolling updates, blue/green (native and CodeDeploy), and traffic‑shifting strategies (canary, linear). Decide based on downtime tolerance, validation windows, rollback needs, and operational complexity.
- This demo uses Fargate, which abstracts EC2 instances and removes the need to manage underlying hosts. Fargate often reduces operational overhead and speeds up launches.
- EC2-backed clusters give you more control over underlying instances and may have different capacity planning considerations and limits.
- Check the current Fargate and ECS service quotas for your region: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-quotas.html

- Min/max task percent values determine how many tasks can be added or removed concurrently during rolling updates — tune them for safety vs. cost.
- Use the deployment circuit breaker to enable automatic rollback for failing deployments.
- Wire CloudWatch alarms into automatic rollback policies if an alarm indicates unhealthy behavior during a deployment.
- Use lifecycle hooks in blue/green to perform integration tests, third‑party validations, or notifications at precise points in the deployment lifecycle.
Be careful when reducing
minimum healthy percent or increasing desired counts in capacity‑constrained or cost‑sensitive environments — these changes directly impact concurrent task counts and costs during deployments.- Amazon ECS service deployments: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-deployments.html
- AWS CodeDeploy blue/green for ECS: https://docs.aws.amazon.com/codedeploy/latest/userguide/deployment-ecs.html
- Fargate and ECS quotas: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-quotas.html