> For the complete documentation index, see [llms.txt](https://developer.harness.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.harness.io/continuous-delivery/new-experience/use-deployments/ecs-deployments/step-library/ecs-scale.md). Agents can also search and read this documentation through its [MCP server](https://developer.harness.io/~gitbook/mcp).

# ECS Scale step

The ECS Scale step changes an ECS service's desired count without registering a new task definition or running a full deployment.

The ECS Scale step scales an ECS service up or down by changing its desired count, without registering a new task definition revision. Use this step to adjust capacity independently of a deployment, for example to scale a service down ahead of a maintenance window or back up afterward.

**Step Template ID:** `ecsScaleStep`

***

## ECS Scale step YAML

```yaml
- name: ECS Scale
  id: ecsScaleStep
  template:
    uses: ecsScaleStep
    with:
      desired_count: 4
      connector: ${{infra.connectorRef}}
      region: ${{infra.region}}
      cluster: ${{infra.cluster}}
      log_level: info
```

{% hint style="info" %}
**Template version pinning**

You can pin a specific template version with `uses: ecsScaleStep@<version>`, for example `ecsScaleStep@1.0.5`. Omitting the version resolves the latest available template.
{% endhint %}

***

## Before you begin

* **An ECS service:** Go to [ECS services](https://developer.harness.io/continuous-delivery/new-experience/use-deployments/ecs-deployments/ecs-services.md) to set up a service with a task definition and artifact source.
* **An ECS infrastructure definition:** Go to [ECS infrastructure](https://developer.harness.io/continuous-delivery/new-experience/use-deployments/ecs-deployments/ecs-infrastructure.md) to connect an AWS account and configure authentication.

***

## ECS Scale step fields

| Field             | YAML key        | Required | Default | Description                                       |
| ----------------- | --------------- | -------- | ------- | ------------------------------------------------- |
| **Desired Count** | `desired_count` | Yes      | —       | The target desired count to scale the service to. |

### Infrastructure configuration

Auto-resolved from the infrastructure definition.

| Field         | YAML key    | Default value             | Description                                       |
| ------------- | ----------- | ------------------------- | ------------------------------------------------- |
| **Connector** | `connector` | `${{infra.connectorRef}}` | AWS connector from the infrastructure definition. |
| **Region**    | `region`    | `${{infra.region}}`       | AWS region from the infrastructure definition.    |
| **Cluster**   | `cluster`   | `${{infra.cluster}}`      | ECS cluster from the infrastructure definition.   |

### Other configuration

| Field         | YAML key    | Default | Description                           |
| ------------- | ----------- | ------- | ------------------------------------- |
| **Log Level** | `log_level` | `info`  | Log verbosity for the step execution. |

***

## How the ECS Scale step works

When the step runs, Harness executes the following actions in order:

1. Resolves the ECS service to scale from the stage's service configuration, and the cluster, region, and connector from the infrastructure definition.
2. Calls the ECS update-service action to set the service's desired count to the value specified by **Desired Count**, without registering a new task definition revision.
3. Waits for the service to reach steady state at the new desired count.

***

## Next steps

* Go to [ECS Service Setup step](https://developer.harness.io/continuous-delivery/new-experience/use-deployments/ecs-deployments/step-library/ecs-service-setup.md) for the step that creates the service this step scales.
* Go to [ECS Basic Rollback step](https://developer.harness.io/continuous-delivery/new-experience/use-deployments/ecs-deployments/step-library/ecs-basic-rollback.md) for the rollback step used alongside this step.
* Go to [ECS step library](https://developer.harness.io/continuous-delivery/new-experience/use-deployments/ecs-deployments/step-library.md) for the full list of available steps.
