Skip to content
Hosting Teamcity on AWS, using Terraform
HCL Shell Makefile
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
ec2
rds
s3
sg
vpc
.gitignore
README.md
main.tf
makefile
outputs.tf
terraform.tfvars.sample
variables.tf

README.md

Status: Running TeamCity connected to a public EC2 container this is bare minimum, there's no disaster recovery, auto-scaling, IP limitations etc

I am polishing my article that explains everything I have built step by step. The article is still in progress as of Dec 30th, but you need it immediate you can read it on my WIP blog.

If you want to skip the tutorial and just get TeamCity up and running:

This is a great source for aws instance price information and region availability: ec2instances

  1. I am using us-east-2 and instances that are available in that region for DB and EC2, if you are using other regions please change those instances. You may change the following:
  • region in variables.tf
  • debian_ami in variables.tf
  • instance_type in ec2/main.tf
  • instance_class in rds/main.tf
  1. DB name (db_name) is teamcity you can change it in variables.tf

  2. Pick a globally unique name for your S3, unique_s3_name in variables.tf

  3. Credentials:

  • Have your aws_access_key, aws_secret_key, and db_password them handy for when you get prompted
  • Export aws_access_key and aws_secret_key to the shell (remove them from main.tf and variables.tf) OR
  • Change terraform.tfvars.sample to terraform.tfvars Add your aws_access_key, aws_secret_key, and db_password to terraform.tfvars
  1. Make sure you have correct accesses on AWS: my blog > Getting started:

  2. The module creates a key pair name teamcity and uploads it to aws to be used for ec2 creation

  3. Notice that I am using debian image: debian_ami for the EC2

  4. We will using make later in the tutorial. You need you install brew install make --with-default-names which depends on XCode.

  • If you use windows, improvise appropriately.
  • If you don't want to use make file, copy the ssh-key command from the makefile and run it manually in your terminal
$ terraform init
$ terraform apply

Have fun!

You can’t perform that action at this time.