masto-aio/terraform/route53.tf

35 lines
691 B
Terraform
Raw Normal View History

2023-11-12 16:50:05 -08:00
module "zone" {
# 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 = {
"${local.domain_name}" = { comment = "${local.domain_name}" }
2023-11-12 16:50:05 -08:00
}
}
module "records" {
# 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"
#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_eip.social.public_ip ]
2023-11-12 16:50:05 -08:00
},
]
depends_on = [ module.zone ]
2023-11-12 16:50:05 -08:00
}