From c819169cefc75bf31f6c7523cad86efba9554698 Mon Sep 17 00:00:00 2001 From: Modular Magician Date: Mon, 4 Mar 2024 21:35:56 +0000 Subject: [PATCH] Revert "Fix hashicorp/terraform-provider-google#17388 (only run tests in beta)" (#10111) This reverts commit ae819d0619edd36414af1c5dc5f9e68a6b999174. [upstream:712cce7da0b4d17e9ee5295c2df2ae67df9d4118] Signed-off-by: Modular Magician --- .changelog/10111.txt | 2 + ..._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, 608 insertions(+), 39 deletions(-) create mode 100644 .changelog/10111.txt create mode 100644 google/services/firebaseappcheck/resource_firebase_app_check_app_attest_config_generated_test.go create mode 100644 google/services/firebaseappcheck/resource_firebase_app_check_debug_token_generated_test.go create mode 100644 google/services/firebaseappcheck/resource_firebase_app_check_play_integrity_config_generated_test.go create mode 100644 google/services/firebaseappcheck/resource_firebase_app_check_recaptcha_enterprise_config_generated_test.go create mode 100644 google/services/firebaseappcheck/resource_firebase_app_check_recaptcha_v3_config_generated_test.go diff --git a/.changelog/10111.txt b/.changelog/10111.txt new file mode 100644 index 00000000000..126505bd3f5 --- /dev/null +++ b/.changelog/10111.txt @@ -0,0 +1,2 @@ +```release-note:none +``` \ 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 new file mode 100644 index 00000000000..b9e80c57ead --- /dev/null +++ b/google/services/firebaseappcheck/resource_firebase_app_check_app_attest_config_generated_test.go @@ -0,0 +1,153 @@ +// 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 25621819463..5febb01343c 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.ProtoV5ProviderBetaFactories(t), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(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 new file mode 100644 index 00000000000..c2dff94d980 --- /dev/null +++ b/google/services/firebaseappcheck/resource_firebase_app_check_debug_token_generated_test.go @@ -0,0 +1,127 @@ +// 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 b6a992efa30..26345c544bf 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.ProtoV5ProviderBetaFactories(t), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t), ExternalProviders: map[string]resource.ExternalProvider{ "random": {}, "time": {}, @@ -60,8 +60,6 @@ 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" } @@ -74,8 +72,6 @@ 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 new file mode 100644 index 00000000000..9ebc3b221c2 --- /dev/null +++ b/google/services/firebaseappcheck/resource_firebase_app_check_play_integrity_config_generated_test.go @@ -0,0 +1,153 @@ +// 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 34bb2687bed..a48b6afd934 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.ProtoV5ProviderBetaFactories(t), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(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 new file mode 100644 index 00000000000..bb5f1e62343 --- /dev/null +++ b/google/services/firebaseappcheck/resource_firebase_app_check_recaptcha_enterprise_config_generated_test.go @@ -0,0 +1,83 @@ +// 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 fb954c6d969..5b89ea89ad7 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.ProtoV5ProviderBetaFactories(t), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(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 new file mode 100644 index 00000000000..01a3c7ec9f3 --- /dev/null +++ b/google/services/firebaseappcheck/resource_firebase_app_check_recaptcha_v3_config_generated_test.go @@ -0,0 +1,83 @@ +// 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 485e2a6c544..1e45ca78c56 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.ProtoV5ProviderBetaFactories(t), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(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 ee82f3d3755..78b604df21c 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,8 +34,6 @@ 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" @@ -50,8 +48,6 @@ 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 @@ -70,8 +66,6 @@ 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" @@ -86,8 +80,6 @@ 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 450e3b09fba..5fe294250b3 100644 --- a/website/docs/r/firebase_app_check_debug_token.html.markdown +++ b/website/docs/r/firebase_app_check_debug_token.html.markdown @@ -41,22 +41,18 @@ values will be stored in the raw state as plain text: `token`. ```hcl resource "google_firebase_web_app" "default" { - provider = google-beta - - project = "my-project-name" + 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 1398b8422d5..a4febb9a988 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,8 +34,6 @@ 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" @@ -51,8 +49,6 @@ 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 @@ -71,8 +67,6 @@ 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" @@ -88,8 +82,6 @@ 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 f604704c796..1afc3c327e1 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,8 +33,6 @@ 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" } @@ -47,8 +45,6 @@ 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 52d6c0839b2..0985125e132 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,8 +37,6 @@ 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" } @@ -51,8 +49,6 @@ 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"