resource "aws_alb_target_group" "tg-prod-kr-tcp-30000" {
    name      = "tg-prod-kr-tcp-30000"
    port      = 30000
    protocol  = "TCP"
    vpc_id    = "${var.VPC_ID}"

    health_check {
        interval            = 30
        protocol            = "TCP"
        healthy_threshold   = 3
        unhealthy_threshold = 3
    }

}

resource "aws_alb_target_group_attachment" "prod-master-http-2a" {
  target_group_arn = "${aws_alb_target_group.tg-prod-kr-tcp-30000.arn}"
  target_id        = "${var.master-2a}"
  port             = 30000
}

resource "aws_alb_target_group_attachment" "prod-master-http-2b" {
  target_group_arn = "${aws_alb_target_group.tg-prod-kr-tcp-30000.arn}"
  target_id        = "${var.master-2b}"
  port             = 30000
}

resource "aws_alb_target_group_attachment" "prod-master-http-2c" {
  target_group_arn = "${aws_alb_target_group.tg-prod-kr-tcp-30000.arn}"
  target_id        = "${var.master-2c}"
  port             = 30000
}

###############################################################################

resource "aws_alb_target_group" "tg-prod-kr-tcp-30001" {
    name      = "tg-prod-kr-tcp-30001"
    port      = 30001
    protocol  = "TCP"
    vpc_id    = "${var.VPC_ID}"

    health_check {
        interval            = 30
        protocol            = "TCP"
        healthy_threshold   = 3
        unhealthy_threshold = 3
    }

}

resource "aws_alb_target_group_attachment" "prod-master-tls-30001-2a" {
  target_group_arn = "${aws_alb_target_group.tg-prod-kr-tcp-30001.arn}"
  target_id        = "${var.master-2a}"
  port             = 30001
}

resource "aws_alb_target_group_attachment" "prod-master-tls-30001-2b" {
  target_group_arn = "${aws_alb_target_group.tg-prod-kr-tcp-30001.arn}"
  target_id        = "${var.master-2b}"
  port             = 30001
}

resource "aws_alb_target_group_attachment" "prod-master-tls-30001-2c" {
  target_group_arn = "${aws_alb_target_group.tg-prod-kr-tcp-30001.arn}"
  target_id        = "${var.master-2c}"
  port             = 30001
}

###############################################################################

resource "aws_alb_target_group" "tg-prod-kr-tcp-31300" {
    name      = "tg-prod-kr-tcp-31300"
    port      = 31300
    protocol  = "TCP"
    vpc_id    = "${var.VPC_ID}"

    health_check {
        interval            = 30
        protocol            = "TCP"
        healthy_threshold   = 3
        unhealthy_threshold = 3
    }

}

resource "aws_alb_target_group_attachment" "prod-master-tls-31300-2a" {
  target_group_arn = "${aws_alb_target_group.tg-prod-kr-tcp-31300.arn}"
  target_id        = "${var.master-2a}"
  port             = 31300
}

resource "aws_alb_target_group_attachment" "prod-master-tls-31300-2b" {
  target_group_arn = "${aws_alb_target_group.tg-prod-kr-tcp-31300.arn}"
  target_id        = "${var.master-2b}"
  port             = 31300
}

resource "aws_alb_target_group_attachment" "prod-master-tls-31300-2c" {
  target_group_arn = "${aws_alb_target_group.tg-prod-kr-tcp-31300.arn}"
  target_id        = "${var.master-2c}"
  port             = 31300
}


###############################################################################

resource "aws_alb_target_group" "tg-prod-kr-tcp-31301" {
    name      = "tg-prod-kr-tcp-31301"
    port      = 31301
    protocol  = "TCP"
    vpc_id    = "${var.VPC_ID}"

    health_check {
        interval            = 30
        protocol            = "TCP"
        healthy_threshold   = 3
        unhealthy_threshold = 3
    }

}

resource "aws_alb_target_group_attachment" "prod-master-tls-31301-2a" {
  target_group_arn = "${aws_alb_target_group.tg-prod-kr-tcp-31301.arn}"
  target_id        = "${var.master-2a}"
  port             = 31301
}

