Skip to main content

GETTING STARTED WITH GOOGLE CLOUD STORAGE BUCKETS

In this tutorial, we will set up a Swamp repository to work with Google Cloud Storage. We pull the @swamp/gcp/storage extension into the repository, then check that Google Cloud credentials are in place for its behaviors.

What we will build

We start from an empty Swamp repository and pull the extension that provides the Cloud Storage behavior types. When we finish, the repository has the @swamp/gcp/storage/buckets type for buckets, along with the types for objects, folders, access controls and the other Cloud Storage resources. Any of these types can then be passed to swamp behavior create.

Prerequisites

Pull the extension

First, we pull the Cloud Storage extension from the registry into our repository:

swamp extension pull @swamp/gcp/storage

You will see output like:

INF extension·pull: Pulling "@swamp/gcp/storage"@"2026.10.13.1"
INF extension·pull: Identity verified: "@swamp/gcp/storage"@"2026.10.13.1"
INF extension·pull: Pulled "@swamp/gcp/storage"@"2026.10.13.1"
INF extension·pull: Extracted 28 files:

Notice the extension name, @swamp/gcp/storage. It is the start of every behavior type the extension provides: buckets use @swamp/gcp/storage/buckets, objects use @swamp/gcp/storage/objects and folders use @swamp/gcp/storage/folders.

Check the credentials

Behaviors from this extension connect to Google Cloud with credentials from our environment. They read Application Default Credentials, which gcloud auth application-default login creates, or the GOOGLE_APPLICATION_CREDENTIALS_JSON and GCP_ACCESS_TOKEN environment variables. We make sure one of these is set up for the Google Cloud project we plan to use.

A behavior can also read its credentials from a vault. Its accessToken or credentialsJson global argument takes a vault.get() expression, the same way the API token was referenced in Storing Secrets.

What we built

We pulled the @swamp/gcp/storage extension into a Swamp repository and checked that Google Cloud credentials are available to its behaviors. The repository now has @swamp/gcp/storage/buckets and the other Cloud Storage behavior types ready for swamp behavior create.