From 8018a84b8b2f8be134bd58d9153e66c32cb11f49 Mon Sep 17 00:00:00 2001 From: Modular Magician Date: Mon, 4 Mar 2024 18:14:45 +0000 Subject: [PATCH] Fix hashicorp/terraform-provider-google#17388 (only run tests in beta) (#10093) [upstream:ae819d0619edd36414af1c5dc5f9e68a6b999174] Signed-off-by: Modular Magician --- .changelog/10093.txt | 3 + ..._check_app_attest_config_generated_test.go | 153 ------------------ ...rebase_app_check_app_attest_config_test.go | 2 +- ...se_app_check_debug_token_generated_test.go | 127 --------------- ...rce_firebase_app_check_debug_token_test.go | 6 +- ...ck_play_integrity_config_generated_test.go | 153 ------------------ ...se_app_check_play_integrity_config_test.go | 2 +- ...aptcha_enterprise_config_generated_test.go | 83 ---------- ..._check_recaptcha_enterprise_config_test.go | 2 +- ...heck_recaptcha_v3_config_generated_test.go | 83 ---------- ...base_app_check_recaptcha_v3_config_test.go | 2 +- ..._app_check_app_attest_config.html.markdown | 8 + ...rebase_app_check_debug_token.html.markdown | 8 +- ..._check_play_integrity_config.html.markdown | 8 + ..._recaptcha_enterprise_config.html.markdown | 4 + ...pp_check_recaptcha_v3_config.html.markdown | 4 + 16 files changed, 42 insertions(+), 606 deletions(-) create mode 100644 .changelog/10093.txt delete mode 100644 google/services/firebaseappcheck/resource_firebase_app_check_app_attest_config_generated_test.go delete mode 100644 google/services/firebaseappcheck/resource_firebase_app_check_debug_token_generated_test.go delete mode 100644 google/services/firebaseappcheck/resource_firebase_app_check_play_integrity_config_generated_test.go delete mode 100644 google/services/firebaseappcheck/resource_firebase_app_check_recaptcha_enterprise_config_generated_test.go delete mode 100644 google/services/firebaseappcheck/resource_firebase_app_check_recaptcha_v3_config_generated_test.go diff --git a/.changelog/10093.txt b/.changelog/10093.txt new file mode 100644 index 00000000000..384a458908f --- /dev/null +++ b/.changelog/10093.txt @@ -0,0 +1,3 @@ +```release-note:none +test only fixes +``` \ No newline at end of file diff --git a/google/services/firebaseappcheck/resource_firebase_app_check_app_attest_config_generated_test.go b/google/services/firebaseappcheck/resource_firebase_app_check_app_attest_config_generated_test.go deleted file mode 100644 index b9e80c57ead..00000000000 --- a/google/services/firebaseappcheck/resource_firebase_app_check_app_attest_config_generated_test.go +++ /dev/null @@ -1,153 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 - -// ---------------------------------------------------------------------------- -// -// *** AUTO GENERATED CODE *** Type: MMv1 *** -// -// ---------------------------------------------------------------------------- -// -// This file is automatically generated by Magic Modules and manual -// changes will be clobbered when the file is regenerated. -// -// Please read more about how to change this file in -// .github/CONTRIBUTING.md. -// -// ---------------------------------------------------------------------------- - -package firebaseappcheck_test - -import ( - "testing" - - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - - "github.com/hashicorp/terraform-provider-google/google/acctest" - "github.com/hashicorp/terraform-provider-google/google/envvar" -) - -func TestAccFirebaseAppCheckAppAttestConfig_firebaseAppCheckAppAttestConfigMinimalExample(t *testing.T) { - t.Parallel() - - context := map[string]interface{}{ - "project_id": envvar.GetTestProjectFromEnv(), - "team_id": "9987654321", - "random_suffix": acctest.RandString(t, 10), - } - - acctest.VcrTest(t, resource.TestCase{ - PreCheck: func() { acctest.AccTestPreCheck(t) }, - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t), - ExternalProviders: map[string]resource.ExternalProvider{ - "random": {}, - "time": {}, - }, - Steps: []resource.TestStep{ - { - Config: testAccFirebaseAppCheckAppAttestConfig_firebaseAppCheckAppAttestConfigMinimalExample(context), - }, - { - ResourceName: "google_firebase_app_check_app_attest_config.default", - ImportState: true, - ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"app_id"}, - }, - }, - }) -} - -func testAccFirebaseAppCheckAppAttestConfig_firebaseAppCheckAppAttestConfigMinimalExample(context map[string]interface{}) string { - return acctest.Nprintf(` -resource "google_firebase_apple_app" "default" { - project = "%{project_id}" - display_name = "Apple app" - bundle_id = "bundle.id.appattest%{random_suffix}" - team_id = "%{team_id}" -} - -# It takes a while for App Check to recognize the new app -# If your app already exists, you don't have to wait 30 seconds. -resource "time_sleep" "wait_30s" { - depends_on = [google_firebase_apple_app.default] - create_duration = "30s" -} - -resource "google_firebase_app_check_app_attest_config" "default" { - project = "%{project_id}" - app_id = google_firebase_apple_app.default.app_id - - depends_on = [time_sleep.wait_30s] - - lifecycle { - precondition { - condition = google_firebase_apple_app.default.team_id != "" - error_message = "Provide a Team ID on the Apple App to use App Check" - } - } -} -`, context) -} - -func TestAccFirebaseAppCheckAppAttestConfig_firebaseAppCheckAppAttestConfigFullExample(t *testing.T) { - t.Parallel() - - context := map[string]interface{}{ - "project_id": envvar.GetTestProjectFromEnv(), - "team_id": "9987654321", - "token_ttl": "7200s", - "random_suffix": acctest.RandString(t, 10), - } - - acctest.VcrTest(t, resource.TestCase{ - PreCheck: func() { acctest.AccTestPreCheck(t) }, - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t), - ExternalProviders: map[string]resource.ExternalProvider{ - "random": {}, - "time": {}, - }, - Steps: []resource.TestStep{ - { - Config: testAccFirebaseAppCheckAppAttestConfig_firebaseAppCheckAppAttestConfigFullExample(context), - }, - { - ResourceName: "google_firebase_app_check_app_attest_config.default", - ImportState: true, - ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"app_id"}, - }, - }, - }) -} - -func testAccFirebaseAppCheckAppAttestConfig_firebaseAppCheckAppAttestConfigFullExample(context map[string]interface{}) string { - return acctest.Nprintf(` -resource "google_firebase_apple_app" "default" { - project = "%{project_id}" - display_name = "Apple app" - bundle_id = "bundle.id.appattest%{random_suffix}" - team_id = "%{team_id}" -} - -# It takes a while for App Check to recognize the new app -# If your app already exists, you don't have to wait 30 seconds. -resource "time_sleep" "wait_30s" { - depends_on = [google_firebase_apple_app.default] - create_duration = "30s" -} - -resource "google_firebase_app_check_app_attest_config" "default" { - project = "%{project_id}" - app_id = google_firebase_apple_app.default.app_id - token_ttl = "%{token_ttl}" - - depends_on = [time_sleep.wait_30s] - - lifecycle { - precondition { - condition = google_firebase_apple_app.default.team_id != "" - error_message = "Provide a Team ID on the Apple App to use App Check" - } - } -} -`, context) -} diff --git a/google/services/firebaseappcheck/resource_firebase_app_check_app_attest_config_test.go b/google/services/firebaseappcheck/resource_firebase_app_check_app_attest_config_test.go index 5febb01343c..25621819463 100644 --- a/google/services/firebaseappcheck/resource_firebase_app_check_app_attest_config_test.go +++ b/google/services/firebaseappcheck/resource_firebase_app_check_app_attest_config_test.go @@ -23,7 +23,7 @@ func TestAccFirebaseAppCheckAppAttestConfig_firebaseAppCheckAppAttestConfigUpdat acctest.VcrTest(t, resource.TestCase{ PreCheck: func() { acctest.AccTestPreCheck(t) }, - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderBetaFactories(t), ExternalProviders: map[string]resource.ExternalProvider{ "random": {}, "time": {}, diff --git a/google/services/firebaseappcheck/resource_firebase_app_check_debug_token_generated_test.go b/google/services/firebaseappcheck/resource_firebase_app_check_debug_token_generated_test.go deleted file mode 100644 index c2dff94d980..00000000000 --- a/google/services/firebaseappcheck/resource_firebase_app_check_debug_token_generated_test.go +++ /dev/null @@ -1,127 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 - -// ---------------------------------------------------------------------------- -// -// *** AUTO GENERATED CODE *** Type: MMv1 *** -// -// ---------------------------------------------------------------------------- -// -// This file is automatically generated by Magic Modules and manual -// changes will be clobbered when the file is regenerated. -// -// Please read more about how to change this file in -// .github/CONTRIBUTING.md. -// -// ---------------------------------------------------------------------------- - -package firebaseappcheck_test - -import ( - "fmt" - "strings" - "testing" - - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - - "github.com/hashicorp/terraform-provider-google/google/acctest" - "github.com/hashicorp/terraform-provider-google/google/envvar" - "github.com/hashicorp/terraform-provider-google/google/tpgresource" - transport_tpg "github.com/hashicorp/terraform-provider-google/google/transport" -) - -func TestAccFirebaseAppCheckDebugToken_firebaseAppCheckDebugTokenBasicExample(t *testing.T) { - t.Parallel() - - context := map[string]interface{}{ - "project_id": envvar.GetTestProjectFromEnv(), - "token": "5E728315-E121-467F-BCA1-1FE71130BB98", - "random_suffix": acctest.RandString(t, 10), - } - - acctest.VcrTest(t, resource.TestCase{ - PreCheck: func() { acctest.AccTestPreCheck(t) }, - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t), - ExternalProviders: map[string]resource.ExternalProvider{ - "random": {}, - "time": {}, - }, - CheckDestroy: testAccCheckFirebaseAppCheckDebugTokenDestroyProducer(t), - Steps: []resource.TestStep{ - { - Config: testAccFirebaseAppCheckDebugToken_firebaseAppCheckDebugTokenBasicExample(context), - }, - { - ResourceName: "google_firebase_app_check_debug_token.default", - ImportState: true, - ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"token", "app_id"}, - }, - }, - }) -} - -func testAccFirebaseAppCheckDebugToken_firebaseAppCheckDebugTokenBasicExample(context map[string]interface{}) string { - return acctest.Nprintf(` -resource "google_firebase_web_app" "default" { - project = "%{project_id}" - display_name = "Web App for debug token" -} - -# It takes a while for App Check to recognize the new app -# If your app already exists, you don't have to wait 30 seconds. -resource "time_sleep" "wait_30s" { - depends_on = [google_firebase_web_app.default] - create_duration = "30s" -} - -resource "google_firebase_app_check_debug_token" "default" { - project = "%{project_id}" - app_id = google_firebase_web_app.default.app_id - display_name = "Debug Token%{random_suffix}" - token = "%{token}" - - depends_on = [time_sleep.wait_30s] -} -`, context) -} - -func testAccCheckFirebaseAppCheckDebugTokenDestroyProducer(t *testing.T) func(s *terraform.State) error { - return func(s *terraform.State) error { - for name, rs := range s.RootModule().Resources { - if rs.Type != "google_firebase_app_check_debug_token" { - continue - } - if strings.HasPrefix(name, "data.") { - continue - } - - config := acctest.GoogleProviderConfig(t) - - url, err := tpgresource.ReplaceVarsForTest(config, rs, "{{FirebaseAppCheckBasePath}}projects/{{project}}/apps/{{app_id}}/debugTokens/{{debug_token_id}}") - if err != nil { - return err - } - - billingProject := "" - - if config.BillingProject != "" { - billingProject = config.BillingProject - } - - _, err = transport_tpg.SendRequest(transport_tpg.SendRequestOptions{ - Config: config, - Method: "GET", - Project: billingProject, - RawURL: url, - UserAgent: config.UserAgent, - }) - if err == nil { - return fmt.Errorf("FirebaseAppCheckDebugToken still exists at %s", url) - } - } - - return nil - } -} diff --git a/google/services/firebaseappcheck/resource_firebase_app_check_debug_token_test.go b/google/services/firebaseappcheck/resource_firebase_app_check_debug_token_test.go index 26345c544bf..b6a992efa30 100644 --- a/google/services/firebaseappcheck/resource_firebase_app_check_debug_token_test.go +++ b/google/services/firebaseappcheck/resource_firebase_app_check_debug_token_test.go @@ -28,7 +28,7 @@ func TestAccFirebaseAppCheckDebugToken_firebaseAppCheckDebugTokenUpdate(t *testi acctest.VcrTest(t, resource.TestCase{ PreCheck: func() { acctest.AccTestPreCheck(t) }, - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderBetaFactories(t), ExternalProviders: map[string]resource.ExternalProvider{ "random": {}, "time": {}, @@ -60,6 +60,8 @@ func TestAccFirebaseAppCheckDebugToken_firebaseAppCheckDebugTokenUpdate(t *testi func testAccFirebaseAppCheckDebugToken_firebaseAppCheckDebugTokenTemplate(context map[string]interface{}) string { return acctest.Nprintf(` resource "google_firebase_web_app" "default" { + provider = google-beta + project = "%{project_id}" display_name = "Web App for debug token" } @@ -72,6 +74,8 @@ resource "time_sleep" "wait_30s" { } resource "google_firebase_app_check_debug_token" "default" { + provider = google-beta + project = "%{project_id}" app_id = google_firebase_web_app.default.app_id display_name = "%{display_name}" diff --git a/google/services/firebaseappcheck/resource_firebase_app_check_play_integrity_config_generated_test.go b/google/services/firebaseappcheck/resource_firebase_app_check_play_integrity_config_generated_test.go deleted file mode 100644 index 9ebc3b221c2..00000000000 --- a/google/services/firebaseappcheck/resource_firebase_app_check_play_integrity_config_generated_test.go +++ /dev/null @@ -1,153 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 - -// ---------------------------------------------------------------------------- -// -// *** AUTO GENERATED CODE *** Type: MMv1 *** -// -// ---------------------------------------------------------------------------- -// -// This file is automatically generated by Magic Modules and manual -// changes will be clobbered when the file is regenerated. -// -// Please read more about how to change this file in -// .github/CONTRIBUTING.md. -// -// ---------------------------------------------------------------------------- - -package firebaseappcheck_test - -import ( - "testing" - - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - - "github.com/hashicorp/terraform-provider-google/google/acctest" - "github.com/hashicorp/terraform-provider-google/google/envvar" -) - -func TestAccFirebaseAppCheckPlayIntegrityConfig_firebaseAppCheckPlayIntegrityConfigMinimalExample(t *testing.T) { - t.Parallel() - - context := map[string]interface{}{ - "project_id": envvar.GetTestProjectFromEnv(), - "random_suffix": acctest.RandString(t, 10), - } - - acctest.VcrTest(t, resource.TestCase{ - PreCheck: func() { acctest.AccTestPreCheck(t) }, - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t), - ExternalProviders: map[string]resource.ExternalProvider{ - "random": {}, - "time": {}, - }, - Steps: []resource.TestStep{ - { - Config: testAccFirebaseAppCheckPlayIntegrityConfig_firebaseAppCheckPlayIntegrityConfigMinimalExample(context), - }, - { - ResourceName: "google_firebase_app_check_play_integrity_config.default", - ImportState: true, - ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"app_id"}, - }, - }, - }) -} - -func testAccFirebaseAppCheckPlayIntegrityConfig_firebaseAppCheckPlayIntegrityConfigMinimalExample(context map[string]interface{}) string { - return acctest.Nprintf(` -resource "google_firebase_android_app" "default" { - project = "%{project_id}" - display_name = "Play Integrity app" - package_name = "package.name.playintegrity%{random_suffix}" - sha1_hashes = ["2145bdf698b8715039bd0e83f2069bed435ac21c"] - sha256_hashes = ["2145bdf698b8715039bd0e83f2069bed435ac21ca1b2c3d4e5f6123456789abc"] -} - -# It takes a while for App Check to recognize the new app -# If your app already exists, you don't have to wait 30 seconds. -resource "time_sleep" "wait_30s" { - depends_on = [google_firebase_android_app.default] - create_duration = "30s" -} - -resource "google_firebase_app_check_play_integrity_config" "default" { - project = "%{project_id}" - app_id = google_firebase_android_app.default.app_id - - depends_on = [time_sleep.wait_30s] - - lifecycle { - precondition { - condition = length(google_firebase_android_app.default.sha256_hashes) > 0 - error_message = "Provide a SHA-256 certificate on the Android App to use App Check" - } - } -} -`, context) -} - -func TestAccFirebaseAppCheckPlayIntegrityConfig_firebaseAppCheckPlayIntegrityConfigFullExample(t *testing.T) { - t.Parallel() - - context := map[string]interface{}{ - "project_id": envvar.GetTestProjectFromEnv(), - "token_ttl": "7200s", - "random_suffix": acctest.RandString(t, 10), - } - - acctest.VcrTest(t, resource.TestCase{ - PreCheck: func() { acctest.AccTestPreCheck(t) }, - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t), - ExternalProviders: map[string]resource.ExternalProvider{ - "random": {}, - "time": {}, - }, - Steps: []resource.TestStep{ - { - Config: testAccFirebaseAppCheckPlayIntegrityConfig_firebaseAppCheckPlayIntegrityConfigFullExample(context), - }, - { - ResourceName: "google_firebase_app_check_play_integrity_config.default", - ImportState: true, - ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"app_id"}, - }, - }, - }) -} - -func testAccFirebaseAppCheckPlayIntegrityConfig_firebaseAppCheckPlayIntegrityConfigFullExample(context map[string]interface{}) string { - return acctest.Nprintf(` -resource "google_firebase_android_app" "default" { - project = "%{project_id}" - display_name = "Play Integrity app" - package_name = "package.name.playintegrity%{random_suffix}" - sha1_hashes = ["2145bdf698b8715039bd0e83f2069bed435ac21c"] - sha256_hashes = ["2145bdf698b8715039bd0e83f2069bed435ac21ca1b2c3d4e5f6123456789abc"] -} - -# It takes a while for App Check to recognize the new app -# If your app already exists, you don't have to wait 30 seconds. -resource "time_sleep" "wait_30s" { - depends_on = [google_firebase_android_app.default] - create_duration = "30s" -} - -resource "google_firebase_app_check_play_integrity_config" "default" { - project = "%{project_id}" - app_id = google_firebase_android_app.default.app_id - token_ttl = "%{token_ttl}" - - depends_on = [time_sleep.wait_30s] - - lifecycle { - precondition { - condition = length(google_firebase_android_app.default.sha256_hashes) > 0 - error_message = "Provide a SHA-256 certificate on the Android App to use App Check" - } - } -} -`, context) -} diff --git a/google/services/firebaseappcheck/resource_firebase_app_check_play_integrity_config_test.go b/google/services/firebaseappcheck/resource_firebase_app_check_play_integrity_config_test.go index a48b6afd934..34bb2687bed 100644 --- a/google/services/firebaseappcheck/resource_firebase_app_check_play_integrity_config_test.go +++ b/google/services/firebaseappcheck/resource_firebase_app_check_play_integrity_config_test.go @@ -22,7 +22,7 @@ func TestAccFirebaseAppCheckPlayIntegrityConfig_firebaseAppCheckPlayIntegrityCon acctest.VcrTest(t, resource.TestCase{ PreCheck: func() { acctest.AccTestPreCheck(t) }, - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderBetaFactories(t), ExternalProviders: map[string]resource.ExternalProvider{ "random": {}, "time": {}, diff --git a/google/services/firebaseappcheck/resource_firebase_app_check_recaptcha_enterprise_config_generated_test.go b/google/services/firebaseappcheck/resource_firebase_app_check_recaptcha_enterprise_config_generated_test.go deleted file mode 100644 index bb5f1e62343..00000000000 --- a/google/services/firebaseappcheck/resource_firebase_app_check_recaptcha_enterprise_config_generated_test.go +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 - -// ---------------------------------------------------------------------------- -// -// *** AUTO GENERATED CODE *** Type: MMv1 *** -// -// ---------------------------------------------------------------------------- -// -// This file is automatically generated by Magic Modules and manual -// changes will be clobbered when the file is regenerated. -// -// Please read more about how to change this file in -// .github/CONTRIBUTING.md. -// -// ---------------------------------------------------------------------------- - -package firebaseappcheck_test - -import ( - "testing" - - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - - "github.com/hashicorp/terraform-provider-google/google/acctest" - "github.com/hashicorp/terraform-provider-google/google/envvar" -) - -func TestAccFirebaseAppCheckRecaptchaEnterpriseConfig_firebaseAppCheckRecaptchaEnterpriseConfigBasicExample(t *testing.T) { - t.Parallel() - - context := map[string]interface{}{ - "project_id": envvar.GetTestProjectFromEnv(), - "token_ttl": "7200s", - "site_key": "6LdpMXIpAAAAANkwWQPgEdjEhal7ugkH9RK9ytuw", - "random_suffix": acctest.RandString(t, 10), - } - - acctest.VcrTest(t, resource.TestCase{ - PreCheck: func() { acctest.AccTestPreCheck(t) }, - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t), - ExternalProviders: map[string]resource.ExternalProvider{ - "random": {}, - "time": {}, - }, - Steps: []resource.TestStep{ - { - Config: testAccFirebaseAppCheckRecaptchaEnterpriseConfig_firebaseAppCheckRecaptchaEnterpriseConfigBasicExample(context), - }, - { - ResourceName: "google_firebase_app_check_recaptcha_enterprise_config.default", - ImportState: true, - ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"app_id"}, - }, - }, - }) -} - -func testAccFirebaseAppCheckRecaptchaEnterpriseConfig_firebaseAppCheckRecaptchaEnterpriseConfigBasicExample(context map[string]interface{}) string { - return acctest.Nprintf(` -resource "google_firebase_web_app" "default" { - project = "%{project_id}" - display_name = "Web App for reCAPTCHA Enterprise" -} - -# It takes a while for App Check to recognize the new app -# If your app already exists, you don't have to wait 30 seconds. -resource "time_sleep" "wait_30s" { - depends_on = [google_firebase_web_app.default] - create_duration = "30s" -} - -resource "google_firebase_app_check_recaptcha_enterprise_config" "default" { - project = "%{project_id}" - app_id = google_firebase_web_app.default.app_id - site_key = "%{site_key}" - token_ttl = "%{token_ttl}" - - depends_on = [time_sleep.wait_30s] -} -`, context) -} diff --git a/google/services/firebaseappcheck/resource_firebase_app_check_recaptcha_enterprise_config_test.go b/google/services/firebaseappcheck/resource_firebase_app_check_recaptcha_enterprise_config_test.go index 5b89ea89ad7..fb954c6d969 100644 --- a/google/services/firebaseappcheck/resource_firebase_app_check_recaptcha_enterprise_config_test.go +++ b/google/services/firebaseappcheck/resource_firebase_app_check_recaptcha_enterprise_config_test.go @@ -30,7 +30,7 @@ func TestAccFirebaseAppCheckRecaptchaEnterpriseConfig_firebaseAppCheckRecaptchaE acctest.VcrTest(t, resource.TestCase{ PreCheck: func() { acctest.AccTestPreCheck(t) }, - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderBetaFactories(t), ExternalProviders: map[string]resource.ExternalProvider{ "random": {}, "time": {}, diff --git a/google/services/firebaseappcheck/resource_firebase_app_check_recaptcha_v3_config_generated_test.go b/google/services/firebaseappcheck/resource_firebase_app_check_recaptcha_v3_config_generated_test.go deleted file mode 100644 index 01a3c7ec9f3..00000000000 --- a/google/services/firebaseappcheck/resource_firebase_app_check_recaptcha_v3_config_generated_test.go +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 - -// ---------------------------------------------------------------------------- -// -// *** AUTO GENERATED CODE *** Type: MMv1 *** -// -// ---------------------------------------------------------------------------- -// -// This file is automatically generated by Magic Modules and manual -// changes will be clobbered when the file is regenerated. -// -// Please read more about how to change this file in -// .github/CONTRIBUTING.md. -// -// ---------------------------------------------------------------------------- - -package firebaseappcheck_test - -import ( - "testing" - - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - - "github.com/hashicorp/terraform-provider-google/google/acctest" - "github.com/hashicorp/terraform-provider-google/google/envvar" -) - -func TestAccFirebaseAppCheckRecaptchaV3Config_firebaseAppCheckRecaptchaV3ConfigBasicExample(t *testing.T) { - t.Parallel() - - context := map[string]interface{}{ - "project_id": envvar.GetTestProjectFromEnv(), - "token_ttl": "7200s", - "site_secret": "6Lf9YnQpAAAAAC3-MHmdAllTbPwTZxpUw5d34YzX", - "random_suffix": acctest.RandString(t, 10), - } - - acctest.VcrTest(t, resource.TestCase{ - PreCheck: func() { acctest.AccTestPreCheck(t) }, - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t), - ExternalProviders: map[string]resource.ExternalProvider{ - "random": {}, - "time": {}, - }, - Steps: []resource.TestStep{ - { - Config: testAccFirebaseAppCheckRecaptchaV3Config_firebaseAppCheckRecaptchaV3ConfigBasicExample(context), - }, - { - ResourceName: "google_firebase_app_check_recaptcha_v3_config.default", - ImportState: true, - ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"site_secret", "app_id"}, - }, - }, - }) -} - -func testAccFirebaseAppCheckRecaptchaV3Config_firebaseAppCheckRecaptchaV3ConfigBasicExample(context map[string]interface{}) string { - return acctest.Nprintf(` -resource "google_firebase_web_app" "default" { - project = "%{project_id}" - display_name = "Web App for reCAPTCHA V3" -} - -# It takes a while for App Check to recognize the new app -# If your app already exists, you don't have to wait 30 seconds. -resource "time_sleep" "wait_30s" { - depends_on = [google_firebase_web_app.default] - create_duration = "30s" -} - -resource "google_firebase_app_check_recaptcha_v3_config" "default" { - project = "%{project_id}" - app_id = google_firebase_web_app.default.app_id - site_secret = "%{site_secret}" - token_ttl = "%{token_ttl}" - - depends_on = [time_sleep.wait_30s] -} -`, context) -} diff --git a/google/services/firebaseappcheck/resource_firebase_app_check_recaptcha_v3_config_test.go b/google/services/firebaseappcheck/resource_firebase_app_check_recaptcha_v3_config_test.go index 1e45ca78c56..485e2a6c544 100644 --- a/google/services/firebaseappcheck/resource_firebase_app_check_recaptcha_v3_config_test.go +++ b/google/services/firebaseappcheck/resource_firebase_app_check_recaptcha_v3_config_test.go @@ -30,7 +30,7 @@ func TestAccFirebaseAppCheckRecaptchaV3Config_firebaseAppCheckRecaptchaV3ConfigU acctest.VcrTest(t, resource.TestCase{ PreCheck: func() { acctest.AccTestPreCheck(t) }, - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderBetaFactories(t), ExternalProviders: map[string]resource.ExternalProvider{ "random": {}, "time": {}, diff --git a/website/docs/r/firebase_app_check_app_attest_config.html.markdown b/website/docs/r/firebase_app_check_app_attest_config.html.markdown index 78b604df21c..ee82f3d3755 100644 --- a/website/docs/r/firebase_app_check_app_attest_config.html.markdown +++ b/website/docs/r/firebase_app_check_app_attest_config.html.markdown @@ -34,6 +34,8 @@ To get more information about AppAttestConfig, see: ```hcl resource "google_firebase_apple_app" "default" { + provider = google-beta + project = "my-project-name" display_name = "Apple app" bundle_id = "bundle.id.appattest" @@ -48,6 +50,8 @@ resource "time_sleep" "wait_30s" { } resource "google_firebase_app_check_app_attest_config" "default" { + provider = google-beta + project = "my-project-name" app_id = google_firebase_apple_app.default.app_id @@ -66,6 +70,8 @@ resource "google_firebase_app_check_app_attest_config" "default" { ```hcl resource "google_firebase_apple_app" "default" { + provider = google-beta + project = "my-project-name" display_name = "Apple app" bundle_id = "bundle.id.appattest" @@ -80,6 +86,8 @@ resource "time_sleep" "wait_30s" { } resource "google_firebase_app_check_app_attest_config" "default" { + provider = google-beta + project = "my-project-name" app_id = google_firebase_apple_app.default.app_id token_ttl = "7200s" diff --git a/website/docs/r/firebase_app_check_debug_token.html.markdown b/website/docs/r/firebase_app_check_debug_token.html.markdown index 5fe294250b3..450e3b09fba 100644 --- a/website/docs/r/firebase_app_check_debug_token.html.markdown +++ b/website/docs/r/firebase_app_check_debug_token.html.markdown @@ -41,18 +41,22 @@ values will be stored in the raw state as plain text: `token`. ```hcl resource "google_firebase_web_app" "default" { - project = "my-project-name" + provider = google-beta + + project = "my-project-name" display_name = "Web App for debug token" } # It takes a while for App Check to recognize the new app # If your app already exists, you don't have to wait 30 seconds. resource "time_sleep" "wait_30s" { - depends_on = [google_firebase_web_app.default] + depends_on = [google_firebase_web_app.default] create_duration = "30s" } resource "google_firebase_app_check_debug_token" "default" { + provider = google-beta + project = "my-project-name" app_id = google_firebase_web_app.default.app_id display_name = "Debug Token" diff --git a/website/docs/r/firebase_app_check_play_integrity_config.html.markdown b/website/docs/r/firebase_app_check_play_integrity_config.html.markdown index a4febb9a988..1398b8422d5 100644 --- a/website/docs/r/firebase_app_check_play_integrity_config.html.markdown +++ b/website/docs/r/firebase_app_check_play_integrity_config.html.markdown @@ -34,6 +34,8 @@ To get more information about PlayIntegrityConfig, see: ```hcl resource "google_firebase_android_app" "default" { + provider = google-beta + project = "my-project-name" display_name = "Play Integrity app" package_name = "package.name.playintegrity" @@ -49,6 +51,8 @@ resource "time_sleep" "wait_30s" { } resource "google_firebase_app_check_play_integrity_config" "default" { + provider = google-beta + project = "my-project-name" app_id = google_firebase_android_app.default.app_id @@ -67,6 +71,8 @@ resource "google_firebase_app_check_play_integrity_config" "default" { ```hcl resource "google_firebase_android_app" "default" { + provider = google-beta + project = "my-project-name" display_name = "Play Integrity app" package_name = "package.name.playintegrity" @@ -82,6 +88,8 @@ resource "time_sleep" "wait_30s" { } resource "google_firebase_app_check_play_integrity_config" "default" { + provider = google-beta + project = "my-project-name" app_id = google_firebase_android_app.default.app_id token_ttl = "7200s" diff --git a/website/docs/r/firebase_app_check_recaptcha_enterprise_config.html.markdown b/website/docs/r/firebase_app_check_recaptcha_enterprise_config.html.markdown index 1afc3c327e1..f604704c796 100644 --- a/website/docs/r/firebase_app_check_recaptcha_enterprise_config.html.markdown +++ b/website/docs/r/firebase_app_check_recaptcha_enterprise_config.html.markdown @@ -33,6 +33,8 @@ To get more information about RecaptchaEnterpriseConfig, see: ```hcl resource "google_firebase_web_app" "default" { + provider = google-beta + project = "my-project-name" display_name = "Web App for reCAPTCHA Enterprise" } @@ -45,6 +47,8 @@ resource "time_sleep" "wait_30s" { } resource "google_firebase_app_check_recaptcha_enterprise_config" "default" { + provider = google-beta + project = "my-project-name" app_id = google_firebase_web_app.default.app_id site_key = "6LdpMXIpAAAAANkwWQPgEdjEhal7ugkH9RK9ytuw" diff --git a/website/docs/r/firebase_app_check_recaptcha_v3_config.html.markdown b/website/docs/r/firebase_app_check_recaptcha_v3_config.html.markdown index 0985125e132..52d6c0839b2 100644 --- a/website/docs/r/firebase_app_check_recaptcha_v3_config.html.markdown +++ b/website/docs/r/firebase_app_check_recaptcha_v3_config.html.markdown @@ -37,6 +37,8 @@ values will be stored in the raw state as plain text: `site_secret`. ```hcl resource "google_firebase_web_app" "default" { + provider = google-beta + project = "my-project-name" display_name = "Web App for reCAPTCHA V3" } @@ -49,6 +51,8 @@ resource "time_sleep" "wait_30s" { } resource "google_firebase_app_check_recaptcha_v3_config" "default" { + provider = google-beta + project = "my-project-name" app_id = google_firebase_web_app.default.app_id site_secret = "6Lf9YnQpAAAAAC3-MHmdAllTbPwTZxpUw5d34YzX"