How to Use Committed Use Discounts in GCP for Cost Savings
To use
Committed Use Discounts (CUDs) in GCP, you purchase a commitment for a specific resource type and usage amount for 1 or 3 years. GCP then automatically applies discounted rates to matching resources in your billing account, lowering your costs without changing your workloads.Syntax
Committed Use Discounts are configured by specifying the resource type, commitment amount, and duration. You purchase a commitment via the GCP Console, gcloud CLI, or Billing API.
- Resource Type: The specific service (e.g., Compute Engine vCPUs, memory).
- Commitment Amount: How much resource you commit to use (e.g., 4 vCPUs).
- Duration: 1 year or 3 years commitment period.
Once purchased, GCP automatically applies discounts to matching usage in your billing account.
bash
gcloud beta billing commitments create \
--billing-account=YOUR_BILLING_ACCOUNT_ID \
--plan=TWELVE_MONTH \
--resources=compute.googleapis.com/vcpus=4Output
Created commitment with ID: commitment-1234567890
Example
This example shows how to create a 1-year committed use discount for 4 Compute Engine vCPUs using the gcloud CLI. After purchase, your billing automatically applies the discount to matching VM usage.
bash
gcloud beta billing commitments create \ --billing-account=012345-6789AB-CDEF01 \ --plan=TWELVE_MONTH \ --resources=compute.googleapis.com/vcpus=4
Output
Created commitment with ID: commitment-1234567890
Common Pitfalls
- Overcommitting: Buying more resources than you use wastes money because commitments are billed regardless of usage.
- Wrong resource type: Committing to the wrong resource (e.g., memory instead of vCPUs) means discounts won't apply to your actual usage.
- Not monitoring usage: Without tracking your resource usage, you might not benefit fully from your commitments.
- Commitment duration: Choosing a 3-year plan without certainty can lock you into long-term costs.
Always analyze your usage patterns before purchasing commitments.
bash
### Wrong way: committing to memory when you need vCPUs gcloud beta billing commitments create \ --billing-account=012345-6789AB-CDEF01 \ --plan=TWELVE_MONTH \ --resources=compute.googleapis.com/memory=16GB ### Right way: committing to vCPUs if that matches your usage gcloud beta billing commitments create \ --billing-account=012345-6789AB-CDEF01 \ --plan=TWELVE_MONTH \ --resources=compute.googleapis.com/vcpus=4
Quick Reference
- Purchase via: GCP Console, gcloud CLI, or Billing API.
- Commitment types: vCPU, memory, GPUs, etc.
- Duration options: 1 year or 3 years.
- Discounts: Automatically applied to matching usage.
- Cancellation: Commitments cannot be canceled or refunded.
Key Takeaways
Buy committed use discounts for specific resource types and amounts to save costs in GCP.
Use the gcloud CLI or GCP Console to create commitments for 1 or 3 years.
Ensure your committed resources match your actual usage to maximize savings.
Committed use discounts apply automatically to matching usage in your billing account.
Commitments are non-refundable and billed regardless of actual usage, so plan carefully.