The Simplest Way to Make AWS Secrets Manager and Google Compute Engine Work Like They Should
Teams use aws secrets manager and google compute engine to run workloads across clouds. The virtual machine trades its Google identity token for temporary Amazon role keys. This workflow lets apps on Google servers read Amazon secrets without saved keys. Engineers do not need to copy static passwords into server images or files. Instead, the server asks for fresh credentials each time it starts up. How aws secrets manager and google compute engine share trust Cross-cloud setups rely on open
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 aws secrets manager and google compute engine to run workloads across clouds. The virtual machine trades its Google identity token for temporary Amazon role keys.
This workflow lets apps on Google servers read Amazon secrets without saved keys. Engineers do not need to copy static passwords into server images or files. Instead, the server asks for fresh credentials each time it starts up.
How aws secrets manager and google compute engine share trust
Cross-cloud setups rely on open identity standards to verify who is asking. Every Google virtual machine has a built-in service account attached to it. This account can ask the local metadata server for a signed identity token.
The token proves the exact identity of the Google server to external clouds. Next, the app sends this signed token to the Amazon security token service. Amazon checks the token signature against Google public keys to verify the sender.
If the check passes, Amazon returns a set of temporary role credentials. The app on the Google server uses these temporary keys to call Amazon. It asks the secret store for the database password or API key.
The secret store checks the role rules and sends the secret back. The app keeps the secret in memory and uses it to run tasks. When the temporary keys expire, the server repeats this flow to get more.
Common failure modes in cross-cloud secret access
Many teams make mistakes when they first set up this cross-cloud link. The most common error is using a single shared Google service account. If ten servers share one account, they all get the same Amazon role.
Another big risk comes from writing broad resource rules on the Amazon side. Teams often allow a role to read every secret in the account. If one Google server gets hacked, the attacker can read all secrets.
AWS Secrets Manager + End-to-End Encryption: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Long-lived keys also cause trouble when teams skip identity federation for speed. Engineers sometimes create static Amazon user keys and paste them onto Google servers. Those static keys rarely change and often end up in code backups.
Poor logging makes these problems much harder to spot during a security review. Cloud logs show that a role read a secret at a specific time. They do not show which engineer or app task used that secret next.
Scoping roles and network paths between clouds
You can fix these gaps by locking down both sides of the link. Give each Google workload its own unique service account with minimal rights. Map each Google account to one specific Amazon role in the trust policy.
Check the subject claim in the trust rule so only one account matches. On the Amazon side, restrict the role to the exact secrets needed. Use clear tags and resource names to keep production and test secrets apart.
Keep secret values in memory and never write them to the server disk. Set up alerts on your secret store logs to watch for strange reads. Review your cross-cloud role trust rules every month to remove old server accounts.
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 a Google server log in to Amazon without static keys?
The server gets an identity token from its local Google metadata service. It trades that token with Amazon for short-lived role keys over HTTPS.
How often should apps refresh secrets from the store?
Apps should fetch secrets at startup and when a database login fails. This approach handles secret rotation without making too many network calls.
How can teams limit which Google servers read a specific secret?
Create a dedicated Google service account for each app tier. Lock the Amazon role trust policy to that single account ID.
Related guides
In this post