0
0
GCPcloud~15 mins

Cloud SQL pricing in GCP - Mini Project: Build & Apply

Choose your learning style9 modes available
Cloud SQL Pricing Calculation
📖 Scenario: You are managing a small business database on Google Cloud SQL. You want to understand how your monthly cost is calculated based on your usage.
🎯 Goal: Build a simple Python script that calculates the monthly cost of a Cloud SQL instance based on given usage parameters.
📋 What You'll Learn
Create variables to store instance type, storage size in GB, and backup storage in GB
Add a configuration variable for the price per GB of storage
Calculate the total monthly cost using the given rates
Add the final line to output the total cost variable
💡 Why This Matters
🌍 Real World
Cloud SQL pricing is important for budgeting and cost management in cloud database projects.
💼 Career
Cloud engineers and architects must estimate and optimize database costs for clients or companies.
Progress0 / 4 steps
1
Set up usage variables
Create three variables: instance_type set to "db-n1-standard-1", storage_gb set to 100, and backup_storage_gb set to 20.
GCP
Need a hint?

Use simple assignment statements to create the variables with the exact names and values.

2
Add pricing configuration
Add a variable called price_per_gb and set it to 0.17 to represent the price per GB of storage in dollars.
GCP
Need a hint?

Assign the price per GB as a floating point number to the variable price_per_gb.

3
Calculate total monthly cost
Create a variable called total_cost that calculates the sum of storage and backup storage multiplied by price_per_gb.
GCP
Need a hint?

Use parentheses to add storage_gb and backup_storage_gb before multiplying by price_per_gb.

4
Complete with output variable
Add a variable called monthly_cost and assign it the value of total_cost to represent the final monthly cost.
GCP
Need a hint?

Assign total_cost to monthly_cost as the final step.