Ninja Docs Help

Restart ECS Services

Revision

Date

Description

1.0

24.07.2024

Init Changelog

Introduction

This article explains how to restart ECS Services (containers).

AWS Management Console

Follow steps below to restart ECS Services with AWS Management Console:

  • Sign in to the AWS Management Console.

  • In the Search Box type ECS and choose Elastic Container Service.

  • On the Clusters page, select the cluster by clicking its name.

  • On the Cluster overview page, select the service, and then choose Update.

  • Select Force new deployment.

  • Select Update at the bottom of the page.

  • Wait for containers to roll out.

AWS Command Line Interface

Follow steps below to restart ECS Services with AWS CLI. You can skip to third (3) step if you've got all needed information (cluster_name and service_name):

  1. List ECS clusters for getting full name:

    aws ecs list-clusters

    possible output:

    { "clusterArns": [ "arn:aws:ecs:<region>:<account_id>:cluster/<cluster_name>" ] }
  2. List ECS services for Cluster:

    aws ecs list-services --cluster <cluster_name>

    possible output:

    { "serviceArns": [ "arn:aws:ecs:<region>:<account_id>:service/<service_name>" ] }
  3. Restart service by updating it with force flag:

    aws ecs update-service --cluster <cluster_name> --service <service_name> --force-new-deployment
  4. Wait for service rollout (command will wait until its done):

    aws ecs wait services-stable --cluster <cluster_name> --service <service_name>
Last modified: 17 February 2025