# Roll back a deploy (ECS service or Lambda alias)

Put an ECS service back on its previous task definition revision after checking which images change, or point a Lambda alias at an older version.

When a deploy goes wrong you can roll back from the phone. Both are [Pro](https://cloudconsole.dev/help/free-and-pro) actions, and you can try them in the [demo](https://cloudconsole.dev/help/demo-mode).

Screenshot: Roll back checkout-api: revision 42 to 41, one container image changes, one stays the same

## ECS service: previous revision

1. Open the service (**Services → ECS**, a cluster, the service) and tap **Roll back**. The button is greyed out on revision 1.
2. The app finds the newest active revision of the task definition that's older than the one running, and shows **Roll back** with the service name, *Revision 42 → 41* and when that revision was registered.
3. Under **Container images**, each container says *changes* (old tag → new tag, with the full image) or *same*. Check that's the image you want.
4. Tap **Review roll back to 41**, then confirm **Roll back**.

ECS starts a new deployment of the service's desired count on the older revision, within its deployment limits; watch it under **Deployments**. If no older active revision exists, the app says so and changes nothing. It needs `ecs:UpdateService`, plus `ecs:ListTaskDefinitions` and `ecs:DescribeTaskDefinition` to find and compare the revisions.

To have ECS roll back by itself next time, tap **Turn on circuit breaker**: a deployment whose tasks keep failing is marked FAILED and rolled back to the last one that completed.

## Lambda: point an alias at an older version

1. Open the function and scroll to **Versions & aliases**.
2. Next to the alias your callers use (for example `live`), tap **Change version**.
3. Pick a version (each shows its description and age) and tap **Review**.
4. Confirm **Roll back** (or **Point alias** when moving forward).

Callers that invoke the alias get that version from their next invocation. If the alias splits traffic between two versions, that weighted routing is removed and all traffic goes to the version you picked. It needs `lambda:UpdateAlias`.

This only works for published versions. Changes to `$LATEST` (memory, timeout, environment variables) don't reach an alias until you **Publish** a version and point the alias at it.

## Questions

### Does rolling back an ECS service delete the newer revision?

No. It only updates the service to run the older revision. The newer task definition revision stays registered, so you can roll forward again with a normal deploy.

### Why is Roll back greyed out?

The service is on revision 1 of its task definition, so there is nothing older to go back to.

**Still stuck?**

Email [support@cloudconsole.dev](mailto:support@cloudconsole.dev) with what you tried and any message the app showed. Don’t send access keys or secrets. We reply within two working days.

## Related

- [What you can change from your phone](https://cloudconsole.dev/help/actions) – Safety & changes
- ["What changed?": the changes before an alarm fired](https://cloudconsole.dev/help/what-changed) – Using the app
- [Guardrails: how changes are confirmed](https://cloudconsole.dev/help/guardrails) – Safety & changes
- [Permissions for changes (Pro actions)](https://cloudconsole.dev/help/permissions-for-changes) – Permissions & errors

[All help topics →](https://cloudconsole.dev/help/)

---

Source: https://cloudconsole.dev/help/roll-back-a-deploy

CloudConsole is an independent iPhone and Android app for Amazon Web Services by Cloudconcur Ltd. It is not affiliated with Amazon Web Services.
