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
- Open the EC2 Dashboard in the AWS Management Console.
- Select the target instance in the Instances list.
- Click Instance State → Terminate Instance.
If termination protection is enabled, you’ll see an error message:
Warning
Error: “Failed to terminate instance. The instance may not be terminated.”
This indicates that Termination Protection is active.
Step 2: Disable Termination Protection
- With the same instance selected, choose Actions → Instance Settings → Change Termination Protection.
- In the dialog, uncheck Enable and click Save.
Step 3: Terminate the Instance
- Again, select the instance and navigate to Instance State → Terminate Instance.
- Confirm the action in the pop-up.
The instance state will progress as follows:
Instance State | Description |
---|---|
running | Instance is active and accepting traffic. |
shutting-down | Termination has been initiated. |
terminated | Instance has been deleted and cannot start. |
Eventually, you’ll see:
References
Watch Video
Watch video content
Practice Lab
Practice lab