aws ecs deregister-container-instance
Deregisters an Amazon ECS container instance from the specified cluster. AWS CLI reference
1 example 3 options Its page in the AWS CLI reference
Examples
To deregister a container instance from a cluster
The following deregister-container-instance example deregisters a container instance from the specified cluster. If there are still tasks running in the container instance, you must either stop those tasks before deregistering, or use the --force option.
aws ecs deregister-container-instance --cluster arn:aws:ecs:us-west-2:123456789012:cluster/MyCluster --container-instance arn:aws:ecs:us-west-2:123456789012:container-instance/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111 --forceIdentify--clusterThe short name or full Amazon Resource Name (ARN) of the cluster that hosts the container instance to deregister.--container-instanceThe container instance ID or full ARN of the container instance to deregister.--forceForces the container instance to be deregistered.Its output, shortened
{
"containerInstance": {
"remainingResources": [
{
"integerValue": 1024,
"doubleValue": 0.0,
"type": "INTEGER",
"longValue": 0,
"name": "CPU"
},
{
"integerValue": 985,
"doubleValue": 0.0,
"type": "INTEGER",
"longValue": 0,
"name": "MEMORY"
},
{
"type": "STRINGSET",
"integerValue": 0,
"name": "PORTS",
"stringSetValue": [
"22",
"2376",
"2375",
"51678",
"51679"
],
"longValue": 0,
"doubleValue": 0.0
… 219 more linesFor more information, see Deregistering an Amazon ECS container instance in the Amazon ECS Developer Guide.
Options
--clusterThe short name or full Amazon Resource Name (ARN) of the cluster that hosts the container instance to deregister.--container-instanceThe container instance ID or full ARN of the container instance to deregister.--forceForces the container instance to be deregistered.