Add a dummy DNS record for load balancer.

This commit is contained in:
mharb 2023-10-23 15:03:45 -04:00
parent d1b4cfff48
commit b927d6346a
1 changed files with 34 additions and 0 deletions

View File

@ -30,3 +30,37 @@ module "standalone_ec2" {
tags = var.tags
}
module "zones" {
source = "terraform-aws-modules/route53/aws//modules/zones"
version = "~> 2.0"
zones = {
"clientapp.com" = {
comment = "Public facing ALB name."
}
}
tags = var.tags
}
module "records" {
source = "terraform-aws-modules/route53/aws//modules/records"
version = "~> 2.0"
zone_name = keys(module.zones.route53_zone_zone_id)[0]
records = [
{
name = "clientapp.com"
type = "A"
alias = {
name = module.loadbalancer.lb_dns_name
zone_id = module.loadbalancer.lb_zone_id
evaluate_target_health = true
}
}
]
depends_on = [module.zones, module.loadbalancer]
}