From 800d5bb6ce97f3910d2c3604daef475a617e0b4a Mon Sep 17 00:00:00 2001 From: Modular Magician Date: Wed, 23 Aug 2023 16:55:46 +0000 Subject: [PATCH] fix permadiff on `google_identity_platform_config.authorized_domains` (#8740) Signed-off-by: Modular Magician --- .changelog/8740.txt | 3 ++ .../resource_identity_platform_config.go | 1 + ...identity_platform_config_generated_test.go | 50 +++++++++++++++++++ 3 files changed, 54 insertions(+) create mode 100644 .changelog/8740.txt diff --git a/.changelog/8740.txt b/.changelog/8740.txt new file mode 100644 index 00000000000..4ef41e85abf --- /dev/null +++ b/.changelog/8740.txt @@ -0,0 +1,3 @@ +```release-note:bug +identityplatform: fixed a permadiff on `authorized_domains` in `google_identity_platform_config` resource +``` diff --git a/google/services/identityplatform/resource_identity_platform_config.go b/google/services/identityplatform/resource_identity_platform_config.go index 03700ae4382..3cbd1daeb37 100644 --- a/google/services/identityplatform/resource_identity_platform_config.go +++ b/google/services/identityplatform/resource_identity_platform_config.go @@ -50,6 +50,7 @@ func ResourceIdentityPlatformConfig() *schema.Resource { Schema: map[string]*schema.Schema{ "authorized_domains": { Type: schema.TypeList, + Computed: true, Optional: true, Description: `List of domains authorized for OAuth redirects.`, Elem: &schema.Schema{ diff --git a/google/services/identityplatform/resource_identity_platform_config_generated_test.go b/google/services/identityplatform/resource_identity_platform_config_generated_test.go index c83c66e8408..f5fec30f788 100644 --- a/google/services/identityplatform/resource_identity_platform_config_generated_test.go +++ b/google/services/identityplatform/resource_identity_platform_config_generated_test.go @@ -101,3 +101,53 @@ resource "google_identity_platform_config" "default" { } `, context) } + +func TestAccIdentityPlatformConfig_identityPlatformConfigMinimalExample(t *testing.T) { + acctest.SkipIfVcr(t) + t.Parallel() + + context := map[string]interface{}{ + "org_id": envvar.GetTestOrgFromEnv(t), + "billing_acct": envvar.GetTestBillingAccountFromEnv(t), + "random_suffix": acctest.RandString(t, 10), + } + + acctest.VcrTest(t, resource.TestCase{ + PreCheck: func() { acctest.AccTestPreCheck(t) }, + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t), + Steps: []resource.TestStep{ + { + Config: testAccIdentityPlatformConfig_identityPlatformConfigMinimalExample(context), + }, + { + ResourceName: "google_identity_platform_config.default", + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func testAccIdentityPlatformConfig_identityPlatformConfigMinimalExample(context map[string]interface{}) string { + return acctest.Nprintf(` +resource "google_project" "default" { + project_id = "tf-test-my-project-1%{random_suffix}" + name = "tf-test-my-project-1%{random_suffix}" + org_id = "%{org_id}" + billing_account = "%{billing_acct}" + labels = { + firebase = "enabled" + } +} + +resource "google_project_service" "identitytoolkit" { + project = google_project.default.project_id + service = "identitytoolkit.googleapis.com" +} + + +resource "google_identity_platform_config" "default" { + project = google_project.default.project_id +} +`, context) +}