Overview
Aurora integrates with Google Cloud Platform using OAuth 2.0 to securely access your GCP projects. Once connected, Aurora can manage GKE clusters, Cloud Run services, and other GCP resources across all your projects.What Aurora Can Access
Once authenticated, Aurora can discover and manage:- GKE Clusters: Kubernetes clusters in Google Kubernetes Engine
- Cloud Run Services: Serverless container deployments
- Compute Engine: VM instances and instance groups
- Cloud Storage: Buckets and objects
- Cloud Functions: Serverless functions
- BigQuery: Data warehouse and analytics
- Cloud SQL: Managed database instances
- VPC Networks: Virtual Private Cloud networking
- IAM: Service accounts and permissions
- Billing: Project billing information and usage
Prerequisites
Environment Variables
Configure these environment variables in Aurora’s.env file:
Creating OAuth Credentials
Open Google Cloud Console
Go to Google Cloud Console and select your project
Enable APIs
Navigate to APIs & Services > Library and enable:
- Google Cloud Resource Manager API
- Identity and Access Management (IAM) API
- Service Usage API
Create OAuth Client
Go to APIs & Services > Credentials and click Create Credentials > OAuth client ID
Configure OAuth Consent Screen
If prompted, configure the OAuth consent screen with your application details
Authentication Flow
Aurora uses the OAuth 2.0 authorization code flow for GCP authentication:Grant Permissions
Review and grant Aurora the requested permissions:
https://www.googleapis.com/auth/cloud-platform(Full GCP access)https://www.googleapis.com/auth/userinfo.email(Email address)openid(OpenID Connect authentication)
Token Storage
Aurora exchanges the code for access and refresh tokens, storing them securely in HashiCorp Vault
Post-Auth Setup
Aurora automatically performs setup tasks:
- Validates projects and billing status
- Enables required APIs (25 APIs across all projects)
- Creates Aurora service accounts for secure access
- Configures IAM permissions
- Updates organization policies for Cloud Run public access
- Verifies permission propagation
- Triggers infrastructure discovery
Post-Authentication Setup
After OAuth callback, Aurora runs an asynchronous Celery task (gcp_post_auth_setup_task) that:
1. Project Validation
- Fetches all accessible GCP projects
- Filters projects with active billing
- If more than 5 eligible projects, prompts for manual selection
2. API Enablement
Enables 25 required Google Cloud APIs across all selected projects:- Cloud Resource Manager API
- Compute Engine API
- Kubernetes Engine API
- Cloud Run Admin API
- Cloud Functions API
- Cloud Storage API
- Cloud SQL Admin API
- Cloud Billing API
- IAM API
- Service Usage API
- And 15+ more services
3. Service Account Creation
- Creates Aurora-managed service accounts in your root project
- Grants necessary IAM roles across all projects
- Configures service account impersonation
4. Organization Policy Updates
- Updates org policies to allow Cloud Run public access (
allUsersprincipal) - Configures domain-restricted sharing policies if needed
5. Permission Verification
- Verifies service account permissions have propagated (max 20 attempts, 30s intervals)
- Tests token generation for each project
- Reports partial or full verification status
Root Project Selection
Aurora automatically selects a “root project” for service account creation using this priority:- User Preference: Previously selected root project (stored in
user_preferencestable) - Billing + IAM: First project with both billing enabled and IAM permissions
- Fallback: First accessible project
API Endpoints
Login
OAuth Callback
Setup Status
Force Disconnect
Troubleshooting
No Projects Found
Error: “No GCP projects found during login” Solution: Ensure you have at least one GCP project in your account. Create one at Google Cloud Console.No Billing Enabled
Error: “No GCP project with active billing found” Solution: Enable billing on at least one project:- Go to Billing in Google Cloud Console
- Link a billing account to your project
- Verify billing is active
Token Refresh Failed
Error: “No refresh token available. Please re-authenticate.” Solution:- Re-authenticate through the Aurora UI
- Ensure OAuth consent screen includes
access_type=offlineandprompt=consentparameters - Check that refresh tokens are being stored in Vault
API Enablement Errors
Error: “Error enabling required APIs” Solution:- Verify you have
Service Usage Adminrole - Check project quotas and limits
- Manually enable APIs through Cloud Console if needed
- Wait a few minutes for API propagation
Permission Propagation Timeout
Warning: “Propagation verification: PARTIAL (X/Y projects)” Solution:- IAM permissions can take up to 10 minutes to propagate
- Aurora will retry automatically (20 attempts over ~10 minutes)
- If partial verification persists, check service account IAM bindings manually
- Some projects may have org policies blocking service account access
Organization Policy Conflicts
Error: “Org Policy update failed for some projects” Solution:- Check if your organization has strict domain policies
- Verify you have
Organization Policy Administratorrole if using org-level policies - Some projects may inherit conflicting policies from parent folders/organizations
- You may need to manually update
iam.allowedPolicyMemberDomainsconstraint
Service Account Errors
Error: “Aurora full-access setup had errors” Solution:- Verify you have
Service Account AdminandProject IAM Adminroles - Check project-level IAM permissions
- Ensure service accounts can be created in the root project
- Review Cloud Console audit logs for detailed error messages
Security Considerations
- Tokens: Access and refresh tokens are stored securely in HashiCorp Vault with encryption at rest
- Scopes: Aurora requests
cloud-platformscope for full GCP access - review carefully before granting - Service Accounts: Aurora creates service accounts in your projects - audit them regularly
- IAM Roles: Review the roles granted to Aurora service accounts in your IAM policies
- Org Policies: Aurora may modify organization policies for Cloud Run - review changes in your org policy logs
Token Management
- Access Tokens: Valid for ~1 hour, automatically refreshed using refresh tokens
- Refresh Tokens: Long-lived, stored securely, used to obtain new access tokens
- Token Rotation: Aurora automatically handles token refresh when access tokens expire
- Cache Invalidation: Redis cache is cleared after OAuth reconnect to ensure fresh credentials
Required OAuth Scopes
Next Steps
After connecting GCP:- Aurora will automatically discover your infrastructure
- View discovered resources in the Aurora dashboard
- Use Aurora’s AI agent to manage GCP resources
- Deploy applications to GKE clusters or Cloud Run
- Monitor costs and optimize resource usage