Skip to main content

BYOC Documentation

GCP BYOC Setup Guide

BYOC (Bring Your Own Cloud) on GCP deploys OptimaFlo's agent and Apache Iceberg storage inside your own Google Cloud project, provisioned by Terraform. Your data is stored in your infrastructure, never ours.

New to BYOC? Start with the BYOC overview to see how it works and how it compares to a fully-hosted platform.

Quick Start Overview

1
Enable APIs
Enable required GCP APIs in your project
2
Grant Permissions
Configure IAM roles for the platform service account
3
Deploy via Dashboard
Use the OptimaFlo BYOC dashboard to deploy

Step 1: Enable Required GCP APIs

The BYOC agent requires several GCP APIs to be enabled in your project. These APIs provide the foundation for Cloud Run deployment, networking, data services, and monitoring.

APIPurposeStatus
compute.googleapis.com
Compute Engine API
VPC networks, firewall rules, networkingRequired
run.googleapis.com
Cloud Run Admin API
Deploy and manage Cloud Run servicesRequired
vpcaccess.googleapis.com
Serverless VPC Access API
VPC connectors for private networkingRequired
iam.googleapis.com
IAM API
Service accounts and IAM bindingsRequired
secretmanager.googleapis.com
Secret Manager API
Store agent tokens securelyRequired
cloudresourcemanager.googleapis.com
Cloud Resource Manager API
Project-level IAM policiesRequired
storage.googleapis.com
Cloud Storage API
GCS bucket operationsRequired
bigquery.googleapis.com
BigQuery API
BigQuery dataset and table operationsRequired
composer.googleapis.com
Cloud Composer API
Managed Apache Airflow for pipeline orchestrationRequired
container.googleapis.com
Kubernetes Engine API
GKE clusters (Composer dependency)Required
sqladmin.googleapis.com
Cloud SQL Admin API
Composer metadata databaseRequired
pubsub.googleapis.com
Pub/Sub API
Composer internal messagingRequired
logging.googleapis.com
Cloud Logging API
Application loggingRequired
monitoring.googleapis.com
Cloud Monitoring API
Metrics and alertingRequired
cloudtrace.googleapis.com
Cloud Trace API
Distributed tracingRequired
iamcredentials.googleapis.com
IAM Service Account Credentials API
Service account impersonation tokensRequired
artifactregistry.googleapis.com
Artifact Registry API
Container image storageRequired
cloudbuild.googleapis.com
Cloud Build API
Infrastructure provisioning buildsRequired
servicenetworking.googleapis.com
Service Networking API
VPC peering for Cloud SQLRequired
sql-component.googleapis.com
Cloud SQL Component API
Cloud SQL internal componentsRequired
bigqueryconnection.googleapis.com
BigQuery Connection API
BigLake connections for IcebergRequired
bigquerystorage.googleapis.com
BigQuery Storage API
High-throughput BigQuery reads/writesRequired

Enable All APIs at Once In The Command Line

bash
gcloud services enable \
  compute.googleapis.com \
  run.googleapis.com \
  vpcaccess.googleapis.com \
  servicenetworking.googleapis.com \
  iam.googleapis.com \
  iamcredentials.googleapis.com \
  secretmanager.googleapis.com \
  cloudresourcemanager.googleapis.com \
  storage.googleapis.com \
  bigquery.googleapis.com \
  bigqueryconnection.googleapis.com \
  bigquerystorage.googleapis.com \
  composer.googleapis.com \
  container.googleapis.com \
  sqladmin.googleapis.com \
  sql-component.googleapis.com \
  pubsub.googleapis.com \
  artifactregistry.googleapis.com \
  cloudbuild.googleapis.com \
  dataproc.googleapis.com \
  logging.googleapis.com \
  monitoring.googleapis.com \
  cloudtrace.googleapis.com \
  --project=YOUR_PROJECT_ID

Note: APIs take 30-60 seconds to propagate after enabling. Wait before running BYOC.

Step 2: Configure IAM Permissions

The OptimaFlo platform service account needs access to browse, preview, and write processed data (Bronze/Silver/Gold layers) to your BigQuery and GCS. Permissions follow the principle of least privilege.

