 variable "datasaker-ai" {
   default = "Z06479772L265DHVJW30F"
 }

 variable "datasaker-com" {
   default = "Z0218361HIZ723RV9EX4"
 }

 variable "datasaker-io" {
   default = "Z072735718G25WNVKU834"
 }

 variable "datasaker-co-kr" {
   default = "Z06528191YJHOMRBYTXXT"
 }

 variable "datasaker-net" {
   default = "Z072720912UR7SY03M9F8"
 }

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

resource "aws_route53_record" "prod-dns-krakend" {
  zone_id = "${var.datasaker-io}"
  name    = "api.kr.datasaker.io"
  type    = "A"
  alias {
    name    = aws_alb.nlb-prod-kr-ingress.dns_name
    zone_id = aws_alb.nlb-prod-kr-ingress.zone_id
    evaluate_target_health = true
  }
}

resource "aws_route53_record" "prod-dns-keycloak" {
  zone_id = "${var.datasaker-io}"
  name    = "auth.kr.datasaker.io"
  type    = "A"
  alias {
    name    = aws_alb.nlb-prod-kr-ingress.dns_name
    zone_id = aws_alb.nlb-prod-kr-ingress.zone_id
    evaluate_target_health = true
  }
}

resource "aws_route53_record" "prod-dns-dsk-agentmanager" {
  zone_id = "${var.datasaker-io}"
  name    = "am.kr.datasaker.io"
  type    = "A"
  alias {
    name    = aws_alb.nlb-prod-kr-ingress.dns_name
    zone_id = aws_alb.nlb-prod-kr-ingress.zone_id
    evaluate_target_health = true
  }
}

resource "aws_route53_record" "prod-dns-datagate-metric" {
  zone_id = "${var.datasaker-io}"
  name    = "megate.kr.datasaker.io"
  type    = "A"
  alias {
    name    = aws_alb.nlb-prod-kr-ingress.dns_name
    zone_id = aws_alb.nlb-prod-kr-ingress.zone_id
    evaluate_target_health = true
  }
}

resource "aws_route53_record" "prod-dns-datagate-jaeger" {
  zone_id = "${var.datasaker-io}"
  name    = "trgate.kr.datasaker.io"
  type    = "A"
  alias {
    name    = aws_alb.nlb-prod-kr-ingress.dns_name
    zone_id = aws_alb.nlb-prod-kr-ingress.zone_id
    evaluate_target_health = true
  }
}

resource "aws_route53_record" "prod-dns-datagate-manifest" {
  zone_id = "${var.datasaker-io}"
  name    = "magate.kr.datasaker.io"
  type    = "A"
  alias {
    name    = aws_alb.nlb-prod-kr-ingress.dns_name
    zone_id = aws_alb.nlb-prod-kr-ingress.zone_id
    evaluate_target_health = true
  }
}

resource "aws_route53_record" "prod-dns-loggate" {
  zone_id = "${var.datasaker-io}"
  name    = "lgate.kr.datasaker.io"
  type    = "A"
  alias {
    name    = aws_alb.nlb-prod-kr-ingress.dns_name
    zone_id = aws_alb.nlb-prod-kr-ingress.zone_id
    evaluate_target_health = true
  }
}

resource "aws_route53_record" "prod-dns-ui" {
  zone_id = "${var.datasaker-io}"
  name    = "app.kr.datasaker.io"
  type    = "A"
  alias {
    name    = aws_alb.nlb-prod-kr-ingress.dns_name
    zone_id = aws_alb.nlb-prod-kr-ingress.zone_id
    evaluate_target_health = true
  }
}

resource "aws_route53_record" "prod-test" {
  zone_id = "${var.datasaker-io}"
  name    = "kubedash.kr.datasaker.io"
  type    = "A"
  alias {
    name    = aws_alb.nlb-prod-kr-ingress.dns_name
    zone_id = aws_alb.nlb-prod-kr-ingress.zone_id
    evaluate_target_health = true
  }
}

resource "aws_route53_record" "prod-test2" {
  zone_id = "${var.datasaker-io}"
  name    = "jenkins-prod.kr.datasaker.io"
  type    = "A"
  alias {
    name    = aws_alb.nlb-prod-kr-ingress.dns_name
    zone_id = aws_alb.nlb-prod-kr-ingress.zone_id
    evaluate_target_health = true
  }
}

