AWS: Update an ECS Service
AvailabilityThis workflow action is available to customers on PD Reliability Platform plans. See PD Reliability Platform plans for more information.
Description
Update an Amazon ECS service's task definition or desired count, or force a new deployment, in any combination in a single call. You must provide at least one of Task Definition, Desired Count, or Force New Deployment.
This action is useful for:
- Rollback: Point the service at a previous task definition to roll back a bad release.
- Scaling: Increase or decrease the desired task count in response to load or capacity needs.
- Restart: Force a new deployment to replace all running tasks, even when the task definition has not changed (for example, to pick up new secrets or configuration, or to clear a stuck task).
Instructions
- If you have not done so, follow the instructions to Create an Incident Workflow.
- When the instructions prompt you to add actions, select this action.
- Enter the following Inputs and click Save.
- Continue following instructions to Publish the Workflow.
- When the action runs, you will see the Outputs listed below.
Inputs
Field ReferencesFields with the {+} icon accept Field References, which can be useful for referencing incident data or outputs created in prior workflow steps. To add Field References, click {+}, or enter
{{, and select relevant fields. Refer to the Field References article for more information.
| Name | Description |
|---|---|
| Integration (Required) | Select a Workflow Integration or click New AWS Connection to establish a new one. |
| AWS Region | The AWS region where the ECS cluster is located (for example, us-west-2). If left blank, the action uses us-east-1. |
| Cluster (Required) | The ECS cluster name or ARN. |
| Service Name (Required) | The name of the ECS service to update. |
| Task Definition | The new task definition, as family:revision or a full ARN. Leave blank to keep the current task definition. |
| Desired Count | The new desired task count. Must be non-negative. Leave blank to keep the current count. |
| Force New Deployment | Force replacement of all running tasks, even if the task definition has not changed. Default: false. |
Outputs
| Name | Description |
|---|---|
| Service Name | The service that was updated. |
| Task Definition | The task definition ARN now active on the service. |
| Desired Count | The desired count after the update. |
| Running Count | The running task count at the time of the response. |
| Deployment Status | The status of the primary deployment (for example, PRIMARY). |
| Result | Value that shows if the action was successful or not. Either "Success" or "Failed." |
| Result Summary | Brief description of what the action did or if it failed. |
| Error | Brief description that is populated if the action failed. |
Tips
- Rollback runbook: Use Describe Task Definition or your CI/CD records to identify the last-known-good task definition ARN, then enter it in Task Definition to roll back.
- Running Count is a snapshot: A deployment triggered by this action, whether from a new task definition or a forced deployment, takes time to complete. Running Count and Deployment Status reflect the state immediately after the API call returns, not the final steady state. To confirm that the rollout finished, add a Logic: Delay step and a follow-up check to the workflow.
- Combine parameters: You can set a new Task Definition and a new Desired Count in the same call. You can combine Force New Deployment with either, or use it alone to restart tasks without changing anything else.
Updated about 2 hours ago
Did this page help you?
