VPC with a Single Public Subnet
Under VPC
Wizard we have 4 options available to us and those are:
1. VPC with a
Single Public Subnet
2. VPC with
Public and Private Subnets
3. VPC with
Public and Private Subnets and Hardware VPN Access
4. VPC with a
Private Subnet Only and Hardware VPN Access
In this
scenario, we are going to create VPC with single public subnet using VPC
Wizard.
1. Go to VPC
Dashboard on AWS Web Console and click on Start
VPC Wizard.
3. Provide the details for creating VPC as follows
IPv4 CIDR block: 192.168.0.0/16 (Default AWS provide CIDR block as 10.0.0.0/16).
IPv6 CIDR block: No (Default it is selected as NO).
VPC name: Pranav-VPC1 (Provide VPC Name as you
like).
Public subnet's IPv4 CIDR: 192.168.1.0/24 (This will provide the
public CIDR block range).
Availability Zone: us-east-1a (Select the availability
zone as you like or let AWS will decide).
Subnet name: Pranav-VPC1-Public Sub (Provide
subnet name).
Enable DNS hostnames: Yes (Default it is selected as yes so that instances can be accessed using DNS hostname).
Enable DNS hostnames: Yes (Default it is selected as yes so that instances can be accessed using DNS hostname).
Hardware tenancy: Default
After providing all the details click on Create VPC. Within few seconds you have VPC created as per your requirement.
4. Enable Auto assign Public IP.
By default the subnet which is created will have “Auto assign public IP” attribute set to NO, This is because the subnet is non-default subnet created using VPC Wizard.
In order to access the instances launched into the Public Subnet must have public IP assigned to it. To enable “Auto assign public IP” attribute we need to modify the auto-assign IP settings.
Under VPC dashboard, in navigation pane choose Subnets.
Select your subnet and choose Subnet Actions, Modify auto-assign IP settings.
Click on the check box to select and then press save.
Important Points:
1. In this scenario, after creating VPC using VPC wizard, AWS will create Internet Gateway (IGW) that allows instances in public subnet to communicate with the internet and other AWS services.
2. It creates two route tables:
One is the Main Route table which has a local route that allows the instances to communicate within VPC and it has no subnet associated with it.
Second is Custom (No Main) which have two routes added to it. One which allows instances to communicate within VPC and other one has a route that allows instances to communicate with internet through internet gateway (IGW).
Custom (No Main) route table has one subnet associated with it.
3. Subnet created using VPC wizard is the non-default subnet, having “Auto-assign Public IP” and “Auto-assign IPv6 address” attributes set to NO (false).
No comments:
Post a Comment