The Simplest Way to Make Dataflow and S3 Work Like They Should

Published
Length
3 min read

Luis Felipe Dias

All posts

You link Dataflow and S3 by giving Google Cloud workers temporary AWS permissions. This setup lets streaming jobs read and write cross-cloud files at scale. Teams often store raw logs in AWS buckets while running analytics on Google Cloud. Moving data between these two clouds requires safe identity rules and stable network paths. When you set up both tools well, jobs run fast without leaking secret keys. How Dataflow and S3 share identity and data Dataflow runs Apache Beam jobs on managed wo

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.

You link Dataflow and S3 by giving Google Cloud workers temporary AWS permissions. This setup lets streaming jobs read and write cross-cloud files at scale.

Teams often store raw logs in AWS buckets while running analytics on Google Cloud. Moving data between these two clouds requires safe identity rules and stable network paths. When you set up both tools well, jobs run fast without leaking secret keys.

How Dataflow and S3 share identity and data

Dataflow runs Apache Beam jobs on managed worker machines inside Google Cloud. S3 stores objects in AWS buckets behind strict account rules. To make them talk, the worker machines need valid AWS permissions.

The best approach uses workload identity federation between the two cloud providers. First, each Dataflow worker gets a Google service account identity at launch. Next, the worker trades that Google token for a temporary AWS role token. Then, the Apache Beam file system module uses that token to read or write buckets.

This flow skips static keys and keeps every request tied to one specific job. Data moves straight from the storage bucket to the worker memory over encrypted links. When the job ends, the temporary permissions expire on their own.

Common failure modes in cross-cloud pipelines

Many teams start by pasting static AWS keys into job launch templates. That shortcut creates a major risk because static keys never expire on their own. Anyone who reads the job logs or template files can steal those keys. Shared service accounts also make it hard to track which job changed a bucket.

Broad bucket permissions cause another common problem in production setups. If a worker role can read every bucket, one bad job can expose sensitive files. You should scope each AWS role to one bucket and one folder path. Grant read rules only to input buckets and write rules only to output buckets.

End-to-End Encryption: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Unlogged requests and bad network routes also break cross-cloud data jobs. If traffic goes over the public internet without limits, costs rise and speeds drop. Turn on bucket access logs in AWS and worker logs in Google Cloud. Use private cloud interconnects or virtual network peering to keep data on safe paths.

How to scope roles and protect sensitive fields

Start by creating one dedicated Google service account for each pipeline. Map that account to one narrow AWS role using open identity standards. Check that the AWS role trust policy only accepts tokens from that single Google account. Remove all broad admin roles from your default compute accounts right away.

Next, protect the actual contents of the files moving through the pipeline. Raw files in storage buckets often hold sensitive customer details from production apps. Before your job writes records to a target bucket, apply data masking rules. Masking rewrites matched fields like emails, phone numbers, card numbers, and national IDs in results.

Finally, review your cross-cloud audit logs on a weekly schedule. Match every bucket read event in AWS with a specific job run in Google Cloud. Set up alerts for failed role checks or sudden spikes in outbound network traffic. Clear role boundaries and clean logs keep cross-cloud pipelines fast and safe.

Add runtime guardrails and masking beside your databases and APIs

Login rules, role grants, and CI checks govern who connects to your stack. Yet any allowed script, engineer, or AI agent still runs commands with the full scope of its role. For workloads on Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes, SSH, or internal HTTP services, hoop.dev sits beside the service as an open-source proxy, a sidecar for your database or API.

Before a query runs, hoop.dev guardrails check the statement against your rules. An AI Analyzer you configure can score intent or hold risky calls for human review. Next, hoop.dev data masking rewrites sensitive fields in responses, and each verdict is logged per listener. Explore the MIT-licensed project on GitHub.

Frequently asked questions

How does Dataflow log in to S3 without static keys?

Workers use Google service account tokens to claim temporary AWS roles through identity federation. The AWS token service checks the Google token and returns short-lived permissions for the job.

How can teams lower cross-cloud network transfer costs?

Filter and compress data inside the storage region before sending it across clouds. You can also set up dedicated cloud interconnects to get lower data transfer rates.

What is the safest way to handle sensitive data in buckets?

Encrypt all bucket objects at rest and restrict role permissions to specific folder paths. Apply data masking to rewrite emails, phone numbers, and card numbers during the pipeline run.

The query runs. The emails stay hidden.