Google Cloud Storage
Configure Google Cloud Storage for backup storage.
Store backups in Google Cloud Storage for reliable, integrated cloud storage.
Prerequisites
- Google Cloud account
- GCS bucket created
- Service account with access
Create Service Account
- Go to Google Cloud Console
- Select your project
- Navigate to IAM & Admin > Service Accounts
- Click Create Service Account
- Name:
supascale-backups - Grant role: Storage Object Admin
- Create and download JSON key
Required Permissions
The service account needs:
storage.objects.createstorage.objects.getstorage.objects.deletestorage.objects.liststorage.buckets.get
Or use the predefined role: Storage Object Admin
Create GCS Bucket
- Go to Cloud Storage
- Click Create bucket
- Name:
your-company-supascale-backups - Location: Choose region or multi-region
- Storage class: Standard (or based on needs)
- Access control: Uniform
Recommended Settings
- Location: Regional (cheapest) or Multi-regional (highest availability)
- Storage class: Standard for frequent access
- Versioning: Enabled
- Encryption: Google-managed or customer-managed keys
Configure in Supascale
Via Web UI
- Navigate to Cloud Storage
- Click Add Provider
- Select Google Cloud Storage
- Enter:
- Name: "Production GCS"
- Bucket name
- Paste service account JSON key
- Click Test Connection
- Click Save
Via API
curl -X POST https://supascale.example.com/api/v1/cloud-storage \
-H "X-API-Key: your-api-key" \
-H "Content-Type: application/json" \
-d '{
"name": "Production GCS",
"type": "gcs",
"isDefault": false,
"gcsConfig": {
"bucket": "your-bucket-name",
"credentials": {
"type": "service_account",
"project_id": "your-project-id",
"private_key_id": "key-id",
"private_key": "-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----\n",
"client_email": "[email protected]",
"client_id": "123456789",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://oauth2.googleapis.com/token"
}
}
}'
Configuration Options
| Option | Required | Description |
|---|---|---|
bucket | Yes | GCS bucket name |
credentials | Yes | Service account JSON key |
projectId | No | Override project ID |
GCS Locations
Regional
Single region, lowest cost:
us-central1- Iowaus-east1- South Carolinaeurope-west1- Belgiumasia-east1- Taiwan
Multi-Regional
Higher availability, higher cost:
us- United Stateseu- European Unionasia- Asia Pacific
Storage Classes
| Class | Use Case | Availability | Cost |
|---|---|---|---|
| Standard | Frequent access | 99.99% | $$$ |
| Nearline | Monthly access | 99.9% | $$ |
| Coldline | Quarterly access | 99.9% | $ |
| Archive | Yearly access | 99.9% | ¢ |
Lifecycle Management
Configure automatic transitions in GCS:
- Go to bucket Lifecycle
- Add rule:
- Action: Set storage class to Nearline
- Condition: Age > 30 days
Example rules:
{
"lifecycle": {
"rule": [
{
"action": {"type": "SetStorageClass", "storageClass": "NEARLINE"},
"condition": {"age": 30}
},
{
"action": {"type": "SetStorageClass", "storageClass": "COLDLINE"},
"condition": {"age": 90}
},
{
"action": {"type": "Delete"},
"condition": {"age": 365}
}
]
}
}
Test Connection
curl -X POST https://supascale.example.com/api/v1/cloud-storage/provider-id/test \ -H "X-API-Key: your-api-key"
Security
IAM Best Practices
- Use dedicated service account
- Grant minimum required permissions
- Rotate service account keys periodically
- Enable audit logging
Encryption
GCS encrypts all data at rest by default. For additional control:
- Google-managed: Default, no configuration
- Customer-managed (CMEK): Use Cloud KMS
- Customer-supplied (CSEK): You manage keys
Access Control
- Use IAM for access control (recommended)
- Enable uniform bucket-level access
- Avoid legacy ACLs
Troubleshooting
"Permission denied"
- Verify service account has correct role
- Check bucket permissions
- Verify service account email is correct
- Re-download credentials JSON
"Bucket not found"
- Verify bucket name spelling
- Check bucket exists in the project
- Verify service account has bucket access
"Invalid credentials"
- Re-download service account JSON
- Verify JSON is complete and valid
- Check service account isn't disabled
- Verify project ID matches