Amazon ECS Express Mode Now Supports Custom Task Definitions
A look at the new custom task definition support in Amazon ECS Express Mode, covering how it enables sidecar containers, custom health checks, and FireLens log routing, along with the architecture behind it and the steps to enable it.
Introduction
On July 1, 2026, AWS announced support for custom task definitions in Amazon ECS Express Mode. You can now attach your own task definition to a service created with Express Mode, extending it beyond the auto-generated task definitions it previously relied on to match your own requirements.
If you've tried Express Mode on ECS, you may have run into requirements — adding a sidecar container, configuring a custom health check, switching log destinations with FireLens — and held off on using it in production because of these limitations, despite how convenient it otherwise is. This update addresses that gap directly.
This article walks through what changed, which organizations and teams get the most value from it, and how the architecture works and how to enable it. It's written for engineers operating ECS, and for anyone considering migrating an existing workload to Express Mode.
What Is Express Mode?
Amazon ECS Express Mode is a feature announced in November 2025 that lets you launch a production-ready service on ECS with just a container image and minimal configuration. Creating a service only requires three inputs:
Input | Description |
|---|---|
Container image | The container image for the application you want to deploy |
Task execution role | The IAM role ECS uses to pull the image and write logs |
Infrastructure role | The IAM role ECS uses to create and manage supporting resources such as the ALB |
From these inputs, Express Mode automatically assembles components you'd otherwise have to design and build individually — Application Load Balancer (ALB) load balancing, HTTPS termination, Auto Scaling, and CloudWatch monitoring.
ALB Sharing for Cost Optimization
One of Express Mode's distinctive mechanisms is ALB sharing. Using host-header-based routing, up to 25 Express Mode services can share a single ALB, reducing costs compared to giving each service its own ALB. All resources Express Mode creates also live in your own account and can be viewed and modified directly through the console or the API, so there's no trade-off between convenience and visibility into what's running.
The Previous Assumption: Auto-Generated Task Definitions
Until now, though, Express Mode assumed it would auto-generate the task definition whenever you created or updated a service. You could adjust basic settings — container image, CPU, memory, environment variables — through Express Mode's own input parameters, but bringing your own task definition and swapping it in wasn't supported. That's the assumption this update changes, as covered in the next section.
What Changed
You may never have thought much about how Express Mode handled task definitions. In fact, there was no way to specify a task definition directly when creating or updating a service — Express Mode generated one internally from a limited set of inputs like container image, CPU, and memory.
| Before | After this update |
|---|---|---|
How the task definition is specified | Auto-generated by Express Mode from its inputs | You can specify an existing task definition directly |
Compatibility with CI/CD and IaC | Can't bring in existing task definition assets | Can reuse task definitions already managed by a pipeline |
Advanced configuration | Not supported | Supports sidecars, health checks, FireLens, and more |
The Previous Limitation
Configurations like adding a sidecar container for observability or security, setting a detailed per-container health check, or switching log routing with FireLens are routine for anyone running ECS outside of Express Mode. Until now, though, Express Mode couldn't go beyond its auto-generated task definition, so as soon as you needed one of these, you had to either give up on Express Mode or move to the standard ECS workflow.
How Custom Task Definition Support Solves This
With this update, passing the
--task-definition-arn option to the create-express-gateway-service AWS CLI command lets you attach an existing task definition to an Express Mode service. That makes it possible to add observability or security sidecar containers, configure detailed per-container health checks, tune ulimits and Linux runtime settings, and customize log destinations with FireLens — none of which were possible before.Once you've attached a custom task definition to an Express Mode service, you're not locked into a single way of managing it going forward (Chapter 6 covers the specifics). You can continue managing the service either by updating the task definition directly or through the Express Mode API. Express Mode still handles the infrastructure side — load balancing, Auto Scaling, canary deployments — so you get both the flexibility of your own task definition and the operational simplicity of Express Mode, which is really the core of this update.
Which Organizations Need This
Custom task definition support doesn't benefit every Express Mode user equally — it's most valuable to teams with specific needs. Before adopting it, it's worth checking whether your situation is one it's actually meant for.
This feature is most useful for teams migrating an existing ECS workload to Express Mode that already relies on sidecar containers or FireLens, teams that want to reuse task definitions already managed by a CI/CD pipeline or IaC within Express Mode, and platform teams that want to distribute task definitions with baked-in observability or security requirements to application developers. On the other hand, if you just want to quickly publish a simple stateless web application or API, Express Mode's existing input parameters are often enough on their own, and there's no need to force in a custom task definition.
To attach a custom task definition to an Express Mode service, it needs to meet a few requirements around things like the container name and port mapping format. The next chapter covers these requirements and the design considerations in detail.
Architecture
Let's take a closer look at what custom task definition support actually changes.

The key point is that the structure of an Express Mode service itself hasn't changed. Express Mode still handles the infrastructure side — ALB-based load balancing, Auto Scaling, CloudWatch monitoring, and canary deployments — just as before. What's changed is a single thing: whether the ECS task definition running underneath is auto-generated by Express Mode, or supplied by you.
Task Definition Requirements
A task definition you provide yourself needs to meet the following requirements:
Requirement | Description |
|---|---|
Container name | Must include exactly one container named Main |
Port mapping | The Main container must have a single TCP port mapping, with both a container port and a port name |
Launch type | Must be compatible with FARGATE (the EC2 launch type isn't supported as-is) |
Parameter exclusivity | taskDefinitionArn can't be combined with primaryContainer, executionRoleArn, taskRoleArn, cpu, or memory in the same API call |
Express Mode treats the
Main container as the application's inbound port and registers it with the ALB target group. When you specify taskDefinitionArn , values like CPU, memory, and the execution role are derived automatically from the task definition, so there's no way to override them from outside it. Any CPU and memory allocation, or IAM role configuration, needs to be fully defined within the task definition itself.Adding Sidecar Containers
To add a sidecar container, you just define it in the same task as the
Main container. Tasks using the awsvpc network mode share a network namespace across containers within the same task, so you can bring over the same patterns you'd use elsewhere in ECS — for example, having an observability or security agent communicate with the Main container over localhost .
Enabling the Feature
Let's walk through the steps to create an Express Mode service with a custom task definition. This section focuses on creating a service with the AWS CLI and confirming the result afterward.
Prepare a Task Definition
First, register a task definition as a normal ECS task definition that includes a
Main container and meets the requirements from the previous chapter. Define any sidecar containers or FireLens configuration within this same task definition.Create a Service with the AWS CLI
Pass the ARN of the registered task definition to the
--task-definition-arn option of the create-express-gateway-service command.aws ecs create-express-gateway-service \ --infrastructure-role-arn arn:aws:iam::<account-id>:role/ecsInfrastructureRoleForExpressServices \ --task-definition-arn arn:aws:ecs:<region>:<account-id>:task-definition/<task-definition-family>:<revision> \ --health-check-path "/health" \ --monitor-resources
When you specify
--task-definition-arn , you can't also specify --primary-container , --execution-role-arn , --task-role-arn , --cpu , or --memory — all of these values are derived from the task definition. Adding --monitor-resources lets you follow the resource provisioning progress directly, and once it completes, it returns service information including the ARN and URL.Creating from CloudFormation
If you're using AWS CloudFormation, you can specify the task definition ARN the same way, through the
TaskDefinitionArn property of the AWS::ECS::ExpressGatewayService resource. The console, Terraform, and the SDKs are also expected to expose an equivalent parameter, but at the time of writing, we haven't confirmed the exact screen or field for each of them. Check your tooling's version and the official documentation before you adopt this through one of them.Updating the Task Definition on an Existing Service
You can also attach a custom task definition after the fact, or switch to a different task definition revision, on a service you've already created — by passing
--task-definition-arn to the update-express-gateway-service command.aws ecs update-express-gateway-service \ --service-arn <service-arn> \ --task-definition-arn arn:aws:ecs:<region>:<account-id>:task-definition/<task-definition-family>:<revision> \ --monitor-resources
As with
create-express-gateway-service , specifying --task-definition-arn here means you can't also specify --primary-container , --execution-role-arn , --task-role-arn , --cpu , or --memory . Register a new revision on the task definition side and pass its ARN to this command, and it's reflected on the service.Verifying After Creation
Confirm that the service is
ACTIVE and that it's using the task definition you intended.What to check | Command / method |
|---|---|
Service status | aws ecs describe-express-gateway-service --service-arn <service-arn> |
Deployment progress | aws ecs monitor-express-gateway-service --service-arn <service-arn> |
Task definition in use | Check the taskDefinitionArn field in the describe-express-gateway-service response |
Application connectivity | Access the issued URL (https://<service-name>.ecs.<region>.on.aws/) and confirm the response |
Whether you update the service by changing the task definition or by using
update-express-gateway-service as shown above, you can keep operating it without switching approaches partway through.
Use Cases
With all of that in mind, let's look at a few concrete scenarios where this feature comes in handy.
Migrating an Existing ECS Workload to Express Mode
If your team already manages task definition JSON in a CI/CD pipeline and registers new revisions with
register-task-definition , you can pass that same task definition's ARN directly to --task-definition-arn and get the benefit of Express Mode's ALB sharing and Auto Scaling. The big win here is that you don't have to rebuild your task definition to fit Express Mode, and changes to your pipeline are kept to a minimum.Strengthening Observability with AWS Distro for OpenTelemetry (ADOT)
This is useful when you want to add the ADOT Collector as a sidecar to collect metrics and traces from your application. The ADOT Collector runs as a sidecar in the same task, so your application container only needs to send telemetry to a local endpoint such as
localhost:4317 . Include this setup directly in your task definition and pass it to Express Mode, and you get the same integration with destinations like CloudWatch, AWS X-Ray, or Amazon Managed Service for Prometheus that you'd have outside Express Mode.Forwarding Logs to an External Logging Platform with FireLens
This also helps organizations that have standardized on a logging platform such as Datadog, Splunk, or Amazon OpenSearch Service. Include a FireLens Fluent Bit sidecar in your task definition, set your application container's log driver to
awsfirelens , and logs from your Express Mode service flow into the same logging platform as everything else.
Summary
This article covered custom task definition support in Amazon ECS Express Mode. Now that you can attach an existing task definition directly to an Express Mode service, configurations that weren't possible before — sidecar containers, custom health checks, log routing with FireLens — are all on the table, letting you take advantage of Express Mode's simplicity while still making use of your existing ECS workloads and CI/CD assets.
That said, this feature isn't something every Express Mode user needs. If you just want to quickly publish a simple, stateless application, Express Mode's existing input parameters are often all you need. If you do use a custom task definition, keep in mind the requirements it needs to meet — the
Main container name, its port mapping, and FARGATE compatibility — as you plan your adoption.This feature is available at no additional charge, in every AWS Region where Amazon ECS Express Mode is available. For tooling beyond the CLI and CloudFormation, such as the console or Terraform, check the latest official documentation before you adopt it.
References
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article