From b0d88f2814f8e049444bc6ba114e1053de7c97a8 Mon Sep 17 00:00:00 2001 From: Dave Sueltenfuss Date: Wed, 2 Mar 2022 08:58:36 -0500 Subject: [PATCH] feat: add the ability to set the TTL for the DNS records --- dns.tf | 2 +- variables.tf | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/dns.tf b/dns.tf index c47ebd8..8a05627 100644 --- a/dns.tf +++ b/dns.tf @@ -3,6 +3,6 @@ resource "aws_route53_record" "source_dns" { zone_id = data.aws_route53_zone.validation_zone.zone_id name = var.source_website type = "CNAME" - ttl = "60" + ttl = var.dns_ttl records = [aws_cloudfront_distribution.cloudfront[0].domain_name] } \ No newline at end of file diff --git a/variables.tf b/variables.tf index 293c310..029ff87 100644 --- a/variables.tf +++ b/variables.tf @@ -14,4 +14,9 @@ variable "workspaces" { description = "Used when using multiple workspaces and only creating the resources for specific ones" type = list(any) default = [] +} + +variable "dns_ttl" { + description = "The TTL for the created DNS records. Defaults to 60 seconds" + default = 60 } \ No newline at end of file