---
title: Google Cloud Storage
icon: google
description: Set up the GCS resource in Python.
---

## Dependencies

```bash
uv sync --extra s3
```

GCS uses the same `aiobotocore` dependency as S3 (GCS exposes an
S3-compatible XML API via HMAC keys).

For credential setup, see the [GCS Setup](/home/setup/gcs) guide.

## Configuration

```python
import os
from mirage import Workspace, MountMode
from mirage.resource.gcs import GCSConfig, GCSResource

config = GCSConfig(
    bucket=os.environ["GCS_BUCKET"],
    access_key_id=os.environ["GCS_ACCESS_KEY_ID"],
    secret_access_key=os.environ["GCS_SECRET_ACCESS_KEY"],
)
resource = GCSResource(config)
ws = Workspace({"/gcs/": resource}, mode=MountMode.READ)
```

## Config Reference

| Field               | Required | Default                          | Description                          |
| ------------------- | -------- | -------------------------------- | ------------------------------------ |
| `bucket`            | Yes      |                                  | GCS bucket name                      |
| `access_key_id`     | Yes      |                                  | HMAC access key                      |
| `secret_access_key` | Yes      |                                  | HMAC secret key                      |
| `endpoint_url`      | No       | `https://storage.googleapis.com` | Custom endpoint (override if needed) |
| `region`            | No       | `auto`                           | Region                               |
| `timeout`           | No       | `30`                             | Request timeout in seconds           |
| `proxy`             | No       | `None`                           | HTTP proxy URL                       |
