Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/cyclenerd/terraform-google-quota-limits

🌪️ Terraform module to update Google Cloud consumer quota limits
https://github.com/cyclenerd/terraform-google-quota-limits

gcp gcp-terraform-module google-cloud google-cloud-platform quotas terraform terraform-module

Last synced: 2 months ago
JSON representation

🌪️ Terraform module to update Google Cloud consumer quota limits

Awesome Lists containing this project

README

        

# Update Google Cloud Consumer Quota Limits

[![Badge: Google Cloud](https://img.shields.io/badge/Google%20Cloud-%234285F4.svg?logo=google-cloud&logoColor=white)](https://github.com/Cyclenerd/terraform-google-quota-limits#readme)
[![Badge: Terraform](https://img.shields.io/badge/Terraform-%235835CC.svg?logo=terraform&logoColor=white)](https://github.com/Cyclenerd/terraform-google-quota-limits#readme)
[![Badge: CI](https://github.com/Cyclenerd/terraform-google-quota-limits/actions/workflows/ci.yml/badge.svg)](https://github.com/Cyclenerd/terraform-google-quota-limits/actions/workflows/ci.yml)
[![Badge: GitHub](https://img.shields.io/github/license/cyclenerd/terraform-google-quota-limits)](https://github.com/Cyclenerd/google-cloud-pricing-cost-calculator/blob/master/LICENSE)

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

[![Screenshot: C3 CPU Quotas](https://raw.githubusercontent.com/Cyclenerd/terraform-google-quota-limits/master/img/quotas_c3_cpus.png)](https://github.com/Cyclenerd/terraform-google-quota-limits#readme)

> **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](https://cloud.google.com/compute/docs/access/custom-constraints).

## Example

1. All [default metrics](https://github.com/Cyclenerd/terraform-google-quota-limits#input_metrics) (input `metrics`) in all [default regions](https://github.com/Cyclenerd/terraform-google-quota-limits#input_regions) (input `regions`) are set to `0`.
1. In region `europe-west4`,
* four (`4`) [N1 and E2 CPUs](https://gcloud-compute.com/instances.html) (metric `compute.googleapis.com/cpus`) and
* four (`4`) [C3 CPUs](https://gcloud-compute.com/instances.html) (metric `compute.googleapis.com/c3_cpus`) are allowed.

```hcl
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](https://github.com/Cyclenerd/terraform-google-quota-limits/tree/master/examples)**

## Quotas

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

* [Compute Engine `compute.googleapis.com`](https://github.com/Cyclenerd/terraform-google-quota-limits/blob/master/tools/compute.csv)
* [Cloud Storage `storage.googleapis.com`](https://github.com/Cyclenerd/terraform-google-quota-limits/blob/master/tools/storage.csv)
* [BigQuery `bigquery.googleapis.com`](https://github.com/Cyclenerd/terraform-google-quota-limits/blob/master/tools/bigquery.csv)

## Providers

| Name | Version |
|------|---------|
| [google-beta](#provider\_google-beta) | 4.61.0 |

## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| [limits](#input\_limits) | The qutoa limits per metric and region to be limited and set to the given value | `map(map(number))` | `{}` | no |
| [metrics](#input\_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](#input\_project\_id) | The project ID that should be limited | `string` | n/a | yes |
| [regions](#input\_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](#output\_limits) | Quota limits per metric and region |
| [metrics](#output\_metrics) | The metrics that are limited |
| [quotas](#output\_quotas) | The quotas per metric and region that are limited |
| [regions](#output\_regions) | The regions that are limited |

## License

All files in this repository are under the [Apache License, Version 2.0](LICENSE) unless noted otherwise.