/terraform-google-quota-limits

🌪️ Terraform module to update Google Cloud consumer quota limits

Primary LanguageHCLApache License 2.0Apache-2.0

Update Google Cloud Consumer Quota Limits

Badge: Google Cloud Badge: Terraform Badge: CI Badge: GitHub

Override consumer quota limits for Google Cloud Platform projects. Ideal to limit the use of expensive CPUs and GPUs.

Screenshot: C3 CPU Quotas

Warning This module cannot be used to grant more quota than would be allowed by admin overrides, producer overrides, or the default limit of the service.

Note You can also limit Compute Engine resources with custom constraints. More details can be found in the Google Cloud documentation.

Example

  1. All default metrics (input metrics) in all default regions (input regions) are set to 0.
  2. In region europe-west4,
  • four (4) N1 and E2 CPUs (metric compute.googleapis.com/cpus) and
  • four (4) C3 CPUs (metric compute.googleapis.com/c3_cpus) are allowed.
module "quota-limits" {
  source     = "Cyclenerd/quota-limits/google"
  version    = "~> 1.0.0"
  project_id = "your-project-id"
  limits     = {
    "europe-west4" = {
      "compute.googleapis.com/cpus"    = "4" # N1, E2
      "compute.googleapis.com/c3_cpus" = "4" # C3
    }
  }
}

👉 More examples

Quotas

Lists (CSV) with service quota metrics for a consumer:

Providers

Name Version
google-beta 4.61.0

Inputs

Name Description Type Default Required
limits The qutoa limits per metric and region to be limited and set to the given value map(map(number)) {} no
metrics The metrics that should be limited and set to 0 list(string)
[
"compute.googleapis.com/a2_cpus",
"compute.googleapis.com/c2_cpus",
"compute.googleapis.com/c2d_cpus",
"compute.googleapis.com/c3_cpus",
"compute.googleapis.com/cpus",
"compute.googleapis.com/m1_cpus",
"compute.googleapis.com/m2_cpus",
"compute.googleapis.com/m3_cpus",
"compute.googleapis.com/n2_cpus",
"compute.googleapis.com/n2d_cpus",
"compute.googleapis.com/nvidia_a100_80gb_gpus",
"compute.googleapis.com/nvidia_a100_gpus",
"compute.googleapis.com/nvidia_k80_gpus",
"compute.googleapis.com/nvidia_p100_gpus",
"compute.googleapis.com/nvidia_p100_vws_gpus",
"compute.googleapis.com/nvidia_p4_gpus",
"compute.googleapis.com/nvidia_p4_vws_gpus",
"compute.googleapis.com/nvidia_t4_gpus",
"compute.googleapis.com/nvidia_t4_vws_gpus",
"compute.googleapis.com/nvidia_v100_gpus",
"compute.googleapis.com/nvidia_l4_gpus",
"compute.googleapis.com/nvidia_l4_vws_gpus",
"compute.googleapis.com/t2a_cpus",
"compute.googleapis.com/t2d_cpus"
]
no
project_id The project ID that should be limited string n/a yes
regions Google Cloud regions that should be limited list(string)
[
"africa-south1",
"asia-east1",
"asia-east2",
"asia-northeast1",
"asia-northeast2",
"asia-northeast3",
"asia-south1",
"asia-south2",
"asia-southeast1",
"asia-southeast2",
"australia-southeast1",
"australia-southeast2",
"europe-central2",
"europe-north1",
"europe-southwest1",
"europe-west1",
"europe-west10",
"europe-west12",
"europe-west2",
"europe-west3",
"europe-west4",
"europe-west6",
"europe-west8",
"europe-west9",
"me-central1",
"me-west1",
"northamerica-northeast1",
"northamerica-northeast2",
"southamerica-east1",
"southamerica-west1",
"us-central1",
"us-east1",
"us-east4",
"us-east5",
"us-south1",
"us-west1",
"us-west2",
"us-west3",
"us-west4"
]
no

Outputs

Name Description
limits Quota limits per metric and region
metrics The metrics that are limited
quotas The quotas per metric and region that are limited
regions The regions that are limited

License

All files in this repository are under the Apache License, Version 2.0 unless noted otherwise.