diff --git a/mmv1/third_party/terraform/services/cloudquotas/resource_cloud_quotas_quota_preference_test.go b/mmv1/third_party/terraform/services/cloudquotas/resource_cloud_quotas_quota_preference_test.go index 72e374b4ab4a..c6d7b83a9520 100644 --- a/mmv1/third_party/terraform/services/cloudquotas/resource_cloud_quotas_quota_preference_test.go +++ b/mmv1/third_party/terraform/services/cloudquotas/resource_cloud_quotas_quota_preference_test.go @@ -1,5 +1,3 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 package cloudquotas_test import ( @@ -60,123 +58,123 @@ func TestAccCloudQuotasQuotaPreference_cloudquotasQuotaPreferenceBasicExample_up func testAccCloudQuotasQuotaPreference_cloudquotasQuotaPreferenceBasicExample_basic(context map[string]interface{}) string { return acctest.Nprintf(` - resource "google_project" "new_project" { - project_id = "tf-test%{random_suffix}" - name = "tf-test%{random_suffix}" - org_id = "%{org_id}" - billing_account = "%{billing_account}" - } - - resource "google_project_service" "cloudquotas" { - project = google_project.new_project.project_id - service = "cloudquotas.googleapis.com" - } - - resource "google_project_service" "compute" { - project = google_project.new_project.project_id - service = "compute.googleapis.com" - depends_on = [google_project_service.cloudquotas] - } - - resource "google_project_service" "billing" { - project = google_project.new_project.project_id - service = "cloudbilling.googleapis.com" - depends_on = [google_project_service.compute] - } - - resource "time_sleep" "wait_120_seconds" { - create_duration = "120s" - depends_on = [google_project_service.billing] - } - - resource "google_cloud_quotas_quota_preference" "my_preference"{ - parent = "projects/${google_project.new_project.project_id}" - name = "compute_googleapis_com-CPUS-per-project_us-central1" - dimensions = { region = "us-central1" } - service = "compute.googleapis.com" - quota_id = "CPUS-per-project-region" - contact_email = "testuser@gmail.com" - quota_config { - preferred_value = 70 - } - ignore_safety_checks = "QUOTA_DECREASE_PERCENTAGE_TOO_HIGH" - depends_on = [ - time_sleep.wait_120_seconds - ] - } - `, context) + resource "google_project" "new_project" { + project_id = "tf-test%{random_suffix}" + name = "tf-test%{random_suffix}" + org_id = "%{org_id}" + billing_account = "%{billing_account}" + } + + resource "google_project_service" "cloudquotas" { + project = google_project.new_project.project_id + service = "cloudquotas.googleapis.com" + } + + resource "google_project_service" "compute" { + project = google_project.new_project.project_id + service = "compute.googleapis.com" + depends_on = [google_project_service.cloudquotas] + } + + resource "google_project_service" "billing" { + project = google_project.new_project.project_id + service = "cloudbilling.googleapis.com" + depends_on = [google_project_service.compute] + } + + resource "time_sleep" "wait_120_seconds" { + create_duration = "120s" + depends_on = [google_project_service.billing] + } + + resource "google_cloud_quotas_quota_preference" "my_preference"{ + parent = "projects/${google_project.new_project.project_id}" + name = "compute_googleapis_com-CPUS-per-project_us-central1" + dimensions = { region = "us-central1" } + service = "compute.googleapis.com" + quota_id = "CPUS-per-project-region" + contact_email = "testuser@gmail.com" + quota_config { + preferred_value = 70 + } + ignore_safety_checks = "QUOTA_DECREASE_PERCENTAGE_TOO_HIGH" + depends_on = [ + time_sleep.wait_120_seconds + ] + } + `, context) } func testAccCloudQuotasQuotaPreference_cloudquotasQuotaPreferenceBasicExample_increaseQuota(context map[string]interface{}) string { return acctest.Nprintf(` - resource "google_project" "new_project" { - project_id = "tf-test%{random_suffix}" - name = "tf-test%{random_suffix}" - org_id = "%{org_id}" - billing_account = "%{billing_account}" - } - - resource "google_project_service" "cloudquotas" { - project = google_project.new_project.project_id - service = "cloudquotas.googleapis.com" - } - - resource "google_project_service" "compute" { - project = google_project.new_project.project_id - service = "compute.googleapis.com" - depends_on = [google_project_service.cloudquotas] - } - - resource "google_project_service" "billing" { - project = google_project.new_project.project_id - service = "cloudbilling.googleapis.com" - depends_on = [google_project_service.compute] - } - - resource "google_cloud_quotas_quota_preference" "my_preference"{ - contact_email = "testinguser2@google.com" - justification = "Ignore. Increase quota for Terraform testing." - quota_config { - preferred_value = 72 - annotations = { label = "terraform" } - } - depends_on = [google_project_service.billing] - } - `, context) + resource "google_project" "new_project" { + project_id = "tf-test%{random_suffix}" + name = "tf-test%{random_suffix}" + org_id = "%{org_id}" + billing_account = "%{billing_account}" + } + + resource "google_project_service" "cloudquotas" { + project = google_project.new_project.project_id + service = "cloudquotas.googleapis.com" + } + + resource "google_project_service" "compute" { + project = google_project.new_project.project_id + service = "compute.googleapis.com" + depends_on = [google_project_service.cloudquotas] + } + + resource "google_project_service" "billing" { + project = google_project.new_project.project_id + service = "cloudbilling.googleapis.com" + depends_on = [google_project_service.compute] + } + + resource "google_cloud_quotas_quota_preference" "my_preference"{ + contact_email = "testinguser2@google.com" + justification = "Ignore. Increase quota for Terraform testing." + quota_config { + preferred_value = 72 + annotations = { label = "terraform" } + } + depends_on = [google_project_service.billing] + } + `, context) } func testAccCloudQuotasQuotaPreference_cloudquotasQuotaPreferenceBasicExample_decreaseQuota(context map[string]interface{}) string { return acctest.Nprintf(` - resource "google_project" "new_project" { - project_id = "tf-test%{random_suffix}" - name = "tf-test%{random_suffix}" - org_id = "%{org_id}" - billing_account = "%{billing_account}" - } - - resource "google_project_service" "cloudquotas" { - project = google_project.new_project.project_id - service = "cloudquotas.googleapis.com" - } - - resource "google_project_service" "compute" { - project = google_project.new_project.project_id - service = "compute.googleapis.com" - depends_on = [google_project_service.cloudquotas] - } - - resource "google_project_service" "billing" { - project = google_project.new_project.project_id - service = "cloudbilling.googleapis.com" - depends_on = [google_project_service.compute] - } - - resource "google_cloud_quotas_quota_preference" "my_preference"{ - ignore_safety_checks = "QUOTA_DECREASE_PERCENTAGE_TOO_HIGH" - quota_config { - preferred_value = 65 - } - depends_on = [google_project_service.billing] - } - `, context) + resource "google_project" "new_project" { + project_id = "tf-test%{random_suffix}" + name = "tf-test%{random_suffix}" + org_id = "%{org_id}" + billing_account = "%{billing_account}" + } + + resource "google_project_service" "cloudquotas" { + project = google_project.new_project.project_id + service = "cloudquotas.googleapis.com" + } + + resource "google_project_service" "compute" { + project = google_project.new_project.project_id + service = "compute.googleapis.com" + depends_on = [google_project_service.cloudquotas] + } + + resource "google_project_service" "billing" { + project = google_project.new_project.project_id + service = "cloudbilling.googleapis.com" + depends_on = [google_project_service.compute] + } + + resource "google_cloud_quotas_quota_preference" "my_preference"{ + ignore_safety_checks = "QUOTA_DECREASE_PERCENTAGE_TOO_HIGH" + quota_config { + preferred_value = 65 + } + depends_on = [google_project_service.billing] + } + `, context) }