Gets existing objects inside an existing bucket in Google Cloud Storage service (GCS). See the official documentation and API.
Example files stored within a bucket.
data "google_storage_bucket_objects" "files" {
bucket = "file-store"
}
The following arguments are supported:
bucket
- (Required) The name of the containing bucket.match_glob
- (Optional) A glob pattern used to filter results (for example, foo*bar
).prefix
- (Optional) Filter results to include only objects whose names begin with this prefix.The following attributes are exported:
bucket_objects
- A list of retrieved objects contained in the provided GCS bucket. Structure is defined below.The bucket_objects
block supports:
content_type
- Content-Type of the object data.media_link
- A url reference to download this object.name
- The name of the object.self_link
- A url reference to this object.storage_class
- The StorageClass of the bucket object.