1. cdk version #echo cdk command line version
  2. cdk init TEMPLATE — language LANGUAGE #create a new cdk stack
  3. cdk bootstrap #bootstrap the aws environment
  4. cdk list #list the stacks in cdk app
  5. cdk deploy #deploy a stack
  6. cdk destroy #delete the satck
  7. cdk doc #launch the cdk documents
  8. cdk diff…

--

--

main.tf

resource "aws_dynamodb_table" "nonproductive" {name           ="${var.deployment_name}_nonprod"billing_mode   = "PAY_PER_REQUEST"read_capacity  = "${var.read_capacity}"write_capacity = "${var.write_capacity}"hash_key       = "metadataId"range_key      = "source"point_in_time_recovery = "${var.db_point_in_time_recovery}"stream_enabled = "${var.stream_enabled}"stream_view_type = "${var.stream_view_type}"attribute {name = "metadataId"type = "S"}attribute {name = "source"type = "S"}lifecycle {ignore_changes = ["read_capacity", "write_capacity"]  //capacities are ignored for autoscaling}tags = {domain        ="${var.domain}"cluster       ="${var.deployment_name}"}}

var.tf

variable "deployment_name" {description="The name of the current deployment"}variable "db_point_in_time_recovery" {description="Point of recovery preserves the data for 35days and can be recovery at any point of time during the cycle"default = "true"}variable "stream_enabled" {default = true}variable "stream_view_type" {default = "NEW_IMAGE"}variable "domain"{ 
description = "specify the domain name "
}

--

--

List of AWS Resources Required for Teamcity Stack:

  1. AWS VPC (Internet Gateway + NAT Gateway + 3 Type of Subnets)
  2. Application Load balancer + SSL Certificate(Public Subnet)
  3. ECS Cluster + Task Definition (Private Subnet)
  4. External AWS RDS MySQL (Database Subnet)
  5. S3 bucket as external artifact storage.

The above is ready to use the AWS CloudFormation stack.

Teamcity server Docker Image

  1. Pull the Teamcity Server docker image from the Docker Hub Repository docker pull jetbrains/teamcity-server
  2. Run-on Linux Container
    docker run -it --name teamcity-server-instance \
    -v /opt/teamcity/datadir:/data/teamcity_server/datadir \
    -v /var/log/teamcity:/opt/teamcity/logs \
    -p 8111:8111 \
    jetbrains/teamcity-server

--

--