aws ecs delete-service
Deletes a specified service within a cluster. AWS CLI reference
1 example 3 options Its page in the AWS CLI reference
Examples
To delete a service
The following delete-service example deletes the specified service from a cluster. You can include the --force parameter to delete a service even if it has not been scaled to zero tasks.
aws ecs delete-service --cluster MyCluster --service MyService1 --forceIdentify--clusterThe short name or full Amazon Resource Name (ARN) of the cluster that hosts the service to delete.--serviceThe name of the service to delete.--forceIf true, allows you to delete a service even if it wasn't scaled down to zero tasks.Its output, shortened
{
"service": {
"serviceArn": "arn:aws:ecs:us-west-2:123456789012:service/MyCluster/MyService1",
"serviceName": "MyService1",
"clusterArn": "arn:aws:ecs:us-west-2:123456789012:cluster/MyCluster",
"loadBalancers": [],
"serviceRegistries": [],
"status": "DRAINING",
"desiredCount": 0,
"runningCount": 2,
"pendingCount": 0,
"launchType": "EC2",
"taskDefinition": "arn:aws:ecs:us-west-2:123456789012:task-definition/MyTaskDefinition:1",
"deploymentConfiguration": {
"deploymentCircuitBreaker": {
"enable": false,
"rollback": false
},
"maximumPercent": 200,
"minimumHealthyPercent": 100
},
"deployments": [
{
"id": "ecs-svc/1234567890123456789",
"status": "PRIMARY",
"taskDefinition": "arn:aws:ecs:us-west-2:123456789012:task-definition/MyTaskDefinition:1",
"desiredCount": 0,
"pendingCount": 0,
"runningCount": 2,
"failedTasks": 0,
… 21 more linesFor more information, see Deleting an Amazon ECS service using the console in the Amazon ECS Developer Guide.
Options
--clusterThe short name or full Amazon Resource Name (ARN) of the cluster that hosts the service to delete.--forceIf true, allows you to delete a service even if it wasn't scaled down to zero tasks.--serviceThe name of the service to delete.