resource "aws_alb_target_group_attachment" "prod-master-tls-31301-2b" {
  target_group_arn = "${aws_alb_target_group.tg-prod-kr-tcp-31301.arn}"
  target_id        = "${var.master-2b}"
  port             = 31301
}

resource "aws_alb_target_group_attachment" "prod-master-tls-31301-2c" {
  target_group_arn = "${aws_alb_target_group.tg-prod-kr-tcp-31301.arn}"
  target_id        = "${var.master-2c}"
  port             = 31301
}

###############################################################################

resource "aws_alb_target_group" "tg-prod-kr-tcp-31302" {
    name      = "tg-prod-kr-tcp-31302"
    port      = 31302
    protocol  = "TCP"
    vpc_id    = "${var.VPC_ID}"

    health_check {
        interval            = 30
        protocol            = "TCP"
        healthy_threshold   = 3
        unhealthy_threshold = 3
    }

}

resource "aws_alb_target_group_attachment" "prod-master-tls-31302-2a" {
  target_group_arn = "${aws_alb_target_group.tg-prod-kr-tcp-31302.arn}"
  target_id        = "${var.master-2a}"
  port             = 31302
}

resource "aws_alb_target_group_attachment" "prod-master-tls-31302-2b" {
  target_group_arn = "${aws_alb_target_group.tg-prod-kr-tcp-31302.arn}"
  target_id        = "${var.master-2b}"
  port             = 31302
}

resource "aws_alb_target_group_attachment" "prod-master-tls-31302-2c" {
  target_group_arn = "${aws_alb_target_group.tg-prod-kr-tcp-31302.arn}"
  target_id        = "${var.master-2c}"
  port             = 31302
}


###############################################################################


resource "aws_alb_target_group" "tg-prod-kr-tcp-31303" {
    name      = "tg-prod-kr-tcp-31303"
    port      = 31303
    protocol  = "TCP"
    vpc_id    = "${var.VPC_ID}"

    health_check {
        interval            = 30
        protocol            = "TCP"
        healthy_threshold   = 3
        unhealthy_threshold = 3
    }

}

resource "aws_alb_target_group_attachment" "prod-master-tls-31303-2a" {
  target_group_arn = "${aws_alb_target_group.tg-prod-kr-tcp-31303.arn}"
  target_id        = "${var.master-2a}"
  port             = 31303
}

resource "aws_alb_target_group_attachment" "prod-master-tls-31303-2b" {
  target_group_arn = "${aws_alb_target_group.tg-prod-kr-tcp-31303.arn}"
  target_id        = "${var.master-2b}"
  port             = 31303
}

resource "aws_alb_target_group_attachment" "prod-master-tls-31303-2c" {
  target_group_arn = "${aws_alb_target_group.tg-prod-kr-tcp-31303.arn}"
  target_id        = "${var.master-2c}"
  port             = 31303
}

###############################################################################

resource "aws_alb_target_group" "tg-prod-kr-tcp-31304" {
    name      = "tg-prod-kr-tcp-31304"
    port      = 31304
    protocol  = "TCP"
    vpc_id    = "${var.VPC_ID}"

    health_check {
        interval            = 30
        protocol            = "TCP"
        healthy_threshold   = 3
        unhealthy_threshold = 3
    }

}

resource "aws_alb_target_group_attachment" "prod-master-tls-31304-2a" {
  target_group_arn = "${aws_alb_target_group.tg-prod-kr-tcp-31304.arn}"
  target_id        = "${var.master-2a}"
  port             = 31304
}

resource "aws_alb_target_group_attachment" "prod-master-tls-31304-2b" {
  target_group_arn = "${aws_alb_target_group.tg-prod-kr-tcp-31304.arn}"
  target_id        = "${var.master-2b}"
  port             = 31304
}

resource "aws_alb_target_group_attachment" "prod-master-tls-31304-2c" {
  target_group_arn = "${aws_alb_target_group.tg-prod-kr-tcp-31304.arn}"
  target_id        = "${var.master-2c}"
  port             = 31304
}

###############################################################################

