0
0
GCPcloud~15 mins

Terraform vs Deployment Manager decision in GCP - Hands-On Comparison

Choose your learning style9 modes available
Terraform vs Deployment Manager Decision
📖 Scenario: You are working as a cloud engineer for a company moving their infrastructure to Google Cloud Platform (GCP). Your team needs to decide whether to use Terraform or Google Cloud Deployment Manager to manage infrastructure as code.Both tools help automate resource creation, but they have differences in flexibility, community support, and integration.
🎯 Goal: Build a simple comparison dictionary in Python that lists key features of Terraform and Deployment Manager. Then, add a configuration variable to select the preferred tool. Finally, write logic to print the chosen tool's features.
📋 What You'll Learn
Create a dictionary named tools with keys 'Terraform' and 'Deployment Manager' and their feature descriptions as values.
Add a variable named preferred_tool set to either 'Terraform' or 'Deployment Manager'.
Write a for loop that iterates over tools.items() and prints the features of the preferred_tool.
Add a final print statement confirming the selected tool.
💡 Why This Matters
🌍 Real World
Cloud engineers often compare infrastructure as code tools to choose the best fit for their projects. Automating this comparison helps in decision making.
💼 Career
Understanding how to manage and compare cloud infrastructure tools is essential for roles like Cloud Engineer, DevOps Engineer, and Site Reliability Engineer.
Progress0 / 4 steps
1
Create the tools dictionary
Create a dictionary called tools with these exact entries: 'Terraform' mapped to 'Open-source, multi-cloud, large community' and 'Deployment Manager' mapped to 'GCP native, YAML/JSON configs, integrates with GCP services'.
GCP
Need a hint?

Use curly braces {} to create a dictionary with the exact keys and values.

2
Add preferred tool variable
Add a variable called preferred_tool and set it to the string 'Terraform'.
GCP
Need a hint?

Assign the string 'Terraform' to the variable preferred_tool.

3
Write loop to print preferred tool features
Write a for loop using variables tool and features to iterate over tools.items(). Inside the loop, use an if statement to check if tool equals preferred_tool. If yes, print the string f"Features of {tool}: {features}".
GCP
Need a hint?

Use for tool, features in tools.items(): and inside it check if tool == preferred_tool:.

4
Add final confirmation print
Add a print statement that outputs f"Selected tool: {preferred_tool}" to confirm the choice.
GCP
Need a hint?

Use a print statement with an f-string to show the selected tool.