AWS Classroomnotes 07/Feb/2023

Public and Private Subnets

  • Public Subnet is associated with a route table which has route to internet gateway
  • Private subnet is associated with a route table which has no route to internet gateway
  • subnets will using

    • default route table, if there is no explicit connection
      Preview
  • Lets create a vpc with 3 subnets

    • public subnet
    • private subnet
    • default (route to default route table)
      Preview
      Preview
      Preview
  • Now lets create a internet gateway and associate that with vpc
    Preview
  • Create a route table with route to internet gateway (public rt)
    Preview
    Preview
  • Create a route table without route to internet gateway (private rt)
    Preview
  • Lets create an ec2 instance in public subnet (we have not associated public subnet to public route table yet)
    Preview
  • Now lets try ssh connectivity using public ip
    Preview
  • Lets associate public subnet to public rt
    Preview
    Preview
    Preview
    Preview
  • Lets try to reconnect
    Preview
  • Now lets try to connect to internet from public ec2
    Preview
  • Lets try to create one ec2 instance in private subnet which is explicitly connected to private route table
    Preview
    Preview
  • Now try connecting to private route table instance using public ip
    Preview
    Preview
  • For all the internal communications in vpc use private ips not public ip.
  • Lets try to connect to internet from private ec2
    Preview
  • Private subnets cannot be connected from/to internet

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

About continuous learner

devops & cloud enthusiastic learner