Amazon Elastic Compute Cloud (EC2)

Basics of EC2

Demo Create EC2 instance using UI Part 2

In this lesson, you’ll learn how to safely terminate an EC2 instance via the AWS Management Console. If termination protection is enabled, we’ll also cover how to disable it.

Prerequisites

  • An active AWS account with required IAM permissions (EC2:Describe, StopInstances, TerminateInstances).
  • An existing EC2 instance to terminate.

Overview of Termination Protection

AWS EC2 offers Termination Protection to prevent accidental instance deletion. When enabled, any termination attempt fails until you explicitly disable it.

Note

Enabling termination protection is a best practice for critical workloads. It safeguards against unintended shutdowns.
Read more: EC2 Termination Protection

Step 1: Attempt to Terminate the Instance

  1. Open the EC2 Dashboard in the AWS Management Console.
  2. Select the target instance in the Instances list.
  3. Click Instance StateTerminate Instance.

If termination protection is enabled, you’ll see an error message:

The image shows an AWS EC2 management console with a running instance named "demo." The instance is selected, and the option to terminate it is highlighted.

Warning

Error: “Failed to terminate instance. The instance may not be terminated.”
This indicates that Termination Protection is active.

Step 2: Disable Termination Protection

  1. With the same instance selected, choose ActionsInstance SettingsChange Termination Protection.
  2. In the dialog, uncheck Enable and click Save.

Step 3: Terminate the Instance

  1. Again, select the instance and navigate to Instance StateTerminate Instance.
  2. Confirm the action in the pop-up.

The instance state will progress as follows:

Instance StateDescription
runningInstance is active and accepting traffic.
shutting-downTermination has been initiated.
terminatedInstance has been deleted and cannot start.

Eventually, you’ll see:

The image shows an AWS EC2 console with an instance labeled "demo" that is in the process of shutting down. The instance type is t2.micro, and it has passed its status checks.


References

Watch Video

Watch video content

Practice Lab

Practice lab

Previous
Demo Create EC2 instance using UI Part 1