diff --git a/modules/aws/route53/alias_record/main.tf b/modules/aws/route53/alias_record/main.tf index e71b8f7c..15867f32 100755 --- a/modules/aws/route53/alias_record/main.tf +++ b/modules/aws/route53/alias_record/main.tf @@ -1,3 +1,6 @@ +########################### +# Provider Configuration +########################### terraform { required_version = ">= 1.0.0" required_providers { @@ -8,6 +11,20 @@ terraform { } } +########################### +# Data Sources +########################### + + +########################### +# Locals +########################### + + +########################### +# Module Configuration +########################### + resource "aws_route53_record" "this" { zone_id = var.zone_id name = var.name diff --git a/modules/aws/route53/failover_routing_record/main.tf b/modules/aws/route53/failover_routing_record/main.tf index 8bf85a41..baf587c2 100755 --- a/modules/aws/route53/failover_routing_record/main.tf +++ b/modules/aws/route53/failover_routing_record/main.tf @@ -1,3 +1,6 @@ +########################### +# Provider Configuration +########################### terraform { required_version = ">= 1.0.0" required_providers { @@ -8,12 +11,31 @@ terraform { } } +########################### +# Data Sources +########################### + + +########################### +# Locals +########################### + +locals { + # If a record in var.records is longer than 255 characters, we split the record every 255 characters with \"\" between each 255th and 256th character. + # See https://github.com/hashicorp/terraform-provider-aws/issues/14941 for more information + records = [for record in var.records : replace(record, "/(.{255})/", "$1\"\"")] +} + +########################### +# Module Configuration +########################### + resource "aws_route53_record" "this" { zone_id = var.zone_id name = var.name type = var.type ttl = var.ttl - records = var.records + records = local.records set_identifier = var.set_identifier health_check_id = var.health_check_id diff --git a/modules/aws/route53/geolocation_routing_record/main.tf b/modules/aws/route53/geolocation_routing_record/main.tf index 303d0623..fa667443 100755 --- a/modules/aws/route53/geolocation_routing_record/main.tf +++ b/modules/aws/route53/geolocation_routing_record/main.tf @@ -1,3 +1,6 @@ +########################### +# Provider Configuration +########################### terraform { required_version = ">= 1.0.0" required_providers { @@ -8,12 +11,31 @@ terraform { } } +########################### +# Data Sources +########################### + + +########################### +# Locals +########################### + +locals { + # If a record in var.records is longer than 255 characters, we split the record every 255 characters with \"\" between each 255th and 256th character. + # See https://github.com/hashicorp/terraform-provider-aws/issues/14941 for more information + records = [for record in var.records : replace(record, "/(.{255})/", "$1\"\"")] +} + +########################### +# Module Configuration +########################### + resource "aws_route53_record" "this" { zone_id = var.zone_id name = var.name type = var.type ttl = var.ttl - records = var.records + records = local.records set_identifier = var.set_identifier health_check_id = var.health_check_id diff --git a/modules/aws/route53/latency_routing_record/main.tf b/modules/aws/route53/latency_routing_record/main.tf index c17e7484..f2985871 100755 --- a/modules/aws/route53/latency_routing_record/main.tf +++ b/modules/aws/route53/latency_routing_record/main.tf @@ -1,3 +1,6 @@ +########################### +# Provider Configuration +########################### terraform { required_version = ">= 1.0.0" required_providers { @@ -8,12 +11,31 @@ terraform { } } +########################### +# Data Sources +########################### + + +########################### +# Locals +########################### + +locals { + # If a record in var.records is longer than 255 characters, we split the record every 255 characters with \"\" between each 255th and 256th character. + # See https://github.com/hashicorp/terraform-provider-aws/issues/14941 for more information + records = [for record in var.records : replace(record, "/(.{255})/", "$1\"\"")] +} + +########################### +# Module Configuration +########################### + resource "aws_route53_record" "this" { zone_id = var.zone_id name = var.name type = var.type ttl = var.ttl - records = var.records + records = local.records set_identifier = var.set_identifier health_check_id = var.health_check_id diff --git a/modules/aws/route53/registered_domain/main.tf b/modules/aws/route53/registered_domain/main.tf index 51639870..ceeccae9 100755 --- a/modules/aws/route53/registered_domain/main.tf +++ b/modules/aws/route53/registered_domain/main.tf @@ -1,3 +1,6 @@ +########################### +# Provider Configuration +########################### terraform { required_version = ">= 1.0.0" required_providers { @@ -12,6 +15,10 @@ terraform { # Data Sources ########################### +########################### +# Locals +########################### + ######################################## # Route 53 Registered Domains ######################################## diff --git a/modules/aws/route53/simple_record/main.tf b/modules/aws/route53/simple_record/main.tf index 2a3177a6..9b7dab45 100755 --- a/modules/aws/route53/simple_record/main.tf +++ b/modules/aws/route53/simple_record/main.tf @@ -1,3 +1,6 @@ +########################### +# Provider Configuration +########################### terraform { required_version = ">= 1.0.0" required_providers { @@ -8,12 +11,31 @@ terraform { } } +########################### +# Data Sources +########################### + + +########################### +# Locals +########################### + +locals { + # If a record in var.records is longer than 255 characters, we split the record every 255 characters with \"\" between each 255th and 256th character. + # See https://github.com/hashicorp/terraform-provider-aws/issues/14941 for more information + records = [for record in var.records : replace(record, "/(.{255})/", "$1\"\"")] +} + +########################### +# Module Configuration +########################### + resource "aws_route53_record" "this" { zone_id = var.zone_id name = var.name type = var.type ttl = var.ttl - records = var.records + records = local.records health_check_id = var.health_check_id } diff --git a/modules/aws/route53/weighted_routing_record/main.tf b/modules/aws/route53/weighted_routing_record/main.tf index e8ff5435..90cd5511 100755 --- a/modules/aws/route53/weighted_routing_record/main.tf +++ b/modules/aws/route53/weighted_routing_record/main.tf @@ -1,3 +1,7 @@ +########################### +# Provider Configuration +########################### + terraform { required_version = ">= 1.0.0" required_providers { @@ -8,12 +12,31 @@ terraform { } } +########################### +# Data Sources +########################### + + +########################### +# Locals +########################### + +locals { + # If a record in var.records is longer than 255 characters, we split the record every 255 characters with \"\" between each 255th and 256th character. + # See https://github.com/hashicorp/terraform-provider-aws/issues/14941 for more information + records = [for record in var.records : replace(record, "/(.{255})/", "$1\"\"")] +} + +########################### +# Module Configuration +########################### + resource "aws_route53_record" "this" { zone_id = var.zone_id name = var.name type = var.type ttl = var.ttl - records = var.records + records = local.records set_identifier = var.set_identifier health_check_id = var.health_check_id diff --git a/modules/aws/route53/zone/main.tf b/modules/aws/route53/zone/main.tf index 1205d960..57f8dd3f 100644 --- a/modules/aws/route53/zone/main.tf +++ b/modules/aws/route53/zone/main.tf @@ -1,3 +1,6 @@ +########################### +# Provider Configuration +########################### terraform { required_version = ">= 1.0.0" required_providers { @@ -8,6 +11,18 @@ terraform { } } +########################### +# Data Sources +########################### + + +########################### +# Locals +########################### + +########################### +# Module Configuration +########################### resource "aws_route53_zone" "zone" { for_each = var.zones comment = each.value.comment