Design with dynamic subnets
The Section Design your application with static subnets in multiple regions shows how to define multiple subnets for a network explicitly. However, users may not want to define the subnets explicitly. In such a case, the Cloud Create will auto-generate one subnet for each region dynamically as follows:
Design
- Design an application with two computes connecting to the same
Privatenetwork. The Private network has no subnets. - Click on the
Privatenetwork and specify the cidr:10.0.0.0/24. - Connect the first compute (e.g.,
Compute) to thePublicnetwork.
Figure 1. Auto-generated subnet example
Deploy
Case 1. Two computes in the same region
- Go to Deploy / Google / Configure cloud provider.
- Choose the zone for the two computes in the same region
europe-west1(e.g., chooseeurope-west1-bandeurope-west1-cforComputeandCompute_2, respectively).
Expected result
- Google Cloud requires one region has at least one subnet. The designer auto-generates one subnet
Private_subnet_europe_west1for the regioneurope-west1in thePrivatenetwork. - The subnet has the same cidr of the
Privatenetwork (i.e.,10.0.0.0/24). - Both computes
ComputeandCompute-2connect to this subnet.
Figure 2. Private_subnet_europe_west1 is auto-generated for two computes in one region
- The
routing_modeof thePrivatenetwork is auto set toREGIONAL(if not set) since all computes are in the same region.
Figure 3. The routing_mode is auto set to REGIONAL
Case 2. Two computes in different regions
- Go to Deploy / Google / Configure cloud provider.
- Choose the zone for the computes in two different regions (e.g., choose the zone
europe-north1-aandeurope-west1-cforComputeandCompute_2, respectively).
Expected result
- Google Cloud requires one region has at least one subnet. Because we have two regions, the designer auto-generates two subnets for the region
europe-north1andeurope-west1. - The cidr of the
Privatenetwork (i.e.,10.0.0.0/24) is auto subnetting in two equal ranges for each subnet (i.e.,10.0.0.0/25and10.0.0.128/25). - Two computes connect to two separated subnets in different regions.
Figure 4. Two subnets are auto-generated for two regions
- The
routing_modeof thePrivatenetwork is auto set toGLOBAL(if not set) so that the two computes from different regions can access each other via the internal IP address.
Figure 5. The routing_mode is auto set to GLOBAL
Auto-generated subnet is useful if you cannot decide the location of the computes at the design time (i.e., whether the computes are co-located in one or in different regions) but at the deployment time. In such a case, Cloud Create will transform the topology before the deployment for you.




