Skip to content

Google Cloud Storage ​

Overview ​

Retrieves the configuration from a Google Cloud Storage bucket. This retriever is useful when you are using Google Cloud and want to use GCS to store your configuration files.

The Google Cloud Storage Retriever will use the google-cloud-storage package and google-api-options package to access your flag in Google Cloud Storage.

Configure the relay proxy ​

To configure your relay proxy to use the Google Cloud Storage retriever, you need to add the following configuration to your relay proxy configuration file:

yaml
# ...
retrievers:
  - kind: googleStorage
    bucket: 2093u4pkasjc3
    object: flags.yaml
# ...
Field nameMandatoryTypeDefaultDescription
kindYesstringnoneValue should be googleStorage.
This field is mandatory and describes which retriever you are using.
bucketYesstringnoneThis is the name of your Google Storage bucket (ex: my-featureflag-bucket).
objectYesstringnonePath to the file inside the bucket (ex: config/flag/my-flags.yaml).

NOTE

If you want to authenticate with Google Cloud, you can use the default environment variable GOOGLE_APPLICATION_CREDENTIALS to provide your credentials. We recommend using GCP native authentication methods.

Check this documentation for more info.

Configure the GO Module ​

To configure your GO module to use the Google Cloud Storage retriever, you need to add the following configuration to your ffclient.Config{} object:

go
client, err := ffclient.New(&ffclient.Config{
    PollingInterval: 3 * time.Second,
    Retriever: &gcstorageretriever.Retriever{
	    Options: []option.ClientOption{option.WithoutAuthentication()},
		Bucket: "2093u4pkasjc3",
		Object: "flags.yaml",
	}
})
defer client.Close()
FieldMandatoryDescription
BucketYesThe name of your bucket.
ObjectYesThe name of your object in your bucket.
OptionNoAn instance of option.ClientOption that configures your access to Google Cloud.
Check this documentation for more info.

Released under the MIT License.