# Google Cloud Storage | DRE

> The gcs destination: credentials and paths.

You're reading the docs for DRE 0.4 (v0.4.4). [This page for 0.5](https://getdre.com/docs/plugin-gcs/) · [New in 0.5](https://getdre.com/docs/new-in-0.5/)

# Google Cloud Storage

Amazon S3 (and S3-compatible), Google Cloud Storage and Azure Blob Storage: the `gcs` destination, from the `object_store` package. Declare the package once in `dependencies.yml`; DRE installs it on demand:

dependencies.yml

```yaml
plugins:
  - object_store
```

### Profile fields

Set in `profiles.yml`, under `destinations:`, in a target with `type: gcs`.

Field

Default

Notes

`bucket`

Default bucket (or use gs://bucket/… paths)

`service_account_key_path`

Service-account key file (empty: application default credentials) A file path; `~/` is your home directory.

`service_account_key`

The service-account key’s JSON text. Secret: use `env_var()`.

`endpoint`

An emulator’s URL.

`connect_timeout`

`30s`

How long to wait for a connection (`30s`, `2m`, or seconds) A duration (`30s`, `2m`) or seconds.

`timeout`

`60s`

How long a read or write may make no progress before it fails. A duration (`30s`, `2m`) or seconds.

`retries`

`3`

How many times to try again after a temporary error (0: never)

### Options

Set in the report’s `output.destination` entry.

Option

Type

Default

Notes

`if_exists`

string

`overwrite`

When a file is already at the path: `overwrite` it, fail with `error`, or `number` the new one. One of `overwrite`, `error`, `number`.

## Notes

`bucket`, and `service_account_key_path` or `service_account_key`. Leave both out to use application default credentials: `GOOGLE_APPLICATION_CREDENTIALS`, the file `gcloud auth application-default login` writes, or the metadata server on Google Cloud. `endpoint` is for emulators. Paths are `gs://bucket/key`. Uploads use GCS’s resumable protocol. Takes `if_exists` (see [A file already at the path](https://getdre.com/docs/v0.4/plugins/#a-file-already-at-the-path)).

## Archive a workbook with application credentials

Use GCS for a report archive alongside Google Cloud data. With application default credentials already configured, add this destination to the [monthly finance example](https://github.com/get-dre/dre/blob/v0.4.4/examples/monthly-finance/):

profiles.yml

```yaml
destinations:
  archive:
    targets:
      dev: {deliver: false}
      prod: {type: gcs, bucket: finance-reports}
```

```yaml
# within the report's output
destination:
  profile: archive
  path: "gs://finance-reports/monthly/{{ run.date.yyyymm }}.xlsx"
  if_exists: number
```

`number` preserves a taken name by adding a suffix. Preview locally before choosing prod. `gcs/file-exists` with `if_exists: error` needs a new name or an intentional overwrite. `delivery-failed` with missing credentials needs the job’s Google identity configured; a local login does not carry to a different runner. Use `service_account_key_path` only when key-file credentials are required, or `service_account_key` through `env_var()` for JSON text. See [delivery behavior](https://getdre.com/docs/v0.4/plugins/#destinations), [destination keys](https://getdre.com/docs/v0.4/reference-report/#outputdestination) and [destination](https://getdre.com/docs/v0.4/glossary/#destination).

[Previous  
FTP and FTPS](https://getdre.com/docs/v0.4/plugin-ftp/)[Next  
Google Chat](https://getdre.com/docs/v0.4/plugin-google_chat/)
