masto-aio/terraform/route53.tf
2023-11-12 16:50:05 -08:00

33 lines
633 B
HCL

module "zone" {
count = local.route53_zone == "" ? 0 : 1
source = "terraform-aws-modules/route53/aws//modules/zones"
version = "~> 2.0"
zones = {
"${local.route53_zone}" = { comment = "${local.route53_zone}" }
}
}
module "records" {
count = local.route53_zone == "" ? 0 : 1
source = "terraform-aws-modules/route53/aws//modules/records"
version = "~> 2.0"
zone_name = keys(module.zone.0.route53_zone_zone_id)[0]
records = [
{
name = ""
type = "A"
ttl = 600 # 10 minutes
records = [ aws_instance.social.public_ip ]
},
]
depends_on = [module.zone]
}