Terraform is an Infrastructure as code (IaC) tool that you can use to provision resources and permissions for Cloud Quotas. To learn how to use Terraform to provision infrastructure on Google Cloud, refer to the Terraform on Google Cloud documentation.
You can use Terraform to do the following with Cloud Quotas:
- Retrieve the
QuotaInfo
data source of a quota for a project, folder or organization. - List
QuotaInfos
data source of all quotas for a given project, folder or organization. - Create a new, or update an existing,
QuotaPreference
quota configuration that specifies the preferred value for a quota.
Before you begin
Before you begin, you need access to Terraform:
If you're getting started, note that Cloud Shell has Terraform already integrated, and you can follow this step by step tutorial, Deploy a basic Flask web server using Terraform and Cloud Shell.
If you'd prefer to install Terraform yourself, see HashiCorp's Terraform installation instructions.
To use Terraform with Cloud Quotas, create a configuration file to describe your infrastructure, and then apply the configuration file to create an execution plan and perform operations to provision your infrastructure.
Terraform resources and data sources
The following table lists Cloud Quotas configuration samples that appear in the Terraform registry.
Cloud Quotas resources and data sources | Terraform registry sample |
---|---|
Data source: QuotaInfo of a quota for a project, folder or organization |
google_cloud_quotas_quota_info |
Data source: QuotaInfos of all quotas for a given project, folder or organization |
google_cloud_quotas_quota_infos |
Resource: QuotaPreference |
google_cloud_quotas_quota_preference |
What's next
Learn more about Terraform: