Extending Amazon ECS Express Mode for Custom Container Environments
This post details how to customize Amazon ECS Express Mode services by extending default configurations to meet specific workload requirements. It demonstrates three practical examples: enabling ECS Exec for troubleshooting, adding scheduled scaling for predictable traffic, and integrating FireLens for custom log routing via a sidecar container. The article also clarifies which service-level settings are restricted in Express Mode, helping users decide if it suits their needs or if a standard ECS service is more appropriate.
- →Overview of ECS Express Mode and its default resources
- →Customizing ECS Express Mode services via AWS APIs
- →Limitations of ECS Express Mode deployment and load balancing
- →Enabling ECS Exec for troubleshooting and debugging
- →Implementing scheduled scaling for predictable traffic patterns
Enhancements (4) ›
- Customizing ECS Express Mode services via AWS APIs
Users can extend ECS Express Mode services by modifying the created AWS resources using ECS and other AWS service APIs. This includes adding task roles for ECS Exec or application permissions, configuring additional scaling policies, customizing ALB listener rules, and adjusting CloudWatch Logs retention. The mode also supports custom task definitions for advanced configurations like sidecar containers and custom health checks.
- Enabling ECS Exec for troubleshooting and debugging
The post explains how to enable ECS Exec by adding a task role with SSM permissions to the Express Mode service. This allows users to run commands directly within containers, facilitating troubleshooting. The configuration includes setting up CloudWatch logging for Exec session output and forcing a new deployment to ensure new tasks have the SSM Agent and permissions.
- Implementing scheduled scaling for predictable traffic patterns
This section covers adding scheduled scaling policies to an ECS Express Mode service. It demonstrates how to configure schedules to automatically adjust the minimum task count based on predictable traffic, such as provisioning more capacity during peak hours and scaling down during off-peak times.
- Integrating FireLens as a sidecar container for custom log routing
The article guides users on adding a FireLens log router as a sidecar container using a custom task definition within an ECS Express Mode service. This allows for advanced log routing capabilities, directing application logs to preferred destinations beyond the default CloudWatch Logs.
Notes (2) ›
- Overview of ECS Express Mode and its default resources
ECS Express Mode simplifies container deployment by pre-configuring resources like clusters, task definitions, services with canary deployments and auto-scaling, Application Load Balancers, security groups, and CloudWatch log groups. It automates the creation of standard AWS resources with default settings, allowing users to deploy containerized applications quickly.
- Limitations of ECS Express Mode deployment and load balancing
ECS Express Mode restricts two service-level settings: it exclusively uses canary deployments and provisions an Application Load Balancer (ALB) for each service. Users requiring rolling updates, blue/green deployments, or Network Load Balancers (NLB) for TCP/UDP passthrough or gRPC without HTTP/2 termination should opt for standard ECS services.
https://aws.amazon.com/blogs/containers/extending-amazon-ecs-express-mode-to-build-an-optimal-container-environment/
Related releases
- Centralize ECS telemetry with ADOT gateway AWS Containers Blog ·
- Amazon ECS supports fractional GPU scheduling with EC2 G6f instances AWS What's New ·
- AWS Network Firewall adds forward proxy functionality AWS What's New ·
- Run GPU batch inference on ECS with scale-to-zero managed instances AWS Containers Blog ·
- CloudWatch adds managed Prometheus collectors AWS What's New ·
- AWS CodeDeploy Expands to Five New Regions AWS What's New ·