Skip to content

Commit

Permalink
fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
lola98 committed Aug 9, 2024
1 parent 5c43b86 commit 77de0ea
Showing 1 changed file with 111 additions and 113 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0
package cloudquotas_test

import (
Expand Down Expand Up @@ -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 = "[email protected]"
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 = "[email protected]"
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 = "[email protected]"
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 = "[email protected]"
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)
}

0 comments on commit 77de0ea

Please sign in to comment.