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 a2030b0
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
6 changes: 4 additions & 2 deletions r53-cname/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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]

}

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 a2030b0

Please sign in to comment.