Ad space (banner)
AD

Got the fundamentals? A structured AWS course is a fast way to level up.

Find AWS courses on Udemy

Affiliate link. Costs you nothing extra.

☁️AWS Lessons
Lesson 28 / 41

Terminating an Instance with aws ec2 terminate-instances

When a server is finished with for good, use aws ec2 terminate-instances. It deletes the instance permanently.

The syntax is aws ec2 terminate-instances --instance-ids id. This cannot be undone.

Running it transitions the instance to shutting-down and then terminated, after which it is gone.

A common stumble is confusing terminate with stop. Stop is reversible; terminate destroys the instance and, by default, its root volume with it.

In real work, termination protection is enabled on important instances precisely to prevent an accidental version of this command.

AWS
Try it (type this into the pseudo terminal)
aws ec2 terminate-instances --instance-ids i-0123456789abcdef0

🧑‍💻 You can type this command into the AWS pseudo terminal to try it yourself (this page itself has no interactive terminal).

Ad space (banner)
Ad space (in-article)