From cc7ea0896be3ac84ee5cc6e193ac7062f7cdc785 Mon Sep 17 00:00:00 2001 From: mamrajyadav Date: Fri, 12 Jan 2024 23:09:53 +0530 Subject: [PATCH] fix: update variables types --- _example/basic/example.tf | 2 +- _example/basic/versions.tf | 2 +- _example/complete/versions.tf | 2 +- main.tf | 1 - variables.tf | 24 ++++++++++++++++-------- versions.tf | 2 +- 6 files changed, 20 insertions(+), 13 deletions(-) diff --git a/_example/basic/example.tf b/_example/basic/example.tf index e3307da..687adf0 100644 --- a/_example/basic/example.tf +++ b/_example/basic/example.tf @@ -10,7 +10,7 @@ module "dns_zone" { source = "../.." name = "app" environment = "test" - resource_group_name = "NetworkWatcherRG" + resource_group_name = "test-rg" dns_zone_names = "example.com" private_registration_enabled = false private_dns = false diff --git a/_example/basic/versions.tf b/_example/basic/versions.tf index 9ffba34..fb49866 100644 --- a/_example/basic/versions.tf +++ b/_example/basic/versions.tf @@ -7,7 +7,7 @@ terraform { required_providers { azurerm = { source = "hashicorp/azurerm" - version = ">=3.85.0" + version = ">=3.86.0" } } } diff --git a/_example/complete/versions.tf b/_example/complete/versions.tf index 9ffba34..fb49866 100644 --- a/_example/complete/versions.tf +++ b/_example/complete/versions.tf @@ -7,7 +7,7 @@ terraform { required_providers { azurerm = { source = "hashicorp/azurerm" - version = ">=3.85.0" + version = ">=3.86.0" } } } diff --git a/main.tf b/main.tf index 04d56ba..2c2320e 100644 --- a/main.tf +++ b/main.tf @@ -99,7 +99,6 @@ resource "azurerm_dns_cname_record" "records_cname" { record = lookup(each.value, "record", null) # Optional(Conflicts with target_resource_id) {Either record OR target_resource_id must be specified, but not both.} target_resource_id = lookup(each.value, "target_resource_id", null) # Optional(Conflicts with record) {Either records OR target_resource_id must be specified, but not both.} tags = module.labels.tags - } ##----------------------------------------------------------------------------- diff --git a/variables.tf b/variables.tf index d2f1edf..d3dc790 100644 --- a/variables.tf +++ b/variables.tf @@ -13,7 +13,7 @@ variable "environment" { } variable "label_order" { - type = list(any) + type = list(string) default = ["name", "environment"] description = "Label order, e.g. sequence of application name and environment `name`,`environment`,'attribute' [`webserver`,`qa`,`devops`,`public`,] ." } @@ -31,15 +31,15 @@ variable "repository" { } variable "dns_zone_names" { - default = null type = string + default = null description = "The public dns zone to be created for internal vnet resolution" } variable "private_dns_zone_name" { - default = null type = string + default = null description = "The private dns zone to be created for internal vnet resolution" } @@ -50,8 +50,8 @@ variable "resource_group_name" { } variable "private_registration_enabled" { - default = true type = bool + default = true description = "Is auto-registration of virtual machine records in the virtual network in the Private DNS zone enabled?" } variable "enabled" { @@ -75,19 +75,27 @@ variable "virtual_network_id" { } variable "soa_record_private_dns" { - type = list(any) + type = list(object({})) default = [] description = "Customize details about the root block device of the instance. See Block Devices below for details." } variable "a_records" { - type = any + type = list(object({ + name = string + ttl = number + records = list(string) + })) default = [] description = "List of a records to be added in azure dns zone." } variable "cname_records" { - type = any + type = list(object({ + name = string + ttl = number + record = string + })) default = [] description = "List of cname records" } @@ -103,7 +111,7 @@ variable "ns_records" { } variable "soa_record" { - type = list(any) + type = list(object({})) default = [] description = "Customize details about the root block device of the instance. See Block Devices below for details." } diff --git a/versions.tf b/versions.tf index 5139355..5902724 100644 --- a/versions.tf +++ b/versions.tf @@ -7,7 +7,7 @@ terraform { required_providers { azurerm = { source = "hashicorp/azurerm" - version = ">=3.85.0" + version = ">=3.86.0" } random = { source = "hashicorp/random"