DEV Community

Cover image for Creating Your First AWS VPC and EC2 Instance with Elastic IP
Amey
Amey

Posted on

Creating Your First AWS VPC and EC2 Instance with Elastic IP

AWS VPC known as Virtual Private Network used to create isolated and secure network for our resources in the cloud.

In this blog , I will take you through the process of setting up VPC, launching an EC2 instance within our VPC and will assign Elastic IP to ensure public internet access. So in future you can deploy your application on AWS .

Step 1: Creating a VPC

Go to the VPC dashboard Click on “Create VPC”: Select the “Create VPC” option to start the configuration.

Image description

  1. Choose your desired CIDR block , i chose 10.0.0.0/16

Image description

  1. Click the “Create” button once your configuration is complete.

Step 2: Create a Subnet

Select all the details carefully as mentioned below

Image description

Step 3: Creating an Internet Gateway

Go to the Internet Gateways Section: In the VPC Dashboard, navigate to “Internet Gateways.”

Image description

  1. Attach the IGW to the VPC: After the IGW is created, select it and click on “Attach to VPC.”

Image description

Image description

Step 4: Edit the Route Table

Go to the Route Tables Section: In the VPC Dashboard, navigate to “Route Tables.”

Image description

  1. Select your route table for our VPC and add a route .

Image description

Step 5: Launch an EC2 Instance and make sure you are launching within your VPC which you created

Image description

Image description

Image description

Image description

Image description

Finally click on “launch Instance”

Step 6: Allocating and Associating an Elastic IP

Allocate elastic ip first select from the list and associate it to your instance.

Image description

  1. Associate to instance.

Image description

Step 7: Test the EC2 instance with ping command to make sure instance can be reachable through internet.

Ping <your elastic ip>

By following these steps, you now understand how to configure networking in AWS and make your resources publicly accessible

Happy Learning 🎉.

Connect with me 😎

Linkedin

Github

Top comments (0)