@@ -346,12 +346,16 @@ func TestAccStorageBucket_iamPolicyGeneratedWithCondition(t *testing.T) {
346
346
func TestAccStorageBucketIamPolicy_destroy (t * testing.T ) {
347
347
t .Parallel ()
348
348
349
+ context := map [string ]interface {}{
350
+ "random_suffix" : acctest .RandString (t , 10 ),
351
+ }
352
+
349
353
acctest .VcrTest (t , resource.TestCase {
350
354
PreCheck : func () { acctest .AccTestPreCheck (t ) },
351
355
ProtoV5ProviderFactories : acctest .ProtoV5ProviderFactories (t ),
352
356
Steps : []resource.TestStep {
353
357
{
354
- Config : testAccStorageBucketIamPolicy_destroy (),
358
+ Config : testAccStorageBucketIamPolicy_destroy (context ),
355
359
},
356
360
},
357
361
})
@@ -617,14 +621,14 @@ resource "google_storage_bucket_iam_policy" "foo" {
617
621
` , context )
618
622
}
619
623
620
- func testAccStorageBucketIamPolicy_destroy () string {
621
- return fmt . Sprintf (`
624
+ func testAccStorageBucketIamPolicy_destroy (context map [ string ] interface {} ) string {
625
+ return acctest . Nprintf (`
622
626
resource "google_service_account" "accessor" {
623
627
account_id = "pub-sub-test-service-account"
624
628
}
625
629
626
630
resource "google_storage_bucket" "test_bucket" {
627
- name = "sd-pubsub- test-bucket"
631
+ name = "tf- test-my- bucket%{random_suffix} "
628
632
location = "US"
629
633
storage_class = "STANDARD"
630
634
@@ -674,5 +678,5 @@ resource "google_pubsub_topic_iam_policy" "topic_policy" {
674
678
topic = google_pubsub_topic.topic.name
675
679
policy_data = data.google_iam_policy.topic_policy_data.policy_data
676
680
}
677
- ` )
681
+ ` , context )
678
682
}
0 commit comments