Gets a list of existing GCS buckets. See the official documentation and API.
Example GCS buckets.
data "google_storage_buckets" "example" {
project = "example-project"
}
The following arguments are supported:
prefix
- (Optional) Filter results to buckets whose names begin with this prefix.project
- (Optional) The ID of the project. If it is not provided, the provider project is used.The following attributes are exported:
buckets
- A list of all retrieved GCS buckets. Structure is defined below.labels
- User-provided bucket labels, in key/value pairs.location
- The location of the bucket. name
- The name of the bucket.self_link
- A url reference to the bucket.storage_class
- The StorageClass of the bucket.