Skip to content

Commit

Permalink
Iam bootstrapping generation (#12797) (#20974)
Browse files Browse the repository at this point in the history
[upstream:012f972b56efacd7fa789d77530bf9378842a5a5]

Signed-off-by: Modular Magician <magic-modules@google.com>
  • Loading branch information
modular-magician authored Jan 21, 2025
1 parent 5d859fe commit dd1da30
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .changelog/12797.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:none

```
Original file line number Diff line number Diff line change
Expand Up @@ -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),
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down Expand Up @@ -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{
Expand Down

0 comments on commit dd1da30

Please sign in to comment.