The Simplest Way to Make Google Compute Engine and Teamcity Work Like They Should
Pairing google compute engine and teamcity lets teams run cloud build agents on demand. TeamCity starts virtual machines in Google Cloud when a build enters the queue. When the build finishes, the server stops or deletes the virtual machine right away. This setup saves money and gives every build a clean, fresh disk to use. Teams do not need to keep idle servers running all day and all night. How google compute engine and teamcity share identity and work To make google compute engine and tea
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.
Pairing google compute engine and teamcity lets teams run cloud build agents on demand. TeamCity starts virtual machines in Google Cloud when a build enters the queue.
When the build finishes, the server stops or deletes the virtual machine right away. This setup saves money and gives every build a clean, fresh disk to use. Teams do not need to keep idle servers running all day and all night.
How google compute engine and teamcity share identity and work
To make google compute engine and teamcity talk, you need a cloud service account. TeamCity uses this account to call the Google Cloud API and manage virtual machines. You should avoid downloading a static JSON key file for this service account. Instead, run the main TeamCity server on a cloud machine or use workload identity.
Next, you prepare a base machine image with the TeamCity build agent software pre-installed. When a developer pushes code, the server asks Google Cloud for a new instance. The cloud boots the instance from your base image in a few seconds. The new agent registers with the TeamCity server and pulls the source code down. It runs the tests, sends the build logs back, and shuts down when done.
The build agent also needs its own identity to push files to storage buckets. Give the agent machine a separate service account with very small, narrow cloud roles. Never let the build agent use the same account that starts and stops machines.
Common security gaps and how to scope cloud roles
Many teams make the mistake of giving TeamCity the broad Editor role in cloud projects. If an attacker compromises a build script, they can take over the whole project. Shared service accounts also make it hard to see who ran a specific task. You only see the generic service account name in the cloud audit logs.
Another common risk comes from storing long-lived cloud keys inside TeamCity project parameters. Anyone with permission to edit the build steps can print those keys into logs. To fix this, split your cloud permissions by project and by task type.
End-to-End Encryption: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Give the TeamCity server role only the rights to create, start, and delete instances. Put your build agents in a private network subnet with no public IP addresses. Use a cloud NAT router if the agents need to download public software packages. Restrict internal firewall rules so agents can only reach the main TeamCity server port.
Keeping build images clean and fast
Slow boot times will hurt your team if base images grow too large. Keep your base machine image small and only install tools that every build needs. Rebuild this base image every week to pull in the latest operating system patches. Store build caches on fast cloud storage so new agents do not download everything again.
Set a hard time limit on every build job inside your TeamCity project rules. If a test hangs, TeamCity will kill the job and delete the cloud machine. You should also set a maximum instance count on your cloud agent pool. This simple cap stops a broken loop from spinning up hundreds of cloud machines.
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
How does TeamCity talk to Google Compute Engine without static keys?
Run the TeamCity server inside Google Cloud and attach a dedicated service account to it. If TeamCity runs outside Google Cloud, use workload identity federation to trade short-lived tokens.
Should build agents have public IP addresses in Google Cloud?
No, build agents should run on private subnets without public IP addresses for safety. Use a cloud NAT service so private agents can still fetch external code packages.
How do we stop hung builds from wasting cloud budget?
Set a strict timeout on all build jobs and cap the cloud agent pool size. TeamCity will stop stuck builds and remove the idle virtual machines right away.
Related guides
In this post