The basic concept of a subnet in AWS is the same as in on-premise environments. Namely it is a network within a network. Separate subnets can be defined to create a logical or physical boundary between components. Unique AWS-specific concepts are as follows:

  • If a system is deployed across different Availability Zones (different datacenters), a separate subnet must be defined for each Availability Zone.
  • If instances within a subnet need direct access from/to the Internet, it should be configured as a “public” subnet. Note that if instances need to be separated from/to the Internet, it should be configured as a “private” subnet. Consequently, there may need to be more than 2 subnets defined per Availability Zone.

Refer to the AWS documentation for more information.

In this tutorial, we will use three (3) Availability Zones and use only the “public” pattern to simplify the process. A “public” subnet is created as follows:

  1. Go to the Subnet page by selecting “Subnets” from the navigation pane at the left side.
  1. As per the VPC, there are pre-defined subnets for the default VPC. Select “Create Subnet” from the top right corner.

  1. Specify following parameters as shown in the screenshot:
  • Subnet Name: LK-subnet-1
  • Availability Zone: Select the first option.
  • IPv4 CIDR block:
  • Tag: Name = LK-subnet-1

While working in this wizard, a list of Availability Zones can be seen by selecting the dropdown box for the Availability Zones:

Select the first Availability Zone (in this case us-west-2a)

  1. Now the first subnet on Availability Zone us-west-2a is created. Return to the “Subnet Page”.
  1. Create the second subnet LK-subnet-2 with CIDR block in another Availability Zone us-west-2b.
  1. Create the third subnet LK-subnet-3 with a CIDR block on the Availability Zone us-west-2c.
  1. Once the three subnets have been created, the list of subnets should be as shown in the screenshot below. The first subnets in the picture are the “default“ subnets created for “default” VPC followed by the three subnets we have just created.

  1. In this tutorial we will create a public subnet. This signifies that we want to assign a public IP address for instances we create under this subnet. To do so, select the subnet we have just created and then select “Modify auto-assign IP settings” from the Actions menu.

  1. Select “Enable auto-assign public IPv4 address”, and save the change.

  1. Now the subnets are ready to use.


Was this helpful?

Yes No
You indicated this topic was not helpful to you ...
Could you please leave a comment telling us why? Thank you!
Thanks for your feedback.

Post your comment on this topic.

Post Comment