The Simplest Way to Make AWS Redshift and Cloud Run Work Like They Should

Published
Length
3 min read

Luis Felipe Dias

All posts

Teams pair aws redshift and cloud run to run fast apps on warehouse data. Cloud Run hosts stateless apps that query Redshift tables on demand. This setup lets teams build APIs and jobs without managing servers. You scale compute to zero when idle and query big data when needed. Making these two clouds talk takes clear login rules and safe network paths. How login and data flow between aws redshift and cloud run Your app runs in Google Cloud, while your data lives in Amazon Web Services. Firs

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 pair aws redshift and cloud run to run fast apps on warehouse data. Cloud Run hosts stateless apps that query Redshift tables on demand.

This setup lets teams build APIs and jobs without managing servers. You scale compute to zero when idle and query big data when needed. Making these two clouds talk takes clear login rules and safe network paths.

How login and data flow between aws redshift and cloud run

Your app runs in Google Cloud, while your data lives in Amazon Web Services. First, the Cloud Run service needs an identity that AWS trusts. You can use workload identity federation to link both cloud accounts.

The Google service account gets a short token from Google Cloud. The app sends this token to AWS to trade it for an IAM role. This step avoids storing static AWS keys inside your app containers.

Once the app holds an AWS role, it asks Redshift for temporary database user credentials. The app then opens a secure TLS session to the Redshift cluster. It sends SQL queries and reads the rows back over the network.

Good data flow also needs a safe network link between the two clouds. Teams often set up a site-to-site VPN or dedicated interconnect. Your Cloud Run service routes traffic through a serverless VPC connector into that private tunnel.

Common failure modes and how to scope roles

Many teams take shortcuts when they first link these two tools. A common mistake is putting long-lived database passwords into container variables. If an attacker reads those variables, they gain full database access.

Another failure mode is sharing one broad service account across many apps. When five apps use one database user, your audit logs lose value. You cannot tell which app ran a slow or bad query.

AWS CloudTrail + Redshift Security: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Teams also open Redshift to public IP ranges so Cloud Run can reach it. Since Cloud Run uses dynamic outbound IPs, opening the firewall invites outside attacks. You should route outbound traffic through a static NAT address or private VPN instead.

To fix permissions, give each Cloud Run service its own Google service account. Map each Google identity to a dedicated AWS role with tight rules. In Redshift, grant that role read or write rights only to specific schemas.

Protecting sensitive data and tracking queries in production

Even with tight roles, apps and engineers still query tables with personal data. Customer tables often hold emails, phone numbers, card numbers, and national IDs. A single bug in an app query can expose these fields in logs.

Data masking rewrites matched fields in query results before the caller reads them. This keeps raw emails and card numbers out of app memory and logs. Teams also need clear query logs tied to individual users and services.

Native cross-cloud logs split identity details between Google Cloud and AWS. One team checks Google logs for the container, while another checks Redshift query tables. Bringing query checks and field masking into one place cuts risk and saves time.

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

How does Cloud Run log in to AWS Redshift without static keys?

Use workload identity federation between Google Cloud and AWS. The Cloud Run service trades its Google token for a temporary AWS role.

How do I give Cloud Run a fixed IP for Redshift firewall rules?

Attach a VPC connector to your Cloud Run service. Route all outbound traffic through a Cloud Router and Cloud NAT with a static IP.

How can I protect card numbers and emails in Redshift query results?

Apply dynamic data masking to rewrite sensitive fields like emails, phone numbers, and card numbers. This replaces sensitive values in results before they reach the app.

The query runs. The emails stay hidden.