The following tutorial describes how to design an application with one (global) private network spanning in two regions of Google Cloud. Each region has one subnet and one compute connecting to the subnet (e.g.,
Compute connects to
Compute_2 connects to
Subnet_2). The compute in the first region (e.g.,
Compute) has access to the internet.
Step 1. Define a subnet for the network
- Drop the Subnet component on the Private network.
Step 2. Connect a compute to the subnet
- Click on the network point (on the right side of the Compute) and connect it to the connection point (on the left side) of the Subnet.
Step 3. Define a cidr range for the subnet
- Click on the Subnet.
10.0.0.0/24in the cidr field.
- The cidr field is mandatory for defining a subnet.
Step 4. Define a fixed ip address for the compute (optional)
- Click on the Port of the compute.
10.0.0.3in the ip_address field. The ip_address
10.0.0.3is within the range of the network above (
- If no ip_address specified, an ip address will be auto-generated within the ip range of the subnet during the deployment.
Step 5. Define the second compute and subnet
- Drop another Subnet component on the Private network. Now we have two subnets:
- Click on the Subnet_2. Type
10.0.1.0/24in the cidr field.
- Drop another Compute component (e.g.,
Compute_2) and connect it to Subnet_2.
Step 6. Connect the first compute to the public
- Drop a Public network.
- Connect the Port of
Computeto the link point (on the left side) of the Public network.
Step 7. Deploy
- Choose the Google Cloud location to deploy
- In the matching tab, choose the zone for the computes in different regions (e.g.,
- The VPC
privatenetwork is created with two subnets (e.g.,
private-subnet-2) in two cidr ranges (
10.0.1.0/24) and in two regions (e.g.,
- Two VMs will be created in the two separated subnets.
Compute-0has a fixed ip address
10.0.0.3(as specified in step 4) and has an external IP.