operations: Complete migration to AWS ECS.

This commit is contained in:
2021-07-05 01:57:39 -05:00
parent 99a4c1fc94
commit bc06fc54bb
12 changed files with 232 additions and 166 deletions

View File

@ -1,49 +1,5 @@
# provider "aws" {
# alias = "cert"
# region = "us-east-1"
# }
#
# resource "aws_acm_certificate" "cert" {
# provider = aws.cert
# domain_name = local.app_domain_name
# validation_method = "DNS"
#
# subject_alternative_names = [local.api_domain_name]
#
# tags = {
# Environment = var.environment
# }
#
# lifecycle {
# create_before_destroy = true
# }
# }
#
# resource "aws_route53_record" "cert_validation" {
# for_each {
# for dvo in aws_acm_certificate.cert.domain_validation_options : dvo.domain_name => {
# name = dvo.resource_record_name
# type = dvo.resource_record_type
# record = dvo.resource_record_value
# }
# }
#
# allow_overwrite = true
# name = each.value.name
# records = [ each.value.record ]
# ttl = 60
# type = each.value.type
# zone_id = var.route53_zone.zone_id
# }
#
# resource "aws_acm_certificate_validation" "cert" {
# provider = aws.cert
# certificate_arn = aws_acm_certificate.cert.arn
# validation_record_fqdns = [ for record in aws_route53_record.cert_validation : record.fqdn ]
# }
resource "aws_route53_record" "app_domain" {
zone_id = var.route53_zone.zone_id
zone_id = data.terraform_remote_state.jdbsoft.outputs.aws_route53_zone_jdbsoft.zone_id
name = local.app_domain_name
type = "A"
@ -56,10 +12,14 @@ resource "aws_route53_record" "app_domain" {
depends_on = [aws_cloudfront_distribution.s3_distribution ]
}
# resource "aws_route53_record" "api_domain" {
# zone_id = var.route53_zone.zone_id
# name = local.api_domain_name
# type = "A"
#
# # TODO: alias configuration
# }
resource "aws_route53_record" "api_domain" {
zone_id = data.terraform_remote_state.jdbsoft.outputs.aws_route53_zone_jdbsoft.zone_id
name = local.api_domain_name
type = "A"
alias {
name = data.terraform_remote_state.jdbsoft.outputs.aws_lb_jdbsoft.dns_name
zone_id = data.terraform_remote_state.jdbsoft.outputs.aws_lb_jdbsoft.zone_id
evaluate_target_health = false
}
}