EC2 InvalidSubnetID.NotFound error encountered when launching an EC2 instance.

The specified subnet ID does not exist or is incorrect.

Understanding Amazon EC2

Amazon Elastic Compute Cloud (EC2) is a web service that provides resizable compute capacity in the cloud. It is designed to make web-scale cloud computing easier for developers. EC2 allows you to launch virtual servers, known as instances, and manage them as needed.

Identifying the Symptom

When launching an EC2 instance, you might encounter the error code InvalidSubnetID.NotFound. This error indicates that the subnet ID specified in your request does not exist or is incorrect.

Exploring the Issue

The InvalidSubnetID.NotFound error occurs when the subnet ID provided in the EC2 launch request cannot be found. This could be due to a typo in the subnet ID, the subnet being deleted, or the subnet ID being specified in the wrong region.

Common Causes

  • Typographical errors in the subnet ID.
  • The subnet has been deleted or is not available.
  • The subnet ID is specified in a different region than intended.

Steps to Resolve the Issue

Follow these steps to resolve the InvalidSubnetID.NotFound error:

Step 1: Verify the Subnet ID

Ensure that the subnet ID you are using is correct. You can verify the subnet ID by navigating to the VPC Dashboard in the AWS Management Console. Under the 'Subnets' section, check if the subnet ID exists and is correct.

Step 2: Check for Deletion

If the subnet ID was correct, ensure that the subnet has not been deleted. In the VPC Dashboard, verify that the subnet is still listed under 'Subnets'. If it has been deleted, you will need to create a new subnet.

Step 3: Confirm the Region

Ensure that you are operating in the correct AWS region. Subnet IDs are region-specific, so make sure that the subnet ID you are using belongs to the region you are working in. You can change the region from the top-right corner of the AWS Management Console.

Step 4: Update the Launch Configuration

If you are using an automated script or a launch configuration, update it with the correct subnet ID. Double-check the script or configuration file for any hardcoded subnet IDs and update them accordingly.

Additional Resources

For more information on managing subnets and troubleshooting EC2 issues, refer to the following resources:

Master

EC2

in Minutes — Grab the Ultimate Cheatsheet

(Perfect for DevOps & SREs)

Most-used commands
Real-world configs/examples
Handy troubleshooting shortcuts
Your email is safe with us. No spam, ever.

Thankyou for your submission

We have sent the whitepaper on your email!
Oops! Something went wrong while submitting the form.

EC2

Cheatsheet

(Perfect for DevOps & SREs)

Most-used commands
Your email is safe with us. No spam, ever.

Thankyou for your submission

We have sent the whitepaper on your email!
Oops! Something went wrong while submitting the form.

MORE ISSUES

Made with ❤️ in Bangalore & San Francisco 🏢

Doctor Droid