The Simplest Way to Make Ec2 Instances and Teamcity Work Like They Should
In production, ec2 instances and teamcity work together to run automated software builds on cloud servers. The central build server starts virtual machines on demand, runs tests, and shuts them down afterward. This setup keeps cloud bills low while giving engineering teams fast feedback on every code change. Teams do not need to pay for idle servers at night or during slow hours. How ec2 instances and teamcity share roles and data To make this workflow run, the build server needs permission t
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.
In production, ec2 instances and teamcity work together to run automated software builds on cloud servers. The central build server starts virtual machines on demand, runs tests, and shuts them down afterward. This setup keeps cloud bills low while giving engineering teams fast feedback on every code change. Teams do not need to pay for idle servers at night or during slow hours.
How ec2 instances and teamcity share roles and data
To make this workflow run, the build server needs permission to talk to your cloud account. Teams should set up an identity role in the cloud rather than saving static keys. When the build server runs on its own cloud machine, it can assume this role. The role grants the right to launch, tag, and stop worker machines in a set subnet.
When a developer pushes new code, the build server checks its queue for open workers. If no worker is free, the server calls the cloud API to boot a machine image. This machine image holds the build agent software, system tools, and language runtimes needed for testing. Once the virtual machine boots, the agent starts up and registers with the central server.
Data flows between the two systems over private network routes inside your virtual private cloud. The central server sends build steps, version control details, and task instructions to the worker machine. As the worker runs tests and compiles code, it streams text logs back to the server. When the job ends, the worker sends build artifacts to storage and waits for another task.
Fixing common mistakes with cloud build agents
Many teams make the mistake of using a shared service account with broad cloud permissions. If an attacker steals that broad key from the build server, they can control the account. Instead, teams must scope the server role so it can only start approved machine images. You can also add a rule that forces the server to attach specific tags at launch.
Another common issue happens when worker machines keep the same broad permissions as the central server. A build script runs untrusted code from pull requests, which creates a big security risk. Give the worker machine its own narrow role that only reads needed build packages. Never let a worker machine change network rules or spin up more cloud machines.
End-to-End Encryption: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Network setup mistakes also break the link between the central server and the cloud workers. If communication goes over the public internet, teams face data transfer fees and security risks. Keep all traffic inside a private subnet and use strict security groups on both sides. The worker only needs to reach the server port and the code repo.
Keeping build images clean and costs low
Long-running worker machines often fail because old files fill up the disk over time. Leftover test containers and cached packages can also make new builds fail in strange ways. Configure your build server to terminate the virtual machine after a single build or set time. Starting from a clean machine image every time keeps builds stable and safe.
Teams should also set a hard limit on the maximum number of active worker machines. Without a cap, a loop in a build trigger can launch hundreds of cloud machines fast. Setting a clear ceiling per project stops surprise cloud bills while keeping queues moving.
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 should the build server log in to the cloud account?
Use an instance profile role attached to the build server instead of static access keys. This approach removes the need to rotate long-lived secrets by hand inside your build settings.
Should cloud build workers stay running all day?
No, you should set an idle timeout so the server stops workers when the queue empties. Stopping idle machines cuts cloud costs and ensures future builds start on fresh disks.
How do we keep one project from using all cloud workers?
Assign separate cloud profiles to each project and set a strict machine limit on each profile. This rule keeps a busy team from blocking builds for the rest of the company.
Related guides
In this post