Cloud Storage Source

Cloud Storage is Google Cloud’s managed service for storing unstructured objects (files) in buckets. Toolbox connects at the project level, allowing tools to list buckets, list objects, read object metadata and content, mutate objects, and transfer objects between Cloud Storage and the server filesystem.

About

Cloud Storage is Google Cloud’s managed service for storing unstructured data (blobs) in containers called buckets. Buckets live in a GCP project; objects are addressed by gs://<bucket>/<object>.

If you are new to Cloud Storage, you can try the quickstart to create a bucket and upload your first objects.

The Cloud Storage source is configured at the project level. Individual tools take a bucket parameter, so a single configured source can operate against any bucket the underlying credentials are authorized for.

Available Tools

Cloud Storage Source Tools

Tool NameDescription
cloud-storage-list-bucketsA "cloud-storage-list-buckets" tool lists Cloud Storage buckets in a project, with optional prefix filtering and pagination.
cloud-storage-create-bucketA "cloud-storage-create-bucket" tool creates a Cloud Storage bucket in the configured source project.
cloud-storage-list-objectsA "cloud-storage-list-objects" tool lists objects in a Cloud Storage bucket, with optional prefix filtering and delimiter-based grouping.
cloud-storage-get-bucket-metadataA "cloud-storage-get-bucket-metadata" tool returns metadata for a Cloud Storage bucket.
cloud-storage-get-object-metadataA "cloud-storage-get-object-metadata" tool returns metadata for a Cloud Storage object without reading the object payload.
cloud-storage-get-bucket-iam-policyA "cloud-storage-get-bucket-iam-policy" tool returns IAM policy bindings for a Cloud Storage bucket.
cloud-storage-read-objectA "cloud-storage-read-object" tool reads the UTF-8 text content of a Cloud Storage object, optionally constrained to a byte range.
cloud-storage-delete-bucketA "cloud-storage-delete-bucket" tool deletes an empty Cloud Storage bucket.
cloud-storage-download-objectA "cloud-storage-download-object" tool downloads a Cloud Storage object to an absolute path on the Toolbox server filesystem.
cloud-storage-upload-objectA "cloud-storage-upload-object" tool uploads a local file from the Toolbox server filesystem to a Cloud Storage object.
cloud-storage-write-objectA "cloud-storage-write-object" tool writes text content directly to a Cloud Storage object.
cloud-storage-copy-objectA "cloud-storage-copy-object" tool copies a Cloud Storage object to another object, including across buckets.
cloud-storage-move-objectA "cloud-storage-move-object" tool atomically moves or renames a Cloud Storage object within the same bucket.
cloud-storage-delete-objectA "cloud-storage-delete-object" tool deletes a Cloud Storage object.

Requirements

IAM Permissions

Cloud Storage uses Identity and Access Management (IAM) to control access to buckets and objects. Toolbox uses your Application Default Credentials (ADC) to authorize and authenticate when interacting with Cloud Storage.

In addition to setting the ADC for your server, ensure the IAM identity has the appropriate role for the tools being exposed. Common roles:

  • roles/storage.bucketViewer — read-only access to bucket metadata, including listing buckets with cloud-storage-list-buckets and reading bucket metadata with cloud-storage-get-bucket-metadata.
  • roles/storage.objectViewer — read-only access to objects and object metadata, sufficient for cloud-storage-list-objects, cloud-storage-get-object-metadata, cloud-storage-read-object, and cloud-storage-download-object.
  • roles/storage.objectUser — read and write access to objects, sufficient for cloud-storage-upload-object, cloud-storage-write-object, and cloud-storage-copy-object.
  • roles/storage.admin — full control, including bucket management

Object mutation tools require the corresponding object permissions:

  • cloud-storage-upload-object, cloud-storage-write-object, and cloud-storage-copy-object require object create or update permissions on the destination object.
  • cloud-storage-move-object requires storage.objects.move and storage.objects.create in the same bucket. If the destination object already exists, storage.objects.delete is also required.
  • cloud-storage-delete-object requires object delete permission.
  • cloud-storage-create-bucket requires bucket create permission in the configured project.
  • cloud-storage-get-bucket-iam-policy requires permission to read bucket IAM policy.
  • cloud-storage-delete-bucket requires bucket delete permission, and the target bucket must be empty.

See Cloud Storage IAM roles for the full list.

Tools that read from or write to local files operate on the filesystem of the Toolbox server process, not the client machine. The server process must have the corresponding local file permissions.

Example

kind: source
name: my-gcs-source
type: "cloud-storage"
project: "my-project-id"
allowedBuckets:
  - "my-app-bucket"
  - "my-backup-bucket"
allowedLocalRoots:
  - "/workspace"

Reference

fieldtyperequireddescription
typestringtrueMust be “cloud-storage”.
projectstringtrueId of the GCP project the configured source is associated with (e.g. “my-project-id”).
allowedBuckets[]stringfalseList of GCS bucket names allowed for operations. If omitted, all buckets are allowed.
allowedLocalRoots[]stringfalseList of absolute local filesystem directories allowed for file uploads and downloads. If omitted, all paths are allowed.