The platform service account in the commands below is optimaflo-sa@production-optimaflo.iam.gserviceaccount.com. This is OptimaFlo's fixed identity, not a placeholder. Use it as-is when granting roles in your project. Authentication from the platform to your project uses Workload Identity Federation under the hood, so no key files are exchanged.

IAM RolePurpose
roles/bigquery.admin
Create and manage BigQuery datasets, tables, and query jobs (Bronze/Silver/Gold layers)
roles/cloudbuild.builds.editor
Submit Cloud Build jobs during deploy and unattended teardown
roles/cloudsql.admin
Provision and manage the Cloud SQL instance backing Airflow
roles/composer.admin
Create and manage the Cloud Composer environment and run Airflow commands
roles/compute.admin
Provision the VPC, subnets, and compute resources the deployment needs
roles/container.admin
Create and manage the GKE Autopilot cluster that runs Sail queries
roles/iam.serviceAccountAdmin
Create the deployment's own service accounts
roles/iam.serviceAccountTokenCreator
Impersonate the Agent service account to mint short-lived tokens
roles/iam.serviceAccountUser
Act as a service account when submitting jobs (e.g. Cloud Build)
roles/iam.workloadIdentityPoolAdmin
Set up Workload Identity Federation for keyless authentication
roles/logging.logWriter
Write deployment and pipeline logs to Cloud Logging
roles/monitoring.admin
Configure monitoring and alerting for the deployment
roles/resourcemanager.projectIamAdmin
Grant itself the rest of this list in one pass (the one-time bootstrap grant)
roles/run.admin
Deploy and invoke the Polaris catalog and Agent API Cloud Run services
roles/secretmanager.admin
Create and rotate secrets (database credentials, API keys)
roles/secretmanager.secretAccessor
Read secrets at runtime
roles/serviceusage.serviceUsageAdmin
Enable required GCP APIs on later unattended deploys
roles/servicenetworking.networksAdmin
Set up private VPC peering for Cloud SQL
roles/storage.admin
Manage GCS buckets and their IAM policies
roles/storage.objectAdmin
Read and write your data buckets (Bronze/Silver/Gold layers)
roles/vpcaccess.admin
Create the Serverless VPC Access connector

Granting Access

OptimaFlo grants itself the roles above. You don't run a command per role. The first time you deploy to a project, the deploy stops and shows two commands, pre-filled with your project ID and org's label value: one that proves you control the project, one that lets OptimaFlo configure IAM there. Run both, then deploy again.

1. Prove you control the project:

bash
# Set your project ID and the expected label value shown in the app
export PROJECT_ID="your-project-id"
export EXPECTED_LABEL_VALUE="value-shown-in-app"

gcloud projects update $PROJECT_ID \
  --update-labels optimaflo-org=$EXPECTED_LABEL_VALUE

2. Let OptimaFlo configure IAM:

bash
export PROJECT_ID="your-project-id"
export PLATFORM_SA="optimaflo-sa@production-optimaflo.iam.gserviceaccount.com"

gcloud projects add-iam-policy-binding $PROJECT_ID \
  --member="serviceAccount:$PLATFORM_SA" \
  --role="roles/resourcemanager.projectIamAdmin"

With that role, OptimaFlo grants itself the roles listed above the first time it deploys to the project. Older deployments, from before that automatic grant existed, may still need a few of the individual commands below.

Grant Permissions via gcloud CLI

Step 3: Deploy via Dashboard

Once APIs are enabled and permissions are granted, deploy the BYOC agent using the OptimaFlo dashboard. The guided wizard walks you through the deployment process.

BYOC Agent Deployment
The BYOC dashboard provides a guided wizard to deploy your agent in minutes
Automatic infrastructure provisioning
Secure credential management
Real-time deployment progress
Health monitoring built-in
Automatic IAM configuration
No Terraform knowledge required
How It Works
  1. 1Connect GCP Project, enter your project ID and authenticate with OAuth
  2. 2Configure Agent, select region, network settings, and data sources
  3. 3Deploy, click deploy and watch real-time progress as your agent provisions
  4. 4Verify, the dashboard shows agent health and connectivity status

Common Issues

More data than people? Put an AI data team on it.

From raw data to live dashboards in one conversation.

Now in early beta. One flat plan, no per-query tax. Runs in your cloud, and your tables stay in your account.