The Simplest Way to Make Ec2 Systems Manager and Vertex AI Work Like They Should
Teams use ec2 systems manager and vertex ai together to run cloud scripts with machine learning models. This setup lets AWS servers call Google Cloud models to check logs and fix issues. Many groups run their core apps on AWS virtual machines. They also want to use machine learning tools hosted on Google Cloud. Linking these two platforms takes clear identity rules and safe network paths. When you set this up right, your servers can send data to models and get answers fast. How ec2 systems ma
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 ec2 systems manager and vertex ai together to run cloud scripts with machine learning models. This setup lets AWS servers call Google Cloud models to check logs and fix issues.
Many groups run their core apps on AWS virtual machines. They also want to use machine learning tools hosted on Google Cloud. Linking these two platforms takes clear identity rules and safe network paths. When you set this up right, your servers can send data to models and get answers fast.
How ec2 systems manager and vertex ai share identity and data
To make ec2 systems manager and vertex ai work together, you must link AWS and Google identities. An AWS server uses an instance profile to prove who it is. Google Cloud uses workload identity federation to trust that AWS role. This setup removes the need to store static Google keys on your AWS servers.
First, an engineer or scheduled job starts a task in EC2 Systems Manager. The tool runs a script on the target AWS machine. That script asks AWS for a temporary token tied to the machine role. Next, the script sends that token to Google Cloud to trade it for a short-lived Google token.
With that Google token, the script sends a prompt or log file to the Vertex AI endpoint. The model reads the input and sends back a structured answer. The AWS machine then uses that answer to finish its local task, such as updating a file or restarting a service.
Common failure modes across cloud boundaries
The biggest mistake teams make is putting static service account keys on AWS machines. If someone steals a static key, they can call your models from anywhere. Static keys also break scripts when they expire and someone forgets to rotate them.
Overbroad roles cause another major risk. Sometimes teams give one shared role to every AWS server in an account. If a test machine has the same role as a production machine, it can reach production models and datasets. You should create one AWS role and one Google role for each specific workload.
GCP Access Context Manager + AI Agent Security: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Unlogged prompts and model outputs also create blind spots for security teams. When an automated script sends server logs to a model, those logs might hold private data. For example, logs often contain emails, phone numbers, card numbers, or national IDs. Data masking rewrites matched fields in results before they leave your control.
How to scope roles and network paths
Start by scoping every role down to the single resource it needs. Your AWS role should only allow the specific EC2 Systems Manager actions required for the job. Your Google role should only allow calls to one specific model endpoint, not the whole project.
You should also lock down the network path between the two clouds. Use private network links or strict outbound firewall rules on your AWS subnets. Only allow your servers to talk to the exact Google domains needed for token exchange and model calls.
Finally, turn on audit logs in both clouds before you run production jobs. AWS will record who started the command and which server ran it. Google Cloud will record which federated identity called the model and when the call happened. Matching timestamps across both logs helps you trace every action from start to finish.
Check database and API queries on the wire
Identity tools, roles, and network rules decide who opens a session. Setup alone cannot check what each query does or mask sensitive values in a response once a session starts. When workflows touch Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, or internal HTTP APIs, hoop.dev runs beside those services as an open-source proxy, a sidecar for your Postgres or API. It inspects requests coming in and results going back on the wire.
Your login details and client tools stay as they are while hoop.dev guardrails refuse bad deletes or drops before they run. On responses, hoop.dev data masking rewrites matched sensitive values in memory. Furthermore, hoop.dev holds SOC 2 Type II, is MIT licensed, and writes every query and decision to an audit trail that generates evidence for HIPAA, GDPR, and PCI DSS. See the source on GitHub.
Frequently asked questions
Do I need to store Google service account keys on my EC2 instances?
No, you should never store static keys on your servers. Use workload identity federation so your AWS instance role can request short-lived tokens from Google Cloud on demand.
How do I stop server logs from sending private data to a model?
Check and clean your log data before the script sends the request. Data masking rewrites matched fields in results, such as emails, phone numbers, card numbers, and national IDs.
How can I track which engineer triggered a model call from AWS?
Check your AWS audit logs to see which user started the EC2 Systems Manager task. Then match that task time and instance role to the Google Cloud model call logs.
Related guides
In this post