0
0
GCPcloud~15 mins

GCP global infrastructure (regions, zones) - Mini Project: Build & Apply

Choose your learning style9 modes available
Explore GCP Global Infrastructure: Regions and Zones
📖 Scenario: You are working as a cloud engineer for a company planning to deploy applications on Google Cloud Platform (GCP). To ensure high availability and low latency, you need to understand and organize GCP's global infrastructure, which consists of regions and zones.Regions are large geographic areas, and each region contains multiple zones. Zones are isolated locations within a region where you can deploy resources.
🎯 Goal: Build a simple data structure that represents GCP's global infrastructure with regions and their zones. This will help you visualize and plan resource deployment.
📋 What You'll Learn
Create a dictionary named gcp_infrastructure with exact region names as keys and lists of exact zone names as values.
Add a variable named selected_region to hold the region you want to explore.
Use a for loop with variables zone to iterate over the zones of the selected_region.
Add a final configuration variable named total_zones that counts the number of zones in the selected_region.
💡 Why This Matters
🌍 Real World
Understanding GCP's regions and zones helps in planning where to deploy cloud resources for better performance and reliability.
💼 Career
Cloud engineers and architects use knowledge of regions and zones to design scalable and fault-tolerant cloud applications.
Progress0 / 4 steps
1
Create the GCP infrastructure dictionary
Create a dictionary called gcp_infrastructure with these exact entries: 'us-central1' with zones ['us-central1-a', 'us-central1-b', 'us-central1-c', 'us-central1-f'], 'europe-west1' with zones ['europe-west1-b', 'europe-west1-c', 'europe-west1-d'], and 'asia-east1' with zones ['asia-east1-a', 'asia-east1-b', 'asia-east1-c'].
GCP
Need a hint?

Use a dictionary with region names as keys and lists of zones as values.

2
Select a region to explore
Add a variable called selected_region and set it to the string 'us-central1'.
GCP
Need a hint?

Assign the string 'us-central1' to the variable selected_region.

3
Iterate over zones in the selected region
Use a for loop with the variable zone to iterate over the list of zones in gcp_infrastructure[selected_region].
GCP
Need a hint?

Use a for loop with zone to go through each zone in the selected region's list.

4
Count the total zones in the selected region
Add a variable called total_zones and set it to the length of the list of zones in gcp_infrastructure[selected_region].
GCP
Need a hint?

Use the len() function to count the zones in the selected region.