0
0
GCPcloud~10 mins

Cost management with billing reports in GCP - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to enable billing export to BigQuery.

GCP
gcloud beta billing export bigquery set --billing-account [1] --dataset my_billing_dataset
Drag options to blanks, or click blank then click option'
Abilling-export
Bmy-project-id
C012345-6789AB-CDEF01
Dmy-billing-account
Attempts:
3 left
💡 Hint
Common Mistakes
Using the project ID instead of the billing account ID
Using the dataset name as billing account
2fill in blank
medium

Complete the code to create a BigQuery dataset for billing export.

GCP
bq mk --dataset [1]:my_billing_dataset
Drag options to blanks, or click blank then click option'
Abilling-dataset
Bmy-project-id
Cbilling-account
Dbilling-project
Attempts:
3 left
💡 Hint
Common Mistakes
Using billing account ID instead of project ID
Using dataset name as project ID
3fill in blank
hard

Fix the error in the SQL query to calculate total cost per service.

GCP
SELECT service.description, SUM(cost) AS total_cost FROM `[1].gcp_billing_export_v1_0123456789ABCDEF` GROUP BY service.description
Drag options to blanks, or click blank then click option'
Amy-project-id.billing
Bbilling-project.billing
Cbilling-account.billing
Dmy-project-id.my_billing_dataset
Attempts:
3 left
💡 Hint
Common Mistakes
Using billing account ID as dataset
Using incorrect dataset name with dots
4fill in blank
hard

Fill both blanks to filter billing data for the last 30 days and group by project.

GCP
SELECT project.id, SUM(cost) AS total_cost FROM `[1].my_billing_dataset.[2]` WHERE usage_start_time >= TIMESTAMP_SUB(CURRENT_TIMESTAMP(), INTERVAL 30 DAY) GROUP BY project.id
Drag options to blanks, or click blank then click option'
Amy-project-id
Bgcp_billing_export_v1_0123456789ABCDEF
Cbilling_dataset
Dbilling_export
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping project ID and dataset name
Using incorrect table name
5fill in blank
hard

Fill all three blanks to create a billing alert policy using gcloud CLI.

GCP
gcloud alpha billing budgets create --billing-account=[1] --display-name=[2] --amount=[3]
Drag options to blanks, or click blank then click option'
A012345-6789AB-CDEF01
B"Monthly Budget Alert"
C1000
Dmy-budget
Attempts:
3 left
💡 Hint
Common Mistakes
Not quoting the display name
Using project ID instead of billing account
Using string instead of number for amount