From 1e3c35bee8f5d133430249457ced1d680d01df52 Mon Sep 17 00:00:00 2001 From: Nikita Dugar Date: Fri, 11 Oct 2019 10:29:08 +0530 Subject: [PATCH] update variable --- main.tf | 4 ++-- variables.tf | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/main.tf b/main.tf index d1840cc..01dbbb4 100644 --- a/main.tf +++ b/main.tf @@ -60,8 +60,8 @@ resource "aws_route53_record" "default" { # Module : Route53 Record Set # Description : Terraform module to create Route53 record sets resource on AWS. resource "aws_route53_record" "alias" { - count = var.record_enabled && length(var.alias["names"]) > 0 ? length(var.alias["names"]) : 0 - zone_id = var.zone_id != "" ? var.zone_id : (var.private_enabled ? aws_route53_zone.private.*.zone_id[0] : aws_route53_zone.public.*.zone_id[0]) + count = var.record_enabled && length(var.alias) > 0 && length(var.alias["names"]) > 0 ? length(var.alias["names"]) : 0 + zone_id = var.zone_id name = element(var.names, count.index) type = element(var.types, count.index) set_identifier = length(var.set_identifiers) > 0 ? element(var.set_identifiers, count.index) : "" diff --git a/variables.tf b/variables.tf index 4f69c18..dd86974 100644 --- a/variables.tf +++ b/variables.tf @@ -159,7 +159,7 @@ variable "health_check_ids" { variable "alias" { type = map - default = {} + default = {"names"=[],"zone_ids"=[],"evaluate_target_healths"=[]} description = "An alias block. Conflicts with ttl & records. Alias record documented below." }