resource "aws_alb_target_group" "tg-prod-kr-tcp-31305" {
    name      = "tg-prod-kr-tcp-31305"
    port      = 31305
    protocol  = "TCP"
    vpc_id    = "${var.VPC_ID}"

    health_check {
        interval            = 30
        protocol            = "TCP"
        healthy_threshold   = 3
        unhealthy_threshold = 3
    }

}

resource "aws_alb_target_group_attachment" "prod-master-tls-31305-2a" {
  target_group_arn = "${aws_alb_target_group.tg-prod-kr-tcp-31305.arn}"
  target_id        = "${var.master-2a}"
  port             = 31305
}

resource "aws_alb_target_group_attachment" "prod-master-tls-31305-2b" {
  target_group_arn = "${aws_alb_target_group.tg-prod-kr-tcp-31305.arn}"
  target_id        = "${var.master-2b}"
  port             = 31305
}

resource "aws_alb_target_group_attachment" "prod-master-tls-31305-2c" {
  target_group_arn = "${aws_alb_target_group.tg-prod-kr-tcp-31305.arn}"
  target_id        = "${var.master-2c}"
  port             = 31305
}


###############################################################################

resource "aws_alb_target_group" "tg-prod-kr-tcp-31310" {
    name      = "tg-prod-kr-tcp-31310"
    port      = 31310
    protocol  = "TCP"
    vpc_id    = "${var.VPC_ID}"

    health_check {
        interval            = 30
        protocol            = "TCP"
        healthy_threshold   = 3
        unhealthy_threshold = 3
    }

}

resource "aws_alb_target_group_attachment" "prod-master-tls-31310-2a" {
  target_group_arn = "${aws_alb_target_group.tg-prod-kr-tcp-31310.arn}"
  target_id        = "${var.master-2a}"
  port             = 31310
}

resource "aws_alb_target_group_attachment" "prod-master-tls-31310-2b" {
  target_group_arn = "${aws_alb_target_group.tg-prod-kr-tcp-31310.arn}"
  target_id        = "${var.master-2b}"
  port             = 31310
}

resource "aws_alb_target_group_attachment" "prod-master-tls-31310-2c" {
  target_group_arn = "${aws_alb_target_group.tg-prod-kr-tcp-31310.arn}"
  target_id        = "${var.master-2c}"
  port             = 31310
}

###############################################################################

resource "aws_alb_target_group" "tg-prod-kr-tcp-31311" {
    name      = "tg-prod-kr-tcp-31311"
    port      = 31311
    protocol  = "TCP"
    vpc_id    = "${var.VPC_ID}"

    health_check {
        interval            = 30
        protocol            = "TCP"
        healthy_threshold   = 3
        unhealthy_threshold = 3
    }

}

resource "aws_alb_target_group_attachment" "prod-master-tls-31311-2a" {
  target_group_arn = "${aws_alb_target_group.tg-prod-kr-tcp-31311.arn}"
  target_id        = "${var.master-2a}"
  port             = 31311
}

resource "aws_alb_target_group_attachment" "prod-master-tls-31311-2b" {
  target_group_arn = "${aws_alb_target_group.tg-prod-kr-tcp-31311.arn}"
  target_id        = "${var.master-2b}"
  port             = 31311
}

resource "aws_alb_target_group_attachment" "prod-master-tls-31311-2c" {
  target_group_arn = "${aws_alb_target_group.tg-prod-kr-tcp-31311.arn}"
  target_id        = "${var.master-2c}"
  port             = 31311
}

###############################################################################


resource "aws_alb_target_group" "tg-prod-kr-tcp-31312" {
    name      = "tg-prod-kr-tcp-31312"
    port      = 31312
    protocol  = "TCP"
    vpc_id    = "${var.VPC_ID}"

    health_check {
        interval            = 30
        protocol            = "TCP"
        healthy_threshold   = 3
        unhealthy_threshold = 3
    }

}

resource "aws_alb_target_group_attachment" "prod-master-tls-31312-2a" {
  target_group_arn = "${aws_alb_target_group.tg-prod-kr-tcp-31312.arn}"
  target_id        = "${var.master-2a}"
  port             = 31312
}

