forked from GoogleCloudPlatform/magic-modules
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(hashicorp/terraform-provider-google#8370): Converting non-legacy …
…BQ roles to legacy ones to suppress diff
- Loading branch information
Showing
3 changed files
with
84 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -258,6 +258,29 @@ func TestAccBigQueryDataset_datasetWithContents(t *testing.T) { | |
}) | ||
} | ||
|
||
func TestAccBigQueryDataset_nonLegacyAccess(t *testing.T) { | ||
t.Parallel() | ||
|
||
datasetID := fmt.Sprintf("tf_test_access_%s", acctest.RandString(t, 10)) | ||
|
||
acctest.VcrTest(t, resource.TestCase{ | ||
PreCheck: func() { acctest.AccTestPreCheck(t) }, | ||
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t), | ||
CheckDestroy: testAccCheckBigQueryDatasetDestroyProducer(t), | ||
Steps: []resource.TestStep{ | ||
{ | ||
Config: testAccBigQueryDatasetWithNonLegacyAccess(datasetID), | ||
}, | ||
{ | ||
ResourceName: "google_bigquery_dataset.access_test", | ||
ImportState: true, | ||
ImportStateVerify: true, | ||
ImportStateVerifyIgnore: []string{"labels", "terraform_labels"}, | ||
}, | ||
}, | ||
}) | ||
} | ||
|
||
func TestAccBigQueryDataset_access(t *testing.T) { | ||
t.Parallel() | ||
|
||
|
@@ -639,6 +662,19 @@ resource "google_bigquery_dataset" "test" { | |
`, datasetID, location) | ||
} | ||
|
||
func testAccBigQueryDatasetWithNonLegacyAccess(datasetID string) string { | ||
return fmt.Sprintf(` | ||
resource "google_bigquery_dataset" "access_test" { | ||
dataset_id = "%s" | ||
access { | ||
role = "roles/bigquery.dataOwner" | ||
user_by_email = "[email protected]" | ||
} | ||
} | ||
`, datasetID) | ||
} | ||
|
||
func testAccBigQueryDatasetWithOneAccess(datasetID string) string { | ||
return fmt.Sprintf(` | ||
resource "google_bigquery_dataset" "access_test" { | ||
|