Deleting a service - Amazon Elastic Container Service

Deleting a service

You can delete an Amazon ECS service using the console. Before deletion, the service is automatically scaled down to zero. If you have a load balancer or service discovery resources associated with the service, they are not affected by the service deletion. To delete your Elastic Load Balancing resources, see one of the following topics, depending on your load balancer type: Delete an Application Load Balancer or Delete a Network Load Balancer. To delete your service discovery resources, follow the procedure below.

New console
  1. Open the new console at

  2. On the Clusters page, select the cluster for the service.

  3. On the Clusters page, choose the cluster.

  4. On the Cluster : name page, choose the Services tab.

  5. Select the services, and then choose Delete.

  6. At the confirmation prompt, enter delete me and then choose Delete.

Classic console

Use the following procedure to delete an Amazon ECS service.

  1. Open the Amazon ECS console at

  2. On the navigation bar, select the Region that your cluster is in.

  3. In the navigation pane, choose Clusters and select the name of the cluster in which your service resides.

  4. On the Cluster : name page, choose Services.

  5. Check the box to the left of the service to update and choose Delete.

  6. Confirm the service deletion by entering the text phrase and choose Delete.


To delete the remaining service discovery resources, you can use the AWS CLI to delete the service discovery service and service discovery namespace.

  1. Ensure that the latest version of the AWS CLI is installed and configured. For more information about installing or upgrading your AWS CLI, see Installing the AWS Command Line Interface.

  2. Retrieve the ID of the service discovery service to delete.

    aws servicediscovery list-services --region <region_name>

    If no service discovery service is returned, continue to step 4.

  3. Using the service discovery service ID from the previous output, delete the service.

    aws servicediscovery delete-service --id <service_discovery_service_id> --region <region_name>
  4. Retrieve the ID of the service discovery namespace to delete.

    aws servicediscovery list-namespaces --region <region_name>
  5. Using the service discovery namespace ID from the previous output, delete the namespace.

    aws servicediscovery delete-namespace --id <service_discovery_namespace_id> --region <region_name>