resource "aws_alb_target_group_attachment" "prod-master-tls-31312-2b" {
  target_group_arn = "${aws_alb_target_group.tg-prod-kr-tcp-31312.arn}"
  target_id        = "${var.master-2b}"
  port             = 31312
}

resource "aws_alb_target_group_attachment" "prod-master-tls-31312-2c" {
  target_group_arn = "${aws_alb_target_group.tg-prod-kr-tcp-31312.arn}"
  target_id        = "${var.master-2c}"
  port             = 31312
}

###############################################################################


resource "aws_alb_target_group" "tg-prod-kr-tcp-31313" {
    name      = "tg-prod-kr-tcp-31313"
    port      = 31313
    protocol  = "TCP"
    vpc_id    = "${var.VPC_ID}"

    health_check {
        interval            = 30
        protocol            = "TCP"
        healthy_threshold   = 3
        unhealthy_threshold = 3
    }

}

resource "aws_alb_target_group_attachment" "prod-master-tls-31313-2a" {
  target_group_arn = "${aws_alb_target_group.tg-prod-kr-tcp-31313.arn}"
  target_id        = "${var.master-2a}"
  port             = 31313
}

resource "aws_alb_target_group_attachment" "prod-master-tls-31313-2b" {
  target_group_arn = "${aws_alb_target_group.tg-prod-kr-tcp-31313.arn}"
  target_id        = "${var.master-2b}"
  port             = 31313
}

resource "aws_alb_target_group_attachment" "prod-master-tls-31313-2c" {
  target_group_arn = "${aws_alb_target_group.tg-prod-kr-tcp-31313.arn}"
  target_id        = "${var.master-2c}"
  port             = 31313
}

###############################################################################


resource "aws_alb_target_group" "tg-prod-kr-tcp-31314" {
    name      = "tg-prod-kr-tcp-31314"
    port      = 31314
    protocol  = "TCP"
    vpc_id    = "${var.VPC_ID}"

    health_check {
        interval            = 30
        protocol            = "TCP"
        healthy_threshold   = 3
        unhealthy_threshold = 3
    }

}

resource "aws_alb_target_group_attachment" "prod-master-tls-31314-2a" {
  target_group_arn = "${aws_alb_target_group.tg-prod-kr-tcp-31314.arn}"
  target_id        = "${var.master-2a}"
  port             = 31314
}

resource "aws_alb_target_group_attachment" "prod-master-tls-31314-2b" {
  target_group_arn = "${aws_alb_target_group.tg-prod-kr-tcp-31314.arn}"
  target_id        = "${var.master-2b}"
  port             = 31314
}

resource "aws_alb_target_group_attachment" "prod-master-tls-31314-2c" {
  target_group_arn = "${aws_alb_target_group.tg-prod-kr-tcp-31314.arn}"
  target_id        = "${var.master-2c}"
  port             = 31314
}

###############################################################################


resource "aws_alb_target_group" "tg-prod-kr-tcp-31315" {
    name      = "tg-prod-kr-tcp-31315"
    port      = 31315
    protocol  = "TCP"
    vpc_id    = "${var.VPC_ID}"

    health_check {
        interval            = 30
        protocol            = "TCP"
        healthy_threshold   = 3
        unhealthy_threshold = 3
    }

}

resource "aws_alb_target_group_attachment" "prod-master-tls-31315-2a" {
  target_group_arn = "${aws_alb_target_group.tg-prod-kr-tcp-31315.arn}"
  target_id        = "${var.master-2a}"
  port             = 31315
}

resource "aws_alb_target_group_attachment" "prod-master-tls-31315-2b" {
  target_group_arn = "${aws_alb_target_group.tg-prod-kr-tcp-31315.arn}"
  target_id        = "${var.master-2b}"
  port             = 31315
}

resource "aws_alb_target_group_attachment" "prod-master-tls-31315-2c" {
  target_group_arn = "${aws_alb_target_group.tg-prod-kr-tcp-31315.arn}"
  target_id        = "${var.master-2c}"
  port             = 31315
}

###############################################################################

