Terminate Amazon EC2 instances
Warning
Terminating an instance is permanent and irreversible.
After you terminate an instance, you can no longer connect to it, and it can't be recovered. All attached Amazon EBS volumes that are configured to be deleted on termination are also permanently deleted and can't be recovered. All data stored on instance store volumes is permanently lost. For more information, see How instance termination works.
Before you terminate an instance, ensure that you have backed up all data that you need to retain after the termination to persistent storage.
You can delete your instance when you no longer need it. This is referred to as
terminating your instance. As soon as the state of an instance
changes to shutting-down
or terminated
, you stop incurring charges
for that instance.
You can't connect to or start an instance after you've terminated it. However, you can launch new instances using the same AMI.
If you'd rather stop or hibernate your instance, see Stop and start Amazon EC2 instances or Hibernate your Amazon EC2 instance. For more information, see Differences between instance states.
Contents
Terminate an instance with a graceful OS shutdown
You can terminate an instance using the default terminate method, which includes an attempt at a graceful OS shutdown. For more information, see Methods for terminating an instance.
Terminate an instance and bypass the graceful OS shutdown
You can bypass the graceful OS shutdown when terminating an instance. For more information, see Methods for terminating an instance.
Troubleshoot instance termination
The requester must have permission to call ec2:TerminateInstances
. For
more information, see Example policies to work
with instances.
If you terminate your instance and another instance starts, most likely you have configured automatic scaling through a feature like EC2 Fleet or Amazon EC2 Auto Scaling. For more information, see Instances automatically launched or terminated.
Note
You can't terminate an instance if termination protection is turned on. For moreinformation, see terminationprotection.
If your instance is in the shutting-down
state for longer than usual, you can
attempt to force terminate it. If it remains in the shutting-down
state, it
should be cleaned up (terminated) by automated processes within the Amazon EC2 service. For
more information, see Delayed instance termination.