2023-11-12 16:50:05 -08:00
|
|
|
|
|
|
|
module "zone" {
|
2024-01-18 18:14:17 -08:00
|
|
|
# count = local.route53_zone == "" ? 0 : 1
|
2023-11-12 16:50:05 -08:00
|
|
|
|
|
|
|
source = "terraform-aws-modules/route53/aws//modules/zones"
|
|
|
|
version = "~> 2.0"
|
|
|
|
|
|
|
|
zones = {
|
2024-01-18 18:14:17 -08:00
|
|
|
"${local.domain_name}" = { comment = "${local.domain_name}" }
|
2023-11-12 16:50:05 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
module "records" {
|
2024-01-18 18:14:17 -08:00
|
|
|
# count = local.route53_zone == "" ? 0 : 1
|
2023-11-12 16:50:05 -08:00
|
|
|
|
|
|
|
source = "terraform-aws-modules/route53/aws//modules/records"
|
|
|
|
version = "~> 2.0"
|
2024-01-18 18:14:17 -08:00
|
|
|
#zone_name = keys(module.zone.0.route53_zone_zone_id)[0]
|
|
|
|
zone_name = keys(module.zone.route53_zone_zone_id)[0]
|
2023-11-12 16:50:05 -08:00
|
|
|
|
|
|
|
records = [
|
|
|
|
{
|
|
|
|
name = ""
|
|
|
|
type = "A"
|
|
|
|
ttl = 600 # 10 minutes
|
|
|
|
records = [ aws_instance.social.public_ip ]
|
|
|
|
},
|
|
|
|
]
|
|
|
|
|
|
|
|
depends_on = [module.zone]
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|