Skip to content

Commit cd89c7f

Browse files
Prepared storage_upload_object snippet for inclusion on C.G.C. (#5791) (#11429)
Signed-off-by: Modular Magician <[email protected]>
1 parent a7e3bd6 commit cd89c7f

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

.changelog/5791.txt

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
```release-note:none
2+
```

google/resource_cgc_snippet_generated_test.go

+15-3
Original file line numberDiff line numberDiff line change
@@ -645,16 +645,28 @@ func TestAccCGCSnippet_storageNewBucketExample(t *testing.T) {
645645

646646
func testAccCGCSnippet_storageNewBucketExample(context map[string]interface{}) string {
647647
return Nprintf(`
648-
649-
# Create new storage bucket in the US region
648+
# Create new storage bucket in the US multi-region
650649
# with coldline storage
651650
resource "google_storage_bucket" "static" {
652651
name = "tf-test-new-bucket%{random_suffix}"
653652
location = "US"
654653
storage_class = "COLDLINE"
655654
656655
uniform_bucket_level_access = true
657-
}
656+
}
658657
658+
# Upload files
659+
# Discussion about using tf to upload a large number of objects
660+
# https://stackoverflow.com/questions/68455132/terraform-copy-multiple-files-to-bucket-at-the-same-time-bucket-creation
661+
662+
# The text object in Cloud Storage
663+
resource "google_storage_bucket_object" "default" {
664+
name = "tf-test-new-object%{random_suffix}"
665+
# Uncomment and add valid path to an object.
666+
# source = "/path/to/an/object"
667+
content = "Data as string to be uploaded"
668+
content_type = "text/plain"
669+
bucket = google_storage_bucket.static.id
670+
}
659671
`, context)
660672
}

0 commit comments

Comments
 (0)