|You are viewing documentation of TeamCity 7.x, which is not the most recently released version of TeamCity. Please refer to the listing to choose another version.|
TeamCity Amazon EC2 integration allows to configure TeamCity with your Amazon account and then start and stop images with TeamCity agents on-demand based on the queued builds.
Once a cloud profile is configured in TeamCity with one or several images, TeamCity does a test start for all the new images to learn about the agents configured on them.
For each queued build, TeamCity first tries to start it on one of the regular, non-cloud agents. If there are no usual agents available, TeamCity finds a matching cloud image with a compatible agent and starts a new instance for the image. TeamCity ensures that cloud profile number of running instances limit is not exceeded.
Once an agent is connected from a cloud instance started by TeamCity, it is automatically authorized (provided there are available agent licenses). After that the agent is processed as a regular agent.
Understanding Amazon EC2 and ability to perform EC2 tasks is a prerequisite for configuring and using TeamCity Amazon EC2 integration.
Basic TeamCity EC2 setup involves:
Please ensure that the server URL specified on Global Settings page in Administration area is correct since agents will use it to connect to the server.
If you need TeamCity to use proxy to access EC2 services, please read on a current workaround in the dedicated issue.
Preparing AMI with Installed TeamCity Agent
Here are the requirements for an image that can be used for TeamCity cloud integration:
Provided these requirements are met, usual TeamCity agent installation and Amazon AMI bundling procedures are applicable.
If you need the connection between the server and the agent machine to be secure, you will need to setup the agent machine to establish a secure tunnel (e.g. VPN) to the server on boot so that TeamCity agent receives data via the secure channel.
Recommended AMI preparation steps:
Agent auto-upgrade Note
Estimating EC2 Costs
Usual Amazon EC2 pricing applies. Please note that Amazon charges can depend on the specific configuration implemented to deploy TeamCity. We advice you to check your configuration and Amazon account data regularly in order to discover and prevent unexpected charges as early as possible.
Please note that traffic volumes and necessary server and agent machines characteristics depend a big deal on the TeamCity setup and nature of the builds run. See also How To...#Estimate hardware requirements for TeamCity.
Here are some points to help you estimate TeamCity-related traffic:
External connections originated by server:
Internal connections originated by server:
External connections originated by agent:
Internal connections originated by agent:
Usual connections served by the server:
As Amazon rounds machine uptime to the nearest full hour, please adjust timeout setting on the EC2 image setting on TeamCity cloud integration settings according to your usual builds length.
It is also highly recommended to set execution timeout for all your builds so that a build hanging does not cause prolonged instance running with no payload.