GCP Cloud Connector Cloud Storage Setup
Configure Google Cloud Storage, IAM, lifecycle rules, and service account access for the GCP Cloud Connector storage mode.
- Cloud Storage IAM
- Bucket lifecycle policies
- Storage mode troubleshooting
GCP proof
Use Cloud Functions and Cloud Storage for project-level speed, scale, and IAM control
The documented GCP pattern uses Cloud Functions for execution, direct or Cloud Storage modes for document handling, and Google Cloud IAM controls for a customer-managed sealing workflow.
32 MB
speed path
Direct mode handles base64 PDF requests up to about 32 MB for a simple single-request integration path.
Gen2
scale model
The connector runs as a second-generation Cloud Function and can shift large-file workflows to Cloud Storage mode.
IAM
security controls
Invoker bindings, dedicated service accounts, and bucket-scoped roles keep runtime and document access tightly scoped.
SHA-256
data boundary
Only the PDF digest is sent to Trusted Signatures while source and sealed files remain in your GCP project.
Google Cloud Storage Setup
This guide explains how to configure Google Cloud Storage for use with the GCP Cloud Connector storage mode.
Overview
The GCP Cloud Connector supports two modes:
- Direct Mode: PDF sent as base64 in request body (up to ~32MB)
- Storage Mode: PDF stored in Cloud Storage buckets (no size limit)
Storage mode is recommended for:
- Large PDF files (>32MB)
- High-volume processing
- Better security (PDFs don’t transit through HTTP requests)
- Integration with existing Cloud Storage workflows
Prerequisites
- Google Cloud Project with billing enabled
- Cloud Functions API enabled
- Cloud Storage API enabled
gcloudCLI installed and authenticated
Service Account Setup
1. Create Custom Service Account (Recommended)
Create a dedicated service account for the Cloud Function:
| |
2. Grant Required IAM Roles
The service account needs specific Cloud Storage permissions:
| |
Alternative: Bucket-level permissions (more restrictive):
| |
3. Required IAM Roles Summary
| Role | Purpose | Scope |
|---|---|---|
roles/storage.objectViewer | Download PDFs from source buckets | Project or bucket-level |
roles/storage.objectCreator | Upload sealed PDFs to destination buckets | Project or bucket-level |
Note: The function does NOT need:
storage.buckets.get(bucket metadata access)storage.objects.delete(file deletion)storage.objects.update(file modification)
Cloud Storage Bucket Setup
1. Create Buckets
| |
2. Configure Bucket Permissions
If using bucket-level permissions instead of project-level:
| |
3. Optional: Configure Lifecycle Policies
Automatically delete temporary files:
| |
Cloud Function Deployment
1. Deploy with Custom Service Account
| |
2. Verify Permissions
Test the function’s access to Cloud Storage:
| |
Security Best Practices
1. Principle of Least Privilege
- Use bucket-level permissions instead of project-level when possible
- Create separate buckets for different environments (dev/staging/prod)
- Use different service accounts for different functions
2. Network Security
| |
3. Access Control
| |
Cross-Project Access
To access buckets in different projects:
1. Grant Cross-Project Permissions
| |
2. Update Function Configuration
No code changes needed - just use the full bucket names in API calls:
| |
Monitoring and Logging
1. Enable Audit Logs
| |
2. Monitor Function Performance
| |
Troubleshooting
Common Permission Errors
403 Forbidden - Source Bucket:
| |
Solution:
| |
403 Forbidden - Destination Bucket:
| |
Solution:
| |
404 Not Found:
| |
Solution:
| |
Performance Issues
Slow Downloads/Uploads:
- Use regional buckets in same region as Cloud Function
- Consider using Cloud Storage Transfer Service for large files
- Monitor network egress costs
Memory Issues:
- Increase Cloud Function memory allocation
- Use streaming for very large files (requires code modification)
Cost Optimization
1. Storage Classes
| |
2. Lifecycle Management
| |
3. Regional Considerations
- Deploy function and buckets in same region to minimize egress costs
- Use multi-regional buckets only if global access is required
- Monitor Cloud Storage usage in billing reports
Support
For Cloud Storage specific issues:
- Documentation: https://cloud.google.com/storage/docs
- IAM Troubleshooting: https://cloud.google.com/storage/docs/troubleshooting#iam
- Support: Google Cloud Support Console
Need architectural review?
Book a technical walkthrough
For enterprise rollout, we can review trust model, controls, and integration patterns with your team.