Skip to content

Commit

Permalink
Update 'domain' var to array and move to TLS 1.2 (2019)
Browse files Browse the repository at this point in the history
  • Loading branch information
manumbs committed Jul 27, 2020
1 parent 474f247 commit 52bc3c9
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 10 deletions.
15 changes: 9 additions & 6 deletions r53-cname/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@
## Create a Route53 CNAME record to the Cloudfront distribution
################################################################################################################
resource "aws_route53_record" "cdn-cname" {
zone_id = var.route53_zone_id
name = var.domain
type = "CNAME"
ttl = "300"
records = [var.target]
}

for_each = [for cname in var.domain: {
zone_id = var.route53_zone_id
name = cname
type = "CNAME"
ttl = "300"
records = [var.target]
}]

}
2 changes: 1 addition & 1 deletion r53-cname/variables.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
variable "domain" {
type = string
type = list(string)
}

variable "target" {
Expand Down
4 changes: 2 additions & 2 deletions site-main/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion site-main/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ variable "region" {
}

variable "domain" {
type = string
type = list(string)
}

variable "bucket_name" {
Expand Down

0 comments on commit 52bc3c9

Please sign in to comment.