Skip to content

Commit

Permalink
Attach custom domain to ALB
Browse files Browse the repository at this point in the history
  • Loading branch information
shri committed Aug 12, 2024
1 parent ab8db65 commit cee6ed9
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion deploy/aws/tf/modules/alb/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,23 @@ resource "aws_lb_listener" "https" {
target_group_arn = aws_lb_target_group.app_tg.arn
}

depends_on = [aws_lb_target_group.app_tg]
depends_on = [aws_lb_target_group.app_tg, data.aws_acm_certificate.domain_cert]
}

data "aws_route53_zone" "chapter" {
name = "chapter.show"
}

resource "aws_route53_record" "api_chapter_show" {
zone_id = data.aws_route53_zone.chapter.zone_id
name = "api.chapter.show"
type = "A"

alias {
name = aws_lb.app_alb.dns_name
zone_id = aws_lb.app_alb.zone_id
evaluate_target_health = true
}

depends_on = [data.aws_route53_zone.chapter]
}

0 comments on commit cee6ed9

Please sign in to comment.