VPC Tutorial #1 : How to set-up a VPC and its components- step-by-step guide!!


In this article I will walk you through the 8 steps guide to launch your first VPC!!. I consider you set-up your own AWS account and possess the basic cloud networking understanding!!


Topics covered

  • VPC

  • Subnets

  • Internet gateway

  • Nat gateway

  • Route table

  • Launch EC2 instance and Test


  • Create VPC -


  • Create subnet -
  1. Create Public Subnet

2. Create Private Subnet -


  • Create IGW -

  1. Click on Attach to VPC button

  1. Select a VPC ID from drop down of available VPC’s

  1. Click on Attach Internet Gateway.

  • Create NAT gateway -

1. Choose public subnet and not private because only public subnet has internet access.

  1. Now we need Elastic Ip- either choose from already available or click allocate elastic IP button,I will click on allocate elastic ip button.

  1. Heat Create NAT gateway.

  • Create and update Route Table (Public & Private)-:

    1. Create Public route table -

2. Public subnet association

  1. Edit routes for Internet gateway.


2.1 Create Private route table -

2.2 Private subnet association

2.3 Edit routes for NAT gateway


  • Launch Public EC2 instance -

    1. Add name and tags.

    2. Create new key pair and attach it.

    3. Enable auto assign Public IP ( for Browser testing)

    4. Add Inbound rule for SSH - port 22 and HTTP port -80

    5. User data (In Advanced details section) -

      6. Heat Launch Instance.

  • Launch Private EC2 instance - (follow above guide)

    1. Add name and tags.

    2. Create new key pair and attach it.

    3. Don’t Enable auto assign Public IP.

    4. Add Inbound rule for SSH - port 22 only.


  • Test -

    Public Instance -

    Copy Public IP and paste it to browser.

    Success!!!!

Private Instance -

SSH to Public instance

copy key and paste it to public instance

then ssh from public instance to private instance

Success!!!!


  • Cleanup : -
  1. Delete EC2 instances.
  1. Disassociate and Release Elastic -IP and delete NAT gateway.
  1. Delete VPC.

Note - This is the first part of a series dedicated to mastering VPCs. Stay tuned for more VPC insights like peering, Transit gateway, Endpoints and more !!💡

Feel free to drop your thoughts, questions, or feedback in the comments. Let’s learn together!! ☁️🚀

Happy Learning!!

Shivprasad Waghmare

#AWS #Networking #Cloud #VPC #CloudComputing #Hashnode #AWSTutorial #CloudEngineering #TechBlog #DevOps #CloudSkills #VPCTutorial #CloudNetworking #NetworkingEssentials #Hashnode #LearnAWS #CloudEngineers #AWSVPC #DevOps #SRE #InfrastructureEngineering #Platform #TechBlog

10
Subscribe to my newsletter

Read articles from Shivprasad Waghmare directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Shivprasad Waghmare
Shivprasad Waghmare

"Accidental DevOps Engineer | 7+ Years of Experience | Exploring AWS, Kubernetes, Terraform, Docker, Jenkins | Passionate about automating cloud infrastructure | Let’s explore the world of DevOps together!"