TalksAWS re:Invent 2025 - Deep Dive: ECS Managed Instances & Blue/Green for Resilient Services (CNS416)

AWS re:Invent 2025 - Deep Dive: ECS Managed Instances & Blue/Green for Resilient Services (CNS416)

AWS re:Invent 2025 - Deep Dive: ECS Managed Instances & Blue/Green for Resilient Services

Overview of Amazon ECS

  • Amazon ECS is a tier-one service that is a prerequisite for any new AWS region
  • ECS launches over 3 billion tasks per week across all regions
  • Over 65% of new AWS customers start with ECS due to its simplicity and integration with other AWS services
  • ECS powers many internal AWS services like Amazon SageMaker, Amazon Lex, and Amazon Polly

ECS Managed Instances

Shared Responsibility Model

  • ECS on EC2 allows customers to bring their own EC2 instances and manage the underlying infrastructure
  • ECS Fargate is a fully serverless offering where AWS manages all the infrastructure
  • ECS Managed Instances aims to provide the flexibility of ECS on EC2 with the simplicity of Fargate

Key Features

  • ECS Managed Instances is built on top of EC2 Managed Instances, allowing AWS to manage the EC2 instances on the customer's behalf
  • Customers provide two IAM roles - one for the instance and one for infrastructure management
  • Instances are automatically provisioned, patched, and replaced by ECS to maintain compliance
  • Customers can specify compute requirements at the task definition level, and ECS will provision the appropriate EC2 instances
  • ECS uses a "first fit descending" approach to pack tasks onto the largest available instances to optimize cost and throughput

Patching and Host Replacement

  • ECS Managed Instances replaces instances every 30 days to apply OS and security patches
  • Instances are replaced during customer-defined maintenance windows to minimize disruption
  • Unmanaged tasks are the last to be deprovisioned during host replacement to ensure availability

When to Use ECS Managed Instances

  • Recommended for customers who need more flexibility than Fargate, such as larger task sizes or specific instance types
  • Useful for workloads that can benefit from the elasticity and burst capabilities of larger EC2 instances
  • Provides a good balance between the control of ECS on EC2 and the simplicity of Fargate

ECS Deployments

Blue/Green Deployments

  • Blue/Green deployments allow customers to deploy a new version of a service in parallel with the current production version
  • The deployment process includes preparation, deployment, testing, traffic shift, monitoring, and cleanup phases
  • Deployment lifecycle hooks allow customers to run custom validation tests at each phase
  • Traffic is instantly shifted from the blue (current) version to the green (new) version when ready

Linear Deployments

  • Linear deployments gradually shift traffic from the current (blue) version to the new (green) version over time
  • Traffic is shifted in increments (e.g., 25%, 50%, 75%, 100%) with validation checks at each step
  • Allows for a more conservative, step-by-step approach to rolling out a new service version

Canary Deployments

  • Canary deployments start by directing a small portion (e.g., 10%) of traffic to the new (green) version
  • After validation, the remaining traffic is instantly shifted to the new version
  • Provides a middle ground between the speed of blue/green and the caution of linear deployments

Choosing the Right Deployment Strategy

  • Blue/green is best for fast, high-confidence deployments
  • Linear is recommended for more conservative, step-by-step rollouts
  • Canary is a compromise, allowing for gradual validation before full rollout

Key Takeaways

  • ECS Managed Instances provides the flexibility of EC2 with the simplicity of Fargate, allowing customers to focus on their applications
  • ECS deployments offer multiple strategies (blue/green, linear, canary) to suit different application needs and risk profiles
  • Deployment lifecycle hooks enable customers to integrate custom validation and testing into the deployment process
  • AWS aims to bake in best practices and operational experience into the ECS service to simplify infrastructure management for customers

Additional Resources

Your Digital Journey deserves a great story.

Build one with us.

Cookies Icon

These cookies are used to collect information about how you interact with this website and allow us to remember you. We use this information to improve and customize your browsing experience, as well as for analytics.

If you decline, your information won’t be tracked when you visit this website. A single cookie will be used in your browser to remember your preference.