The Simplest Way to Make BigQuery and S3 Work Like They Should
Teams use bigquery and s3 together to run analytics on cross-cloud data files. You store raw files in Amazon buckets and query them from Google Cloud. This setup lets analysts join storage buckets with cloud warehouse tables right away. Teams avoid building slow custom jobs just to copy files every single hour. Instead, the query engine reads files directly or loads them on a schedule. Good role checks keep this cross-cloud pipeline safe and easy to run. How data and roles flow between bigque
Your coding agents run with your access.
Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.
Teams use bigquery and s3 together to run analytics on cross-cloud data files. You store raw files in Amazon buckets and query them from Google Cloud.
This setup lets analysts join storage buckets with cloud warehouse tables right away. Teams avoid building slow custom jobs just to copy files every single hour. Instead, the query engine reads files directly or loads them on a schedule. Good role checks keep this cross-cloud pipeline safe and easy to run.
How data and roles flow between bigquery and s3
Cross-cloud data flows need trust between two separate cloud identity systems. Google Cloud uses service accounts, while Amazon Web Services uses IAM roles. To link them, you set up federated identity trust between both cloud accounts. You do not need to create or share static access keys at all.
In the first pattern, the query engine reads bucket files in place. You create an external table that points to the bucket path you need. A dedicated cloud role grants read access to only that single bucket path. The query engine assumes the Amazon role when a user runs a job. It reads the parquet or CSV files and returns the query results fast.
In the second pattern, a transfer service copies files into native warehouse tables. The transfer job runs on a schedule and pulls new objects from storage. Once the data lands in native tables, analysts run standard warehouse queries. Both patterns rely on strict identity links so data stays safe in transit.
Common failure modes and how to scope roles
Many teams start by pasting static cloud keys into transfer jobs or scripts. Those long-lived keys never expire on their own and often leak in logs. If an attacker finds a key, they can read every file you own. Static keys also break pipelines when someone rotates them and forgets one job.
Shared service accounts cause another big problem for data engineering teams. When ten analysts share one role, audit logs cannot show who ran what. You see the shared service account name in the log, not the person. If a query scans sensitive customer files, you cannot trace the real user.
BigQuery IAM + End-to-End Encryption: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Overly broad bucket permissions make these identity problems much worse in production. Teams often grant read access to an entire bucket instead of one folder. Soon, test jobs can read raw billing files, emails, and national IDs. You fix this by scoping each role to the exact folder prefix needed.
Setting up safe cross-cloud query habits
Start by replacing every static access key with workload identity federation right now. Map each data workflow to its own narrow role in both cloud accounts. Give read-only permissions to query jobs and write permissions only to export jobs. Never let a single role read and write across all your storage buckets.
Next, separate human analyst queries from automated pipeline jobs at the role level. Automated jobs should run under dedicated roles that humans cannot assume by hand. Human users should log in with their own identity before running any query. When results hold emails, phone numbers, or card numbers, masking rewrites matched fields in results.
Finally, check your network paths and cloud logs across both cloud providers often. Use private network routes or VPC endpoints where your cloud setup allows it. Turn on data access logs on both the bucket side and warehouse side. Good logs help your security team match every bucket read to a query.
Govern statements and responses across databases and APIs
Good config and scoped roles are needed setup. They do not check single queries in flight or mask sensitive fields in returned rows. Across Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, and internal HTTP endpoints, hoop.dev runs beside each supported service as an open-source proxy, a sidecar for your database or API.
First, hoop.dev guardrails block banned queries before they run. Then hoop.dev data masking rewrites matched sensitive values in responses in memory. The audit trail records every statement and verdict per resource. Furthermore, hoop.dev holds SOC 2 Type II and is open source on GitHub.
Frequently asked questions
Can BigQuery query S3 files without copying them first?
Yes, you can query bucket files in place by using federated external tables. The query engine reads the remote storage objects through a cross-cloud trust role.
Do I need static AWS access keys to link these tools?
No, you should use workload identity trust instead of static access keys. The Google service identity assumes an Amazon IAM role using short-lived tokens.
How do we restrict which bucket folders a query can read?
Scope the Amazon IAM role policy to specific bucket names and folder prefixes. Create separate external links for different teams so permissions stay narrow and clean.
Related guides
In this post