Load Balancer Types Comparison in GCP
📖 Scenario: You are working as a cloud engineer for a company that wants to understand different types of load balancers available in Google Cloud Platform (GCP). They want a simple programmatic way to compare the main types of load balancers by their key features.
🎯 Goal: Create a Python dictionary that holds the main GCP load balancer types as keys and their key features as values. Then add a configuration variable to select a load balancer type. Next, write code to extract the features of the selected load balancer. Finally, complete the code by adding a summary dictionary entry for all load balancers.
📋 What You'll Learn
Create a dictionary called
load_balancers with these exact keys: 'HTTP(S) Load Balancer', 'TCP Proxy Load Balancer', 'SSL Proxy Load Balancer', 'Network Load Balancer'Each key must map to a list of exactly these features (strings):
- HTTP(S) Load Balancer:
'Global', 'Layer 7', 'Supports HTTP and HTTPS'- TCP Proxy Load Balancer:
'Global', 'Layer 4', 'TCP traffic only'- SSL Proxy Load Balancer:
'Global', 'Layer 4', 'SSL traffic only'- Network Load Balancer:
'Regional', 'Layer 4', 'TCP and UDP traffic'Create a variable called
selected_lb and set it to the string 'HTTP(S) Load Balancer'Write code to get the features list for the
selected_lb from load_balancers and store it in a variable called featuresAdd a new dictionary entry to
load_balancers with key 'Summary' and value as a list of all load balancer keys except 'Summary'💡 Why This Matters
🌍 Real World
Cloud engineers often need to compare and document different cloud services to choose the right one for their applications.
💼 Career
Understanding load balancer types and their features is essential for designing scalable and reliable cloud architectures.
Progress0 / 4 steps