aws ec2 terminate-instances
Terminates (deletes) the specified instances. AWS CLI reference
1 example 4 options Its page in the AWS CLI reference
Examples
To terminate an Amazon EC2 instance
The following terminate-instances example terminates the specified instance.
aws ec2 terminate-instances --instance-ids i-1234567890abcdef0Identify--instance-idsThe IDs of the instances.Its output
{
"TerminatingInstances": [
{
"InstanceId": "i-1234567890abcdef0",
"CurrentState": {
"Code": 32,
"Name": "shutting-down"
},
"PreviousState": {
"Code": 16,
"Name": "running"
}
}
]
}For more information, see Launching, listing, and deleting Amazon EC2 instances in the AWS CLI in the AWS Command Line Interface User Guide.
Options
--dry-runChecks whether you have the required permissions for the operation, without actually making the request, and provides an error response.--forceForces the instances to terminate.--instance-idsThe IDs of the instances.--skip-os-shutdownSpecifies whether to bypass the graceful OS shutdown process when the instance is terminated.