Skip to content

Commit

Permalink
fix permadiff on google_identity_platform_config.authorized_domains (
Browse files Browse the repository at this point in the history
…#8740) (#15607)

Signed-off-by: Modular Magician <magic-modules@google.com>
  • Loading branch information
modular-magician authored Aug 23, 2023
1 parent 9a2b54f commit 1b78ac2
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .changelog/8740.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
identityplatform: fixed a permadiff on `authorized_domains` in `google_identity_platform_config` resource
```
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

0 comments on commit 1b78ac2

Please sign in to comment.