Skip to main content
Welcome. This walkthrough demonstrates Amazon ECS deployment methods and how they behave in the console. You’ll see how to implement and observe the common strategies used for containerized services: rolling updates, blue/green (native task‑set and CodeDeploy integration), canary and linear traffic shifting, and how third‑party deployment controllers fit into the picture. First, we review the ECS cluster and the service used in this demo.
A screenshot of the Amazon Elastic Container Service (ECS) console showing the "devops-020-280-cluster" (Fargate) cluster overview with status Active and CloudWatch Container Insights enabled. The services pane shows one active service ("devops-020-280-service") with two running tasks.
Overview — supported deployment controllers
  • 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.
Deployment controllers and strategy selection
  • 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.
Rolling update example and changing desired tasks Start a rolling update by selecting the service and clicking Update service. The UI shows task definition, desired task count, and rolling update settings.
A screenshot of the Amazon Elastic Container Service "Update" page in the AWS console. It shows the scheduling strategy set to REPLICA with Desired tasks = 4, Availability Zone rebalancing enabled, and deployment options (Rolling update selected).
Key points for changing desired task count:
  • In this demo the service starts with a desired count of 2 and is updated to 4.
  • ECS obeys minimum healthy percent and maximum percent during 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 percent reduces the number of running tasks during deployment at the expense of redundancy.
Load balancing and target groups
  • 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.
A screenshot of the Amazon Elastic Container Service console showing the "Load balancing" configuration for a service, including the VPC ID, selected Application Load Balancer, listener (HTTP:80) and target group. The left sidebar shows ECS navigation like Clusters, Task definitions and Account settings.
Deployment strategies available in the console
  • 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.
You can also enable lifecycle hooks (blue/green), set up CloudWatch alarms to trigger rollbacks, and use the deployment circuit breaker to auto‑rollback failing deployments.
A screenshot of the Amazon Elastic Container Service (ECS) Update page in the AWS console. It shows deployment strategy options (Rolling update, Blue/green, Canary, Linear) plus settings for min/max running tasks and deployment failure detection.
Lifecycle hooks (blue/green)
  • 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.
A screenshot of the Amazon Elastic Container Service (ECS) console on the service Update page, showing the "Deployment lifecycle hooks" section with fields for Lambda function, role, lifecycle stages, and hook details. A validation message at the bottom warns that at least one lifecycle stage must be selected.
Performing the update — observing progress and results
  • 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).
A screenshot of the Amazon Elastic Container Service (ECS) console showing a service's "Last deployment" page. It displays the deployment ID, status (Success), duration and timestamps, plus service revisions and task counts.
Task health, events, and troubleshooting
  • 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.
A screenshot of the Amazon Elastic Container Service (ECS) console on a service revision page showing the Tasks tab. It lists four tasks marked Running and Healthy, with a green "Service updated" notification banner across the top.
Canary and linear traffic shifting — behavior and examples
  • 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.
A screenshot of the Amazon Elastic Container Service console showing the "Deployment strategy" settings, with the "Linear" option selected. It displays fields for Linear step percent (set to 10) and Linear step bake time (set to 6 minutes).
Choosing the right deployment strategy — guidance table
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.
Fargate vs EC2-backed clusters
  • 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
A screenshot of the Amazon Elastic Container Service (ECS) web console showing the cluster overview for "devops-020-280-cluster" with status Active, CloudWatch monitoring, and 4 running tasks. The Services tab below lists one service (devops-020-280-service) and related details.
Other operational notes and best practices
  • 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.
References and further reading That concludes the walkthrough of ECS deployment methods in the console: rolling updates, blue/green (native + CodeDeploy), canary, and linear strategies — plus where to find lifecycle hooks, load balancer configuration, and task health details.

Watch Video

Practice Lab