From 21faefccc688d29399f6494219a2f7c2a5219881 Mon Sep 17 00:00:00 2001 From: The Magician Date: Tue, 21 Jan 2025 10:26:41 -0800 Subject: [PATCH] Iam bootstrapping generation (#12797) (#9098) [upstream:012f972b56efacd7fa789d77530bf9378842a5a5] Signed-off-by: Modular Magician --- .changelog/12797.txt | 3 +++ ...e_healthcare_dicom_store_generated_test.go | 11 +++++++- ...ce_healthcare_fhir_store_generated_test.go | 11 +++++++- ...urce_pubsub_subscription_generated_test.go | 26 ++++++++++++++++--- 4 files changed, 45 insertions(+), 6 deletions(-) create mode 100644 .changelog/12797.txt diff --git a/.changelog/12797.txt b/.changelog/12797.txt new file mode 100644 index 0000000000..42b910df15 --- /dev/null +++ b/.changelog/12797.txt @@ -0,0 +1,3 @@ +```release-note:none + +``` \ No newline at end of file diff --git a/google-beta/services/healthcare/resource_healthcare_dicom_store_generated_test.go b/google-beta/services/healthcare/resource_healthcare_dicom_store_generated_test.go index 1a0aa0dce2..dbf1caf14a 100644 --- a/google-beta/services/healthcare/resource_healthcare_dicom_store_generated_test.go +++ b/google-beta/services/healthcare/resource_healthcare_dicom_store_generated_test.go @@ -83,9 +83,18 @@ resource "google_healthcare_dataset" "dataset" { func TestAccHealthcareDicomStore_healthcareDicomStoreBqStreamExample(t *testing.T) { t.Parallel() + acctest.BootstrapIamMembers(t, []acctest.IamMember{ + { + Member: "serviceAccount:service-{project_number}@gcp-sa-healthcare.iam.gserviceaccount.com", + Role: "roles/bigquery.dataEditor", + }, + { + Member: "serviceAccount:service-{project_number}@gcp-sa-healthcare.iam.gserviceaccount.com", + Role: "roles/bigquery.jobUser", + }, + }) context := map[string]interface{}{ - "policyChanged": acctest.BootstrapPSARoles(t, "service-", "gcp-sa-healthcare", []string{"roles/bigquery.dataEditor", "roles/bigquery.jobUser"}), "random_suffix": acctest.RandString(t, 10), } diff --git a/google-beta/services/healthcare/resource_healthcare_fhir_store_generated_test.go b/google-beta/services/healthcare/resource_healthcare_fhir_store_generated_test.go index f9c79d1095..09cf9d7d0b 100644 --- a/google-beta/services/healthcare/resource_healthcare_fhir_store_generated_test.go +++ b/google-beta/services/healthcare/resource_healthcare_fhir_store_generated_test.go @@ -91,9 +91,18 @@ resource "google_healthcare_dataset" "dataset" { func TestAccHealthcareFhirStore_healthcareFhirStoreStreamingConfigExample(t *testing.T) { t.Parallel() + acctest.BootstrapIamMembers(t, []acctest.IamMember{ + { + Member: "serviceAccount:service-{project_number}@gcp-sa-healthcare.iam.gserviceaccount.com", + Role: "roles/bigquery.dataEditor", + }, + { + Member: "serviceAccount:service-{project_number}@gcp-sa-healthcare.iam.gserviceaccount.com", + Role: "roles/bigquery.jobUser", + }, + }) context := map[string]interface{}{ - "policyChanged": acctest.BootstrapPSARoles(t, "service-", "gcp-sa-healthcare", []string{"roles/bigquery.dataEditor", "roles/bigquery.jobUser"}), "random_suffix": acctest.RandString(t, 10), } diff --git a/google-beta/services/pubsub/resource_pubsub_subscription_generated_test.go b/google-beta/services/pubsub/resource_pubsub_subscription_generated_test.go index 7a11a43bd5..6ec2dbf04a 100644 --- a/google-beta/services/pubsub/resource_pubsub_subscription_generated_test.go +++ b/google-beta/services/pubsub/resource_pubsub_subscription_generated_test.go @@ -237,10 +237,19 @@ resource "google_pubsub_subscription" "example" { func TestAccPubsubSubscription_pubsubSubscriptionPushBqExample(t *testing.T) { t.Parallel() + acctest.BootstrapIamMembers(t, []acctest.IamMember{ + { + Member: "serviceAccount:service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com", + Role: "roles/bigquery.dataEditor", + }, + { + Member: "serviceAccount:service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com", + Role: "roles/bigquery.metadataViewer", + }, + }) context := map[string]interface{}{ - "policy_changed": acctest.BootstrapPSARoles(t, "service-", "gcp-sa-pubsub", []string{"roles/bigquery.dataEditor", "roles/bigquery.metadataViewer"}), - "random_suffix": acctest.RandString(t, 10), + "random_suffix": acctest.RandString(t, 10), } acctest.VcrTest(t, resource.TestCase{ @@ -304,10 +313,19 @@ EOF func TestAccPubsubSubscription_pubsubSubscriptionPushBqTableSchemaExample(t *testing.T) { t.Parallel() + acctest.BootstrapIamMembers(t, []acctest.IamMember{ + { + Member: "serviceAccount:service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com", + Role: "roles/bigquery.dataEditor", + }, + { + Member: "serviceAccount:service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com", + Role: "roles/bigquery.metadataViewer", + }, + }) context := map[string]interface{}{ - "policy_changed": acctest.BootstrapPSARoles(t, "service-", "gcp-sa-pubsub", []string{"roles/bigquery.dataEditor", "roles/bigquery.metadataViewer"}), - "random_suffix": acctest.RandString(t, 10), + "random_suffix": acctest.RandString(t, 10), } acctest.VcrTest(t, resource.TestCase{