diff --git a/cidv2.tf b/cidv2.tf index 6407bd5..6b9b6b5 100644 --- a/cidv2.tf +++ b/cidv2.tf @@ -1,6 +1,6 @@ # CNAME for custom domain for expirimental fly.io deployment. # https://fly.io/docs/networking/custom-domain/ -resource "aws_route53_record" "experimental_api" { +resource "aws_route53_record" "fly_experimental_api" { zone_id = data.aws_route53_zone.imagedirectory_cloud.zone_id name = "api" type = "CNAME" @@ -13,5 +13,22 @@ resource "aws_route53_record" "experimental_api" { create_before_destroy = true } + ttl = "3600" +} + +# Domain validation record for fly.io certificate. +resource "aws_route53_record" "flyio_domain_validation" { + zone_id = data.aws_route53_zone.imagedirectory_cloud.zone_id + name = "_acme-challenge.api" + type = "CNAME" + + records = [ + "api.imagedirectory.cloud.rgdx8e.flydns.net", + ] + + lifecycle { + create_before_destroy = true + } + ttl = "3600" } \ No newline at end of file