GCP Cloud Connector Deployment Guide
Deploy the Trusted Signatures Cloud Function on Google Cloud Platform with console, gcloud, Terraform, or Deployment Manager workflows.
- Cloud Function deployment
- Service account IAM
- Cloud Storage mode support
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.
Deployment Guide
This guide covers multiple ways to deploy the GCP Cloud Connector to Google Cloud Platform.
Prerequisites
- Google Cloud Project with billing enabled
- Cloud Functions API enabled
- Cloud Storage API enabled (for Storage Mode)
- Built
gcf-package.zipfile (runnpm run build)
Service Account Setup (Recommended)
For Storage Mode support, create a custom service account:
| |
Note: See Cloud Storage setup for detailed Cloud Storage configuration.
GCP Console Deployment
Step 1: Enable Cloud Functions API
- Go to GCP Console
- Navigate to APIs & Services → Library
- Search for “Cloud Functions API”
- Click Enable
Step 2: Create Cloud Function
- Go to Cloud Functions in GCP Console
- Click Create Function
- Configure:
- Function name:
pdf-sealer-gateway - Region: Choose your region
- Trigger type: HTTP
- Authentication: Allow unauthenticated invocations (or configure as needed)
- Function name:
- Click Save then Next
Step 3: Upload Code
- In the Code section:
- Runtime: Node.js 22
- Entry point:
pdfSealer - Source code: ZIP upload
- Click Browse and select
gcf-package.zip - Click Upload
Step 4: Configure Function
- Expand Runtime, build, connections and security settings
- Set:
- Memory allocated: 512 MB (increase for large PDFs in Direct Mode)
- Timeout: 60 seconds (increase for large files)
- Maximum instances: Set as needed
- Service account: Use custom service account for Storage Mode
- Click Deploy
Step 5: Test
Wait for deployment to complete, then:
| |
gcloud CLI Deployment
Prerequisites
Install and configure gcloud CLI:
| |
Deploy Function
| |
Update Existing Function
| |
Terraform Deployment
Create main.tf:
| |
Deploy:
| |
Deployment Manager
Create function.yaml:
| |
Deploy:
| |
Authentication Options
Public Access (No Auth)
| |
Authenticated Access
| |
Invoke with Authentication
| |
Monitoring
Cloud Logging
View function logs:
| |
Or in GCP Console:
- Go to Cloud Functions
- Click on your function
- Go to Logs tab
Cloud Monitoring
View metrics:
- Go to Cloud Monitoring
- Navigate to Metrics Explorer
- Select resource type: Cloud Function
- Select your function
Key metrics:
- Execution count
- Execution times
- Memory usage
- Error rate
VPC Configuration (Optional)
Connect function to VPC:
| |
Testing Deployment
Test Health Endpoint
| |
Test Direct Mode
| |
Test Storage Mode
| |
Troubleshooting
Deployment Fails
- Check Cloud Functions API is enabled
- Verify IAM permissions
- Check function logs for errors
- Ensure
gcf-package.zipis properly built
Function Timeout
- Increase timeout setting (max 540 seconds for 2nd gen)
- Check network connectivity to Trusted Signatures API
- For large PDFs, consider using Storage Mode
Memory Issues
- Increase memory allocation (especially for Direct Mode)
- Monitor memory usage in Cloud Monitoring
- Use Storage Mode for large PDFs to reduce memory usage
403 Forbidden
- Check IAM permissions
- Verify authentication configuration
- Ensure invoker role is granted
- For Storage Mode: verify service account has Cloud Storage permissions
Storage Mode Issues
- Verify service account has
storage.objectViewerandstorage.objectCreatorroles - Check bucket names and file paths are correct
- Ensure buckets exist and are accessible
- Verify function is deployed with correct service account
400 Bad Request
- Check request format (cannot specify both modes)
- Verify all required fields are present
- For Direct Mode: check PDF size limit (~32MB)
- Validate API key format (hex-encoded)
Cost Optimization
Minimize Cold Starts
- Set minimum instances (costs more but reduces latency)
- Use 2nd gen functions (faster cold starts)
Right-size Resources
- Direct Mode: Start with 512 MB, increase for large PDFs (PDF size × 4)
- Storage Mode: 512 MB sufficient for most use cases
- Monitor actual usage and adjust
- Set appropriate timeout (don’t use max if not needed)
Control Scaling
- Set maximum instances to control costs
- Use concurrency settings appropriately
Security Best Practices
Network Security
- Use VPC connector for private network access
- Configure firewall rules appropriately
- Use Private Google Access if needed
IAM Security
- Use least privilege principle
- Avoid public access if not needed
- Use service accounts for authentication
- Regularly audit IAM policies
Function Security
- Keep runtime updated
- Monitor for vulnerabilities
- Use Secret Manager for Trusted Signatures API keys (recommended)
- Enable Cloud Armor for DDoS protection
- Use custom service accounts with minimal permissions
- For Storage Mode: restrict bucket access to specific service accounts
Need architectural review?
Book a technical walkthrough
For enterprise rollout, we can review trust model, controls, and integration patterns with your team.