diff --git a/r53-cname/main.tf b/r53-cname/main.tf index 700bd95..be14780 100644 --- a/r53-cname/main.tf +++ b/r53-cname/main.tf @@ -2,10 +2,12 @@ ## Create a Route53 CNAME record to the Cloudfront distribution ################################################################################################################ resource "aws_route53_record" "cdn-cname" { + + count = "${length(var.domain)}" zone_id = var.route53_zone_id - name = var.domain + name = "${element(var.domain, count.index)}" type = "CNAME" ttl = "300" records = [var.target] + } - diff --git a/r53-cname/variables.tf b/r53-cname/variables.tf index 7243e99..18fd55a 100644 --- a/r53-cname/variables.tf +++ b/r53-cname/variables.tf @@ -1,5 +1,5 @@ variable "domain" { - type = string + type = list(string) } variable "target" { diff --git a/site-main/main.tf b/site-main/main.tf index 7a77fbb..a704cfd 100644 --- a/site-main/main.tf +++ b/site-main/main.tf @@ -157,10 +157,10 @@ resource "aws_cloudfront_distribution" "website_cdn" { viewer_certificate { acm_certificate_arn = var.acm-certificate-arn ssl_support_method = "sni-only" - minimum_protocol_version = "TLSv1.2_2018" + minimum_protocol_version = "TLSv1.2_2019" } - aliases = [var.domain] + aliases = var.domain tags = { project = var.project environment = var.environment diff --git a/site-main/variables.tf b/site-main/variables.tf index 4211b16..e1f7559 100644 --- a/site-main/variables.tf +++ b/site-main/variables.tf @@ -3,7 +3,7 @@ variable "region" { } variable "domain" { - type = string + type = list(string) } variable "bucket_name" {