| Did this page help you? Yes No Tell us about it... |
Shuts down one or more instances. This operation is idempotent; if you terminate an instance more than once, each call will succeed.
Terminated instances will remain visible after termination (approximately one hour).
![]() | Note |
|---|---|
By default, Amazon EC2 deletes all Amazon EBS volumes that were attached when the instance launched. Amazon EBS volumes attached after instance launch continue running. |
You can stop, start, and terminate EBS-backed instances. You can only terminate S3-backed instances. What happens to an instance differs if you stop it or terminate it. For example, when you stop an instance, the root device and any other devices attached to the instance persist. When you terminate an instance, the root device and any other devices attached during the instance launch are automatically deleted. For more information about the differences between stopping and terminating instances, go to the "Stop/Start" and "Instance Termination" in Basics of Amazon EBS-Backed AMIS and Instances in the Amazon EC2 User Guide.
The short version of this command is ec2kill.
ec2-terminate-instances
instance_id [instance_id ...]
| Name | Description | Required |
|---|---|---|
|
|
IDs of instances to terminate. Type: String Default: None Example: i-43a4412a |
Yes |
| Option | Description |
|---|---|
|
|
Overrides the Region specified in the Default: The Example: |
|
|
Default: The Example: |
|
|
The private key to use when constructing requests to Amazon EC2. Default: The value of the Example: |
|
|
The X.509 certificate to use when constructing requests to Amazon EC2. Default: The value of the Example: |
|
|
Specifies a connection timeout (in seconds). Example: --connection-timeout 30 |
|
|
Specifies a request timeout (in seconds). Example: --request-timeout 45 |
|
|
Displays verbose output by showing the SOAP request and response on the command line. This is particularly useful if you are building tools to talk directly to our SOAP API. |
|
|
Displays column headers in the output. |
|
|
Shows empty columns as |
|
|
Do not display tags for tagged resources. |
|
|
Prints internal debugging information. This is useful to assist us when troubleshooting problems. |
|
|
Displays Help. |
|
|
If Example: |
The command returns a table that contains the following information:
INSTANCE identifier
The instance ID of the instance being terminated
The state of the instance prior to being terminated
The new state of the instance
Amazon EC2 command line tools display errors on stderr.
This example terminates the i-3ea74257 instance.
PROMPT>ec2-terminate-instances i-3ea74257INSTANCE i-3ea74257 running shutting-down