Skip to main content

Google Cloud Storage connections

The google-gcs connection type represents a Google Cloud Storage host. It has multiton cardinality and uses the host lookup strategy.

Configure Google Cloud Storage​

app-config.yaml
connections:
- type: google-gcs
host: storage.googleapis.com
auth:
- method: serviceAccount
clientEmail: ${GCS_CLIENT_EMAIL}
privateKey: ${GCS_PRIVATE_KEY}

Connection fields​

FieldTypeRequiredDescription
hoststringYesStorage host matched against the consumer's resource URL.

Authentication methods​

MethodFieldTypeRequiredDescription
noneNone——Does not accept authentication fields.
serviceAccountclientEmailstringYesGoogle service-account client email.
serviceAccountprivateKeystringYesGoogle service-account private key.

The service returns static service-account configuration. A Google Cloud credential provider is responsible for constructing or refreshing usable credentials.

Use none explicitly for publicly readable objects.

Lookup and selection​

The consumer supplies a lookup query containing a Google Cloud Storage URL. The service selects the connection whose host matches the parsed URL host exactly.

When more than one authentication entry is visible to the calling plugin, the first visible entry is selected. Use plugin scoping to supply different credentials to a specific plugin; otherwise, configuration order determines which entry is selected.

Consume a Google Cloud Storage connection​

const connection = await connections.find({
type: 'google-gcs',
query: { url: 'https://storage.googleapis.com/acme/catalog-info.yaml' },
authMethods: ['serviceAccount', 'none'],
});

if (connection.auth.method === 'serviceAccount') {
connection.auth.clientEmail; // string
connection.auth.privateKey; // string
}

Return to the built-in connection type index.