Get all available machine types (tiers) for a project, for example, db-custom-1-3840. For more information see the official documentation and API.
data "google_sql_tiers" "tiers" {
project = "sample-project"
}
locals {
all_available_tiers = [for v in data.google_sql_tiers.tiers.tiers : v.tier]
}
output "avaialble_tiers" {
description = "List of all available tiers for give project."
value = local.all_available_tiers
}
The following arguments are supported:
project
- (Optional) The Project ID for which to list tiers. If project
is not provided, the project defined within the default provider configuration is used.The following attributes are exported:
tiers
- A list of all available machine types (tiers) for project. Each contains:
tier
- An identifier for the machine type, for example, db-custom-1-3840.ram
- The maximum ram usage of this tier in bytes.disk_quota
- The maximum disk size of this tier in bytes.region
- The applicable regions for this tier.