3) Associate Subnets with Table Routes

Each subnet must be associated with a route table, which specifies the allowed routes for outbound traffic leaving the subnet. Every subnet that you create is automatically associated with the main route table for the VPC. You need to create two custom table routes and apply the table routes to your subnets respectively.

The following diagram represents the architecture of your VPC after you've completed this step.

Set up Public Subnet

Create a custom route table and add a route over the internet gateway. When a subnet is associated with this route table, the subnet's traffic will be routed to the internet. In this way, the subnet acts as a public subnet.
  1. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/.
  2. In the navigation pane, select Route Tables, then click Create Route Table.
  3. Configure the route table, and click Yes, Create.

    • Name tag: Specify the route table name. For example, Public-Route-Table.
    • VPC: Select the VPC that is for Yeastar Cloud PBX.
  4. On the Route Tables page, edit the new created route table.
    1. Select the target route table.
    2. Under the route table list, click Routes tab, and click Edit.

    3. Scroll down the page, click Add another route.
    4. Enter Destination as 0.0.0.0/0, and select Target to the internet gateway.

    5. Click Save.
  5. Associate the desired subnet to the route table.
    1. Click Subnet Associations tab, then click Edit.
    2. Select the desired subnet.
    3. Click Save.

Set up Private Subnet

Create a custom route table and remain the default route (same with the main table route). If a subnet is associated with the route table, the subnet will act as a private subnet.
  1. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/.
  2. In the navigation pane, select Route Tables, then click Create Route Table.
  3. Configure the route table, and click Yes, Create.

    • Name tag: Specify the route table name. For example, Private-Route-Table.
    • VPC: Select the VPC that is for Yeastar Cloud PBX.
  4. Associate the desired subnet to the route table.
    1. Click Subnet Associations tab, then click Edit.
    2. Select the desired subnet.
    3. Click Save.