Skip to content

Google Cloud Storage source

This event source receives change notifications from a Google Cloud Storage bucket by subscribing to a Google Cloud Pub/Sub topic.

With tmctl:

tmctl create source googlecloudstorage --bucket <bucket> --pubsub.project <project> --serviceAccountKey $(cat ./key.txt)

On Kubernetes:

kind: GoogleCloudStorageSource
  name: sample
  bucket: my-bucket

    project: my-project
    # Alternatively, provide a pre-existing Pub/Sub topic:
    # topic: projects/my-project/topics/my-topic


  objectNamePrefix: myprefix

    value: >-
        "type": "service_account",
        "project_id": "my-project",
        "private_key_id": "0000000000000000000000000000000000000000",
        "private_key": "-----BEGIN PRIVATE KEY-----\nMIIE...\n-----END PRIVATE KEY-----\n",
        "client_email": "",
        "client_id": "000000000000000000000",
        "auth_uri": "",
        "token_uri": "",
        "auth_provider_x509_cert_url": "",
        "client_x509_cert_url": ""
      kind: RedisBroker
      name: triggermesh

Produces events of the following types:


For details on these event types, refer to the official documentation for Pub/Sub notifications for Cloud Storage.

See the Kubernetes object reference for more details.


  • Event Source for Google Cloud Pub/Sub
  • Storage Bucket
  • Notification Configuration

Event Source for Google Cloud Pub/Sub

Change notifications from Cloud Storage buckets can not be consumed directly, but are instead sent to a Google Cloud Pub/Sub topic. Follow the instructions at Event Source for Google Cloud Pub/Sub for setting up a Pub/Sub topic and running an instance of the Pub/Sub event source.


As an alternative to a manual creation, the Pub/Sub topic will be created automatically while enabling the Notification Configuration if it doesn't already exist.

Storage Bucket

You can create a Cloud Storage bucket by following the instructions from the Cloud Storage How-To Guides.

Notification Configuration

Change notifications need to be enabled in the selected bucket by applying a notification configuration. Follow the instructions at Using Pub/Sub notifications for Cloud Storage to add a new notification configuration using the gsutil command-line tool.

Below is an example of command which applies a notification configuration to a bucket called eventsource-dev, with a Pub/Sub topic called triggermesh-storage-source set as event destination.

$ gsutil notification create -t triggermesh-storage-source -f json gs://eventsource-dev
Created Cloud Pub/Sub topic projects/my-project/topics/triggermesh-storage-source
Created notification config projects/_/buckets/eventsource-dev/notificationConfigs/1
$ gsutil notification list gs://eventsource-dev
        Cloud Pub/Sub topic: projects/my-project/topics/triggermesh-storage-source