Amazon ECS Support for VPC Lattice: Blue/Green, Linear, and Canary Deployments Explained
Amazon ECS now supports built-in blue/green, linear, and canary deployments for services that use VPC Lattice, with ECS shifting traffic by rewriting listener rule weights. This article walks through how it works, how to set it up, and the pitfalls to know beforehand, such as not modifying ECS-managed rules and keeping resources in the same account.
Introduction
On October 2, 2026, AWS announced that Amazon ECS now supports built-in blue/green, linear, and canary deployment strategies for services that use Amazon VPC Lattice. ECS services that use VPC Lattice can now release changes gradually, with ECS managing the traffic shifting for you.
VPC Lattice handles communication between services across multiple VPCs and AWS accounts. Until now, though, the built-in ECS deployment strategies could not be used with it.
The setup has a few pitfalls worth knowing in advance. For example, modifying a rule that ECS manages outside of ECS causes the deployment to fail, and the VPC Lattice resources must be in the same account as the ECS service. This article consolidates requirements that are spread across several documents, and it also covers points I could not confirm from official information. The article covers what changed, how it works, how to set it up, points to watch out for, and use cases, in that order.
What changed
With this announcement, ECS services that use VPC Lattice can use the built-in ECS deployment strategies and the related features around them. The table below compares the situation before and after.
Item | Before | After |
|---|---|---|
Deployment strategies | Services using VPC Lattice were not eligible for the built-in ECS blue/green, linear, and canary strategies | You can choose any of the three strategies in the ECS service configuration |
Related features | Gradual deployments combined with these features were not available | You can combine test traffic validation, validation and manual approval through Lambda hooks and pause hooks, automatic rollback with CloudWatch alarms and the deployment circuit breaker, and quick rollback with bake time |
The feature works with both new and existing services, and is available in all AWS Regions where VPC Lattice is available. You can configure it from the AWS Management Console, the AWS CLI, the AWS SDKs, or infrastructure as code (IaC) tools.
The three deployment strategies
All three strategies run the old and new versions side by side and gradually move production traffic to the new version. They differ in how traffic is shifted.
Strategy | How traffic is shifted | When it fits (rule of thumb) |
|---|---|---|
Blue/green | Shifts all traffic at once | You want to validate the new version beforehand and then switch over in one step |
Linear | Shifts traffic in equal increments, with a wait between steps | You run a high-traffic service and want to check the impact little by little |
Canary | Sends a small percentage of traffic to the new version first, waits, and then shifts the rest at once | You want to limit the blast radius and observe the new version before committing |
Where this fits among existing features
The ECS deployment features have been expanded step by step. Built-in blue/green deployments and deployment lifecycle hooks were added in July 2025, and linear and canary deployments followed in October of the same year. This announcement adds VPC Lattice to the supported traffic paths.
Whether ECS can manage the traffic shift depends on how the service receives traffic.
How the service receives traffic | ECS-managed traffic shifting |
|---|---|
ALB / NLB | Supported |
Service Connect | Supported |
VPC Lattice | Supported (added in this announcement) |
None of the above | Not supported (linear and canary cannot be used; blue/green can be used, but ECS does not manage the traffic shift) |
How it works
For an ECS service that uses VPC Lattice, ECS rewrites the weights on VPC Lattice listener rules to distribute traffic between the old and new versions. No new component is added in front of your application. ECS simply operates on the weights of the existing VPC Lattice rules as the deployment progresses.
Resources involved
The mechanism involves two target groups that register the tasks of the old and new versions, a production listener rule (required) on the listener of the VPC Lattice service, and a test listener rule (optional). ECS rewrites the weights of the production and test listener rules.
There are two target groups so that both versions can receive traffic at the same time. For convenience, I call the side that currently receives production traffic blue, and the side that receives the new version green. These names are not fixed. After a successful deployment, the former green target group becomes the current one at the next deployment, and the former blue target group receives the new version.
Traffic shifting flow
The sequence diagram below shows the flow of a blue/green deployment. The notes in the diagram show how the weights of the production rule change.

After the deployment completes, the old tasks are deregistered and stopped, but the blue target group stays at weight 0 and is reused in the next deployment.
For linear and canary deployments, the flow is the same: ECS operates only on the weights of the production rule. The difference is in the "change production rule weights" step, which changes the weights in one go for blue/green, or in several steps for linear and canary.
What happens on rollback
When a CloudWatch alarm or the deployment circuit breaker triggers, or when you roll back manually, ECS resets the rule weights and sends all traffic to the previous version. It then stops the tasks of the new version.
Because the old tasks are still running during bake time, this rollback only requires resetting the weights. No tasks need to be started again.
Setup
Setup has two stages: preparing the VPC Lattice resources, and adding settings to the ECS service. At the end, I also cover how to switch an existing service. Values enclosed in angle brackets (
< > ) in the code examples in this section are placeholders; replace them with values from your own environment.What to prepare
Prepare the following on the VPC Lattice side and around it.
Item | Requirement |
|---|---|
Target groups (two) | Use the IP target type and the same VPC as the ECS tasks. Set the protocol and port to match your application, and configure health checks. Both must be ACTIVE |
VPC Lattice service and listener | Complete the association with a service network or VPC so that clients can reach the service |
Production listener rule (required) | Set the action to forward and specify both target groups. Set the weight to 100 for the side that currently receives traffic and 0 for the other |
Test listener rule (optional) | Create it as a separate rule on the same service as the production rule. Match it with conditions that differ from production (such as a header or path), and give it a lower priority number than the production rule so that it is evaluated first |
Security group | In the security group of the ECS tasks, allow inbound traffic on the container port from the VPC Lattice managed prefix list |
IAM role | Prepare an infrastructure role that allows ECS to manage VPC Lattice resources |
The
forward actions of both the production rule and the test rule must include both target groups. ECS rejects rules that return a fixed response.The following example creates a production rule. It matches all requests whose path starts with
/ , and distributes them with a weight of 100 to the current target group and 0 to the other.aws vpc-lattice create-rule \ --service-identifier <service-id> \ --listener-identifier <listener-id> \ --name production \ --priority 100 \ --match '{"httpMatch":{"pathMatch":{"match":{"prefix":"/"}}}}' \ --action '{"forward":{"targetGroups":[ {"targetGroupIdentifier":"<target-group-id-1>","weight":100}, {"targetGroupIdentifier":"<target-group-id-2>","weight":0}]}}'Create the test rule in the same way. Name it
test , give it a priority lower than the production rule (for example, 10), and specify a header condition such as X-Environment: test in --match . For the commands that create the target groups, service, and listener, see the examples in the official documentation .ECS service configuration
In the ECS service, specify the VPC Lattice configuration and the deployment strategy. The following is an excerpt of the configuration for blue/green, based on the example in the official documentation.
{ "vpcLatticeConfigurations": [ { "roleArn": "arn:aws:iam::<account-id>:role/<infrastructure-role-name>", "targetGroupArn": "arn:aws:vpc-lattice:<region>:<account-id>:targetgroup/<target-group-id-1>", "portName": "<port-name>", "advancedConfiguration": { "alternateTargetGroupArn": "arn:aws:vpc-lattice:<region>:<account-id>:targetgroup/<target-group-id-2>", "productionListenerRule": "arn:aws:vpc-lattice:<region>:<account-id>:service/<service-id>/listener/<listener-id>/rule/<production-rule-id>", "testListenerRule": "arn:aws:vpc-lattice:<region>:<account-id>:service/<service-id>/listener/<listener-id>/rule/<test-rule-id>" } } ], "deploymentController": { "type": "ECS" }, "deploymentConfiguration": { "strategy": "BLUE_GREEN", "maximumPercent": 200, "minimumHealthyPercent": 100, "bakeTimeInMinutes": 5 }}The main fields are as follows.
Field | Description |
|---|---|
roleArn | The infrastructure role that allows ECS to manage VPC Lattice resources |
targetGroupArn | One of the two target groups |
alternateTargetGroupArn | The other of the two target groups |
portName | The name of the port mapping in the task definition that receives the traffic |
productionListenerRule | The ARN of the production rule |
testListenerRule | The ARN of the test rule (optional) |
deploymentController | Set the type to ECS |
strategy | One of BLUE_GREEN , LINEAR , or CANARY |
bakeTimeInMinutes | The time (in minutes) during which both service revisions run simultaneously after production traffic has shifted |
If you do not configure a test rule, ECS skips test traffic routing.
Linear and canary
For linear and canary, the VPC Lattice part of the configuration is the same. Only
strategy and the strategy-specific settings inside deploymentConfiguration change. Common fields such as bakeTimeInMinutes are specified in the same way as for blue/green.Strategy | strategy | Setting | Meaning | Default | Valid range |
|---|---|---|---|---|---|
Linear | LINEAR | stepPercent in linearConfiguration | Percentage of traffic shifted in each step (%) | 10.0 | 3.0–100.0 (in 0.1 increments) |
Linear | LINEAR | stepBakeTimeInMinutes in linearConfiguration | Wait time between steps (minutes) | 6 | 0–1440 |
Canary | CANARY | canaryPercent in canaryConfiguration | Percentage of traffic sent first (%) | 5.0 | 0.1–100.0 (in 0.1 increments) |
Canary | CANARY | canaryBakeTimeInMinutes in canaryConfiguration | Time to observe before shifting the rest (minutes) | 10 | 0–1440 |
Choose the actual values based on your service's traffic volume and how long it takes for an alarm to detect a problem.
Switching an existing service
A service that already uses VPC Lattice and is deployed with the rolling update strategy can be switched by adding the configuration. Add the other target group and the production rule (and the test rule, if needed) to
advancedConfiguration . You can do this in the same update that changes the strategy, or in a separate update beforehand.In the first gradual deployment, traffic shifts to the other target group. Note that the target group currently in use does not necessarily keep receiving production traffic.
Points to watch out for
This section covers points to keep in mind before adopting the feature.
Do not modify the rules that ECS manages
During a deployment, ECS rewrites the
forward actions of the production and test rules to shift traffic. Therefore, after the initial setup, do not modify the forwarding targets of these rules outside of ECS. For example, if a rule points at both target groups, or at neither of them, when a deployment starts, the deployment fails.Keep the resources in the same account as the ECS service
The VPC Lattice target groups, service, and listener rules must be in the same account as the ECS service. The "across multiple accounts" capability applies to the service-to-service communication through VPC Lattice. It does not mean the resources that manage the deployment can be placed in other accounts.
Deployments involve wait times
For services that use VPC Lattice, ECS waits at the following stages so that target registrations and weight changes can be reflected in the VPC Lattice data plane.
Stage | Wait time |
|---|---|
POST_SCALE_UP | Approximately 3 minutes (until the new tasks are healthy) |
TEST_TRAFFIC_SHIFT , PRODUCTION_TRAFFIC_SHIFT , RECONCILE_SERVICE | Approximately 90 seconds after each weight change |
A canary deployment changes the weights twice, and a linear deployment changes them once per step. A linear deployment with more steps therefore takes longer. Bake time and the wait times specific to linear and canary are added on top.
For reference, a third-party test of blue/green with the bake time set to 2 minutes took about 10 minutes from the start of the update to completion (this is a single measurement). When time is tight, such as for an urgent hotfix release, you need to plan your operations around this duration.
Task count increases during bake time
During bake time, both the old and new versions run side by side. If you set
maximumPercent to 200 as in the configuration example above, up to 200% of the service's desired task count can run temporarily during the deployment. A longer bake time improves safety, but it also extends the time during which the additional tasks keep running.Using multiple VPC Lattice configurations
If a single ECS service uses multiple VPC Lattice configurations, each configuration needs its own pair of target groups and its own production rule. ECS shifts the rules of each configuration independently. In addition, a single listener rule can be used by only one configuration within the same service.
Deployment controller and CodeDeploy
To use this feature, set the deployment controller of the service to
ECS . A third-party test reports that blue/green deployments with CodeDeploy (the CODE_DEPLOY controller) cannot be used with VPC Lattice, but I could not find an explicit statement in the official documentation. If you plan to migrate a service that already uses CodeDeploy, check this in advance.What I could not confirm
From the official documentation and the third-party test article I read, I could not confirm the following points.
Item | Status |
|---|---|
The default value of the overall bake time ( bakeTimeInMinutes ) | Not confirmed. It is safest to specify the value explicitly |
Actual duration of linear and canary deployments | The official documentation gives a guide for wait times, but I could not confirm measured results on VPC Lattice. The third-party test covers only blue/green, and it is a single measurement |
Actual behavior of rollback, hooks, and the circuit breaker | I confirmed the official descriptions, but not the results of actually running them on VPC Lattice |
The rollback procedure after bake time ends | Not described on the VPC Lattice page |
Before going to production
The configuration examples in this article are based on the official documentation. Before applying them to production, I recommend verifying the actual behavior in a staging environment, including not only blue/green but also linear, canary, and rollback.
Use cases
This section describes three scenarios where this update should be useful. All of them are assumed scenarios, and the numbers are examples.
Try a high-impact API with a small amount of traffic
Consider an API such as payments, called from services in multiple accounts and VPCs. Because a failure has a large impact, you use a canary deployment to send only a portion of requests to the new version and check the error rate and latency in CloudWatch. If you configure CloudWatch alarms, ECS rolls back automatically as soon as an anomaly is detected. Callers continue to access the VPC Lattice service in the same way as before, so no changes are needed on the caller side.
Validate with test traffic before switching to production
When you want to verify behavior in the production environment before switching, combine blue/green with a test listener rule. If you deliver only requests that carry a specific header to the new version, you can validate it without affecting production traffic. You can also run automated tests with a Lambda hook, or use a pause hook to wait for an approver before switching production. Note that test listener rules and lifecycle hooks can also be used with linear and canary deployments.
Shift a high-traffic API gradually
For a service where a single switch makes it hard to see the load impact of the new version, linear is a good fit. For example, shift 10% at a time and check the metrics between steps. However, the more steps you have, the longer the deployment takes. As described in the section on points to watch out for, the wait times make this a good approach for regular releases where time is not tight.
Choosing a strategy by scenario
Scenario | Strategy | Main settings |
|---|---|---|
Try a high-impact API with a small amount of traffic | Canary | canaryPercent , canaryBakeTimeInMinutes , CloudWatch alarms |
Validate with tests before switching production | Blue/green | Test listener rule, Lambda hook, pause hook |
Shift a high-traffic API gradually | Linear | stepPercent , stepBakeTimeInMinutes , CloudWatch alarms |
Choose the strategy based on the nature of your service and how much time you can spend on a release.
Summary
With this update, ECS services that use VPC Lattice can now use the three deployment strategies (blue/green, linear, and canary) as standard ECS features. The core of the mechanism is that ECS rewrites the weights of VPC Lattice listener rules to shift traffic.
There are also operational points to keep in mind: do not modify the rules that ECS manages from outside, keep the resources in the same account as the ECS service, and expect the deployment to take some waiting time. The table below lists the next step for each situation.
Situation | Next step |
|---|---|
You already have an ECS service that uses VPC Lattice | Prepare the other target group and a production rule, add advancedConfiguration , and start with blue/green |
You are asked for gradual releases | Choose canary or linear, and set up automatic rollback with CloudWatch alarms |
You deploy with CodeDeploy | The deployment controller must be ECS , so check in advance whether and how you can migrate |
You are considering adopting VPC Lattice | Add gradual deployments on ECS to the list of factors you consider |
References
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article