From 9d0acdac13fb409c47d28ad94db80c71892632f5 Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Sat, 22 Mar 2025 17:14:10 -0400 Subject: [PATCH] Make public IP address quota based on actual use. --- terraform/quota.tf | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/terraform/quota.tf b/terraform/quota.tf index 2d82d8a..17b0e76 100644 --- a/terraform/quota.tf +++ b/terraform/quota.tf @@ -1,5 +1,10 @@ # TODO: Make public IP quota dependent on var.public_ingress and update the amount to match what is expected to be spun up. +locals { + num_clusters = 14 + num_public_ip_addresses = var.ingress_type == "gce" ? 10 * local.num_clusters : local.num_clusters +} + # resource "google_cloud_quotas_quota_preference" "clusters_per_region" { # count = var.quota_email == null ? 0 : 1 # parent = "projects/${google_project.project.project_id}" @@ -24,7 +29,7 @@ # quota_id = "IN-USE-ADDRESSES-per-project-region" # contact_email = var.quota_email # quota_config { -# preferred_value = 70 +# preferred_value = local.num_public_ip_addresses # } # justification = var.quota_justification # depends_on = [google_project_service.service["cloudquotas"], ]