Skip to content

[FEAT] ECS: EC2 launch-type services need container instances so tasks can place and reach steady state #2708

Description

@matanbaruch

Service

ECS

API Action / Feature

EC2 launch-type support for services: RegisterContainerInstance (or an emulated equivalent), task placement onto container instances, and services reaching a steady state (runningCount >= desiredCount) so DescribeServices/waiters complete.

AWS Documentation

Why is this needed?

A CreateService with launchType: EC2 never reaches steady state: with no registered container instances in the cluster there is nowhere to place tasks, so tooling that waits on the service (terraform/pulumi with wait_for_steady_state, CLI waiters) hangs until timeout and the deployment fails.

Repro:

  1. Create a cluster and a task definition (both work fine today).
  2. aws ecs create-service --launch-type EC2 --desired-count 1 ...
  3. aws ecs describe-services ... stays at runningCount 0 forever; a steady-state waiter times out.

Fargate-style placement without instances is not a workaround for tooling that pins launchType: EC2.

For the emulator a faithful ECS agent is probably out of scope; an emulated registration path (e.g. an implicit default container instance per cluster, or a lightweight RegisterContainerInstance that makes placement succeed) would be enough for EC2-launch services to run their containers and report steady state.

#2482 is active on ECS services but does not touch container instances or placement.

Are you willing to contribute a PR?

  • Yes
  • No

Happy to take a run at it if you can sketch the direction you would accept (implicit default instance vs a real RegisterContainerInstance surface).

Metadata

Metadata

Assignees

No one assigned

    Labels

    ec2Amazon Elastic Compute Cloud (EC2)ecsAmazon Elastic Container Service (ECS)enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions