Amazon Web Services has launched a new built-in blue/green deployment feature for Amazon Elastic Container Service (ECS). This capability allows development teams to deploy containerised applications safely whilst maintaining the ability to roll back near-instantaneously if issues arise, and makes a complex workaround using AWS CodeDeploy unnecessary.
The new feature addresses a common challenge faced by development teams who previously had to build and maintain custom tooling for blue/green functionality during releases to ECS. “At scale, development teams spend valuable cycles building and maintaining undifferentiated deployment tools instead of innovating for their business,” explained Donnie Prakoso, Principal Developer Advocate at AWS and author of the announcement.
Blue/green deployment is a software release strategy that maintains two identical production environments. The existing “blue” environment continues serving live traffic, while a new “green” environment is created when a new application version is to be deployed. After thorough testing and monitoring of the green environment, traffic is routed from blue to green, ensuring minimal user disruption and an easy rollback to the previous version if that is needed.
Prior to this announcement, AWS customers wanting blue/green deployment capabilities on ECS had to rely on AWS CodeDeploy, which required additional configuration and setup complexity. Engineers had various options to work around this, including swapping auto-scaling groups behind a Load Balancer and updating auto-scaling group launch configurations. The CodeDeploy approach, whilst functional, required teams to create separate CodeDeploy applications and deployment groups and manage complex IAM roles. AWS CodeDeploy managed the blue/green deployment process, but teams still had to configure Load Balancer listeners and target groups manually. Amazon ECS now orchestrates this entire workflow automatically, providing event hooks that allow teams to validate new software versions using synthetic traffic before exposing them to end users.
In the context of the new announcement, Chris Musther from The Scale Factory wrote on LinkedIn: “It was possible to do via CodeDeploy and was outlined in the docs – this just makes it simpler and more feature rich.”
The new capability integrates directly with existing ECS configurations and can be enabled through the ECS console, AWS CLI, or infrastructure as code tools. Users can configure how long instant rollback to blue remains available after production traffic shifts to the green environment, known as the “bake time.” Each service revision maintains immutable configuration, including task definition, load balancer settings, and Service Connect configuration, so that rollbacks will always restore exactly the same environment that was previously running.
During deployment, ECS automatically invokes Lambda functions at specified lifecycle stages, allowing comprehensive testing against the green revision. The six deployment lifecycle hooks are: pre-scale-up, post-scale-up, production traffic shift, test traffic shift, post-production traffic shift, and post-test traffic shift. These hooks can trigger AWS Lambda functions to perform custom validation logic, such as synthetic testing, API calls, or metrics queries, to check application health, run integration tests, or validate performance metrics before signalling whether to proceed or abort the deployment.
My validation function can run comprehensive tests against the green revision—checking application health, running integration tests, or validating performance metrics.
– Donnie Prakoso
Other major cloud providers already have similar blue/green deployment strategies for containerised applications that aren’t running on their own hosted Kubernetes services. Microsoft Azure provides blue/green deployment capabilities through Azure Container Apps, using container app revisions, traffic weights, and revision labels to achieve blue/green. The platform allows users to create instances of blue and green application versions, test and verify new revisions, then redirect traffic accordingly. Similarly, Google Cloud Run supports gradual rollouts and rollbacks to achieve blue/green deployment.
Other industry reactions have been positive, though one Reddit commenter ponders the cutover’s atomicity for busy services:
Good move by AWS—built‑in blue/green for ECS is a game changer for zero‑downtime deploys. Curious how clean the traffic shift is under load.
The blue/green deployment capability is included with Amazon ECS at no additional charge. Users pay only for the compute resources used during the deployment process. The feature is available across all commercial AWS regions.