From 1086d4b9587101c206d592046a839d6f0cc9bdf2 Mon Sep 17 00:00:00 2001 From: Yohan Belval Date: Mon, 15 Mar 2021 14:41:53 -0400 Subject: [PATCH] Removed the use of deprecated null data source. Module no longer generates multiple results since the count variable is now supported in modules (0.13+). --- .gitignore | 3 ++- README.md | 4 ++-- main.tf | 9 +------- modules/compute/vm_linux/main.tf | 10 +------- modules/compute/vm_linux/outputs.tf | 7 +----- modules/compute/vm_linux/variables.tf | 4 ---- modules/compute/vm_linux/versions.tf | 2 +- modules/compute/vm_windows/main.tf | 10 +------- modules/compute/vm_windows/outputs.tf | 7 +----- modules/compute/vm_windows/variables.tf | 4 ---- modules/compute/vm_windows/versions.tf | 2 +- modules/containers/container_registry/main.tf | 10 +------- .../containers/container_registry/outputs.tf | 7 +----- .../container_registry/variables.tf | 4 ---- .../containers/container_registry/versions.tf | 2 +- modules/general/api_management/main.tf | 10 +------- modules/general/api_management/outputs.tf | 7 +----- modules/general/api_management/variables.tf | 4 ---- modules/general/api_management/versions.tf | 2 +- modules/general/availability_set/main.tf | 10 +------- modules/general/availability_set/outputs.tf | 7 +----- modules/general/availability_set/variables.tf | 4 ---- modules/general/availability_set/versions.tf | 2 +- modules/general/key_vault/main.tf | 10 +------- modules/general/key_vault/outputs.tf | 7 +----- modules/general/key_vault/variables.tf | 4 ---- modules/general/key_vault/versions.tf | 2 +- modules/general/resource_group/main.tf | 10 +------- modules/general/resource_group/outputs.tf | 7 +----- modules/general/resource_group/variables.tf | 4 ---- modules/general/resource_group/versions.tf | 2 +- modules/messaging/event_hub/main.tf | 10 +------- modules/messaging/event_hub/outputs.tf | 7 +----- modules/messaging/event_hub/variables.tf | 4 ---- modules/messaging/event_hub/versions.tf | 2 +- .../messaging/event_hubs_namespace/main.tf | 10 +------- .../messaging/event_hubs_namespace/outputs.tf | 7 +----- .../event_hubs_namespace/variables.tf | 4 ---- .../event_hubs_namespace/versions.tf | 2 +- .../messaging/service_bus_namespace/main.tf | 10 +------- .../service_bus_namespace/outputs.tf | 7 +----- .../service_bus_namespace/variables.tf | 4 ---- .../service_bus_namespace/versions.tf | 2 +- .../networking/application_gateway/main.tf | 10 +------- .../networking/application_gateway/outputs.tf | 7 +----- .../application_gateway/variables.tf | 4 ---- .../application_gateway/versions.tf | 2 +- modules/networking/load_balancer/main.tf | 10 +------- modules/networking/load_balancer/outputs.tf | 7 +----- modules/networking/load_balancer/variables.tf | 4 ---- modules/networking/load_balancer/versions.tf | 2 +- .../load_balancer_rules_config/main.tf | 10 +------- .../load_balancer_rules_config/outputs.tf | 7 +----- .../load_balancer_rules_config/variables.tf | 4 ---- .../load_balancer_rules_config/versions.tf | 2 +- modules/networking/network_interface/main.tf | 10 +------- .../networking/network_interface/outputs.tf | 7 +----- .../networking/network_interface/variables.tf | 4 ---- .../networking/network_interface/versions.tf | 2 +- .../networking/network_security_group/main.tf | 10 +------- .../network_security_group/outputs.tf | 7 +----- .../network_security_group/variables.tf | 4 ---- .../network_security_group/versions.tf | 2 +- .../network_security_group_rule/main.tf | 10 +------- .../network_security_group_rule/outputs.tf | 7 +----- .../network_security_group_rule/variables.tf | 4 ---- .../network_security_group_rule/versions.tf | 2 +- modules/networking/public_ip_address/main.tf | 10 +------- .../networking/public_ip_address/outputs.tf | 7 +----- .../networking/public_ip_address/variables.tf | 4 ---- .../networking/public_ip_address/versions.tf | 2 +- modules/networking/subnet/main.tf | 10 +------- modules/networking/subnet/outputs.tf | 7 +----- modules/networking/subnet/variables.tf | 4 ---- modules/networking/subnet/versions.tf | 2 +- .../traffic_manager_profile/main.tf | 10 +------- .../traffic_manager_profile/outputs.tf | 7 +----- .../traffic_manager_profile/variables.tf | 4 ---- .../traffic_manager_profile/versions.tf | 2 +- modules/networking/virtual_network/main.tf | 10 +------- modules/networking/virtual_network/outputs.tf | 7 +----- .../networking/virtual_network/variables.tf | 4 ---- .../networking/virtual_network/versions.tf | 2 +- modules/storage/backup_policy/main.tf | 10 +------- modules/storage/backup_policy/outputs.tf | 7 +----- modules/storage/backup_policy/variables.tf | 4 ---- modules/storage/backup_policy/versions.tf | 2 +- modules/storage/container_name/main.tf | 10 +------- modules/storage/container_name/outputs.tf | 7 +----- modules/storage/container_name/variables.tf | 4 ---- modules/storage/container_name/versions.tf | 2 +- modules/storage/data_lake_storage/main.tf | 10 +------- modules/storage/data_lake_storage/outputs.tf | 7 +----- .../storage/data_lake_storage/variables.tf | 4 ---- modules/storage/data_lake_storage/versions.tf | 2 +- modules/storage/file_share_name/main.tf | 10 +------- modules/storage/file_share_name/outputs.tf | 7 +----- modules/storage/file_share_name/variables.tf | 4 ---- modules/storage/file_share_name/versions.tf | 2 +- modules/storage/managed_disk_name/main.tf | 10 +------- modules/storage/managed_disk_name/outputs.tf | 7 +----- .../storage/managed_disk_name/variables.tf | 4 ---- modules/storage/managed_disk_name/versions.tf | 2 +- modules/storage/queue_name/main.tf | 10 +------- modules/storage/queue_name/outputs.tf | 7 +----- modules/storage/queue_name/variables.tf | 4 ---- modules/storage/queue_name/versions.tf | 2 +- .../storage/recovery_services_vault/main.tf | 10 +------- .../recovery_services_vault/outputs.tf | 7 +----- .../recovery_services_vault/variables.tf | 4 ---- .../recovery_services_vault/versions.tf | 2 +- modules/storage/storage_account/main.tf | 10 +------- modules/storage/storage_account/outputs.tf | 7 +----- modules/storage/storage_account/variables.tf | 4 ---- modules/storage/storage_account/versions.tf | 2 +- modules/storage/table_name/main.tf | 10 +------- modules/storage/table_name/outputs.tf | 7 +----- modules/storage/table_name/variables.tf | 4 ---- modules/storage/table_name/versions.tf | 2 +- modules/web/slot_name/main.tf | 10 +------- modules/web/slot_name/outputs.tf | 7 +----- modules/web/slot_name/variables.tf | 4 ---- modules/web/slot_name/versions.tf | 2 +- modules/web/web_app/main.tf | 10 +------- modules/web/web_app/outputs.tf | 7 +----- modules/web/web_app/variables.tf | 4 ---- modules/web/web_app/versions.tf | 2 +- modules/web/web_app_name/main.tf | 10 +------- modules/web/web_app_name/outputs.tf | 7 +----- modules/web/web_app_name/variables.tf | 4 ---- modules/web/web_app_name/versions.tf | 2 +- modules/web/web_job_name/main.tf | 10 +------- modules/web/web_job_name/outputs.tf | 7 +----- modules/web/web_job_name/variables.tf | 4 ---- modules/web/web_job_name/versions.tf | 2 +- outputs.tf | 7 +----- templating/package-lock.json | 23 ++++++++++++++++++- templating/templates/main.tf.mustache | 10 +------- templating/templates/outputs.tf.mustache | 7 +----- templating/templates/variables.tf.mustache | 4 ---- templating/templates/versions.tf.mustache | 2 +- variables.tf | 4 ---- versions.tf | 2 +- 143 files changed, 131 insertions(+), 703 deletions(-) diff --git a/.gitignore b/.gitignore index 3b87c9a..71971d6 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,5 @@ node_modules/ *.tfstate *.tfstate.backup -.terraform/ \ No newline at end of file +.terraform/ +.idea/ \ No newline at end of file diff --git a/README.md b/README.md index 4e086c5..6f04c8d 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ _Note: Since this module is comprised of multiple sub-modules, you need to [refe ## Example Usage ```hcl provider "azurerm" { - version = "=2.1.0" + features {} } variable "location" { @@ -60,4 +60,4 @@ terraform get -update ## License -Copyright © 2020, GSoft inc. This code is licensed under the Apache License, Version 2.0. You may obtain a copy of this license at https://github.com/gsoft-inc/gsoft-license/blob/master/LICENSE. +Copyright © 2021, GSoft inc. This code is licensed under the Apache License, Version 2.0. You may obtain a copy of this license at https://github.com/gsoft-inc/gsoft-license/blob/master/LICENSE. diff --git a/main.tf b/main.tf index efa7fca..07fb62a 100644 --- a/main.tf +++ b/main.tf @@ -15,13 +15,6 @@ resource "random_string" "suffix" { } } -data "null_data_source" "names" { - count = var.nb_instances - inputs = { - result = var.nb_instances > 1 ? substr("${local.prefix}${local.separated_name}${count.index}${var.separator}${local.suffix}", 0, var.max_length) : substr("${local.prefix}${var.separator}${var.name}${var.separator}${local.suffix}", 0, var.max_length) - } -} - locals { - results = data.null_data_source.names.*.outputs.result + result = substr("${local.prefix}${local.separated_name}${local.suffix}", 0, var.max_length) } diff --git a/modules/compute/vm_linux/main.tf b/modules/compute/vm_linux/main.tf index 8a1036b..7ea0a7a 100644 --- a/modules/compute/vm_linux/main.tf +++ b/modules/compute/vm_linux/main.tf @@ -5,16 +5,8 @@ module "vm_linux" { suffixes = var.suffixes separator = var.separator != null ? var.separator : "-" max_length = 64 - nb_instances = var.nb_instances -} - -data "null_data_source" "names" { - count = var.nb_instances - inputs = { - result = var.nb_instances > 1 ? regex("^[a-zA-Z0-9]{1}[a-zA-Z0-9-]*$", module.vm_linux.results[count.index]) : regex("^[a-zA-Z0-9]{1}[a-zA-Z0-9-]*$", module.vm_linux.result) - } } locals { - results = data.null_data_source.names.*.outputs.result + result = regex("^[a-zA-Z0-9]{1}[a-zA-Z0-9-]*$", module.vm_linux.result) } \ No newline at end of file diff --git a/modules/compute/vm_linux/outputs.tf b/modules/compute/vm_linux/outputs.tf index 79a619c..5988b5c 100644 --- a/modules/compute/vm_linux/outputs.tf +++ b/modules/compute/vm_linux/outputs.tf @@ -1,9 +1,4 @@ output "result" { description = "The generated linux virtual machine name." - value = local.results[0] -} - -output "results" { - description = "The generated linux virtual machine names." - value = local.results + value = local.result } \ No newline at end of file diff --git a/modules/compute/vm_linux/variables.tf b/modules/compute/vm_linux/variables.tf index f0deb72..c3927a1 100644 --- a/modules/compute/vm_linux/variables.tf +++ b/modules/compute/vm_linux/variables.tf @@ -18,8 +18,4 @@ variable "suffixes" { description = "List of suffixes to append at the end of the resource name." type = list(string) default = null -} - -variable "nb_instances" { - default = 1 } \ No newline at end of file diff --git a/modules/compute/vm_linux/versions.tf b/modules/compute/vm_linux/versions.tf index d9b6f79..6b6318d 100644 --- a/modules/compute/vm_linux/versions.tf +++ b/modules/compute/vm_linux/versions.tf @@ -1,3 +1,3 @@ terraform { - required_version = ">= 0.12" + required_version = ">= 0.13" } diff --git a/modules/compute/vm_windows/main.tf b/modules/compute/vm_windows/main.tf index 1835dc3..4b9afe3 100644 --- a/modules/compute/vm_windows/main.tf +++ b/modules/compute/vm_windows/main.tf @@ -5,16 +5,8 @@ module "vm_windows" { suffixes = var.suffixes separator = var.separator != null ? var.separator : "-" max_length = 15 - nb_instances = var.nb_instances -} - -data "null_data_source" "names" { - count = var.nb_instances - inputs = { - result = var.nb_instances > 1 ? regex("^[a-zA-Z0-9]{1}[a-zA-Z0-9-]*$", module.vm_windows.results[count.index]) : regex("^[a-zA-Z0-9]{1}[a-zA-Z0-9-]*$", module.vm_windows.result) - } } locals { - results = data.null_data_source.names.*.outputs.result + result = regex("^[a-zA-Z0-9]{1}[a-zA-Z0-9-]*$", module.vm_windows.result) } \ No newline at end of file diff --git a/modules/compute/vm_windows/outputs.tf b/modules/compute/vm_windows/outputs.tf index dbe464b..5c2fcca 100644 --- a/modules/compute/vm_windows/outputs.tf +++ b/modules/compute/vm_windows/outputs.tf @@ -1,9 +1,4 @@ output "result" { description = "The generated windows virtual machine name." - value = local.results[0] -} - -output "results" { - description = "The generated windows virtual machine names." - value = local.results + value = local.result } \ No newline at end of file diff --git a/modules/compute/vm_windows/variables.tf b/modules/compute/vm_windows/variables.tf index de209f9..db3e07c 100644 --- a/modules/compute/vm_windows/variables.tf +++ b/modules/compute/vm_windows/variables.tf @@ -18,8 +18,4 @@ variable "suffixes" { description = "List of suffixes to append at the end of the resource name." type = list(string) default = null -} - -variable "nb_instances" { - default = 1 } \ No newline at end of file diff --git a/modules/compute/vm_windows/versions.tf b/modules/compute/vm_windows/versions.tf index d9b6f79..6b6318d 100644 --- a/modules/compute/vm_windows/versions.tf +++ b/modules/compute/vm_windows/versions.tf @@ -1,3 +1,3 @@ terraform { - required_version = ">= 0.12" + required_version = ">= 0.13" } diff --git a/modules/containers/container_registry/main.tf b/modules/containers/container_registry/main.tf index 86a1776..814784e 100644 --- a/modules/containers/container_registry/main.tf +++ b/modules/containers/container_registry/main.tf @@ -5,16 +5,8 @@ module "container_registry" { suffixes = var.suffixes separator = var.separator != null ? var.separator : "0" max_length = 50 - nb_instances = var.nb_instances -} - -data "null_data_source" "names" { - count = var.nb_instances - inputs = { - result = var.nb_instances > 1 ? regex("^[a-zA-Z0-9]{1}[a-zA-Z0-9]*$", module.container_registry.results[count.index]) : regex("^[a-zA-Z0-9]{1}[a-zA-Z0-9]*$", module.container_registry.result) - } } locals { - results = data.null_data_source.names.*.outputs.result + result = regex("^[a-zA-Z0-9]{1}[a-zA-Z0-9]*$", module.container_registry.result) } \ No newline at end of file diff --git a/modules/containers/container_registry/outputs.tf b/modules/containers/container_registry/outputs.tf index 148404a..de5147a 100644 --- a/modules/containers/container_registry/outputs.tf +++ b/modules/containers/container_registry/outputs.tf @@ -1,9 +1,4 @@ output "result" { description = "The generated traffic manager profile name." - value = local.results[0] -} - -output "results" { - description = "The generated traffic manager profile names." - value = local.results + value = local.result } \ No newline at end of file diff --git a/modules/containers/container_registry/variables.tf b/modules/containers/container_registry/variables.tf index 709d42a..c05f0ed 100644 --- a/modules/containers/container_registry/variables.tf +++ b/modules/containers/container_registry/variables.tf @@ -18,8 +18,4 @@ variable "suffixes" { description = "List of suffixes to append at the end of the resource name." type = list(string) default = null -} - -variable "nb_instances" { - default = 1 } \ No newline at end of file diff --git a/modules/containers/container_registry/versions.tf b/modules/containers/container_registry/versions.tf index d9b6f79..6b6318d 100644 --- a/modules/containers/container_registry/versions.tf +++ b/modules/containers/container_registry/versions.tf @@ -1,3 +1,3 @@ terraform { - required_version = ">= 0.12" + required_version = ">= 0.13" } diff --git a/modules/general/api_management/main.tf b/modules/general/api_management/main.tf index b85161a..9406e6c 100644 --- a/modules/general/api_management/main.tf +++ b/modules/general/api_management/main.tf @@ -5,16 +5,8 @@ module "api_management" { suffixes = var.suffixes separator = var.separator != null ? var.separator : "-" max_length = 50 - nb_instances = var.nb_instances -} - -data "null_data_source" "names" { - count = var.nb_instances - inputs = { - result = var.nb_instances > 1 ? regex("^[a-zA-Z0-9]{1}[a-zA-Z0-9-]*$", module.api_management.results[count.index]) : regex("^[a-zA-Z0-9]{1}[a-zA-Z0-9-]*$", module.api_management.result) - } } locals { - results = data.null_data_source.names.*.outputs.result + result = regex("^[a-zA-Z0-9]{1}[a-zA-Z0-9-]*$", module.api_management.result) } \ No newline at end of file diff --git a/modules/general/api_management/outputs.tf b/modules/general/api_management/outputs.tf index b8c7fcf..75b54e6 100644 --- a/modules/general/api_management/outputs.tf +++ b/modules/general/api_management/outputs.tf @@ -1,9 +1,4 @@ output "result" { description = "The generated api management name." - value = local.results[0] -} - -output "results" { - description = "The generated api management names." - value = local.results + value = local.result } \ No newline at end of file diff --git a/modules/general/api_management/variables.tf b/modules/general/api_management/variables.tf index aceaa64..2dde43b 100644 --- a/modules/general/api_management/variables.tf +++ b/modules/general/api_management/variables.tf @@ -18,8 +18,4 @@ variable "suffixes" { description = "List of suffixes to append at the end of the resource name." type = list(string) default = null -} - -variable "nb_instances" { - default = 1 } \ No newline at end of file diff --git a/modules/general/api_management/versions.tf b/modules/general/api_management/versions.tf index d9b6f79..6b6318d 100644 --- a/modules/general/api_management/versions.tf +++ b/modules/general/api_management/versions.tf @@ -1,3 +1,3 @@ terraform { - required_version = ">= 0.12" + required_version = ">= 0.13" } diff --git a/modules/general/availability_set/main.tf b/modules/general/availability_set/main.tf index d6b7754..94ac1de 100644 --- a/modules/general/availability_set/main.tf +++ b/modules/general/availability_set/main.tf @@ -5,16 +5,8 @@ module "availability_set" { suffixes = var.suffixes separator = var.separator != null ? var.separator : "-" max_length = 80 - nb_instances = var.nb_instances -} - -data "null_data_source" "names" { - count = var.nb_instances - inputs = { - result = var.nb_instances > 1 ? regex("^[a-zA-Z0-9]{1}[a-zA-Z0-9-]*$", module.availability_set.results[count.index]) : regex("^[a-zA-Z0-9]{1}[a-zA-Z0-9-]*$", module.availability_set.result) - } } locals { - results = data.null_data_source.names.*.outputs.result + result = regex("^[a-zA-Z0-9]{1}[a-zA-Z0-9-]*$", module.availability_set.result) } \ No newline at end of file diff --git a/modules/general/availability_set/outputs.tf b/modules/general/availability_set/outputs.tf index 6800c68..5f4228c 100644 --- a/modules/general/availability_set/outputs.tf +++ b/modules/general/availability_set/outputs.tf @@ -1,9 +1,4 @@ output "result" { description = "The generated availability set name." - value = local.results[0] -} - -output "results" { - description = "The generated availability set names." - value = local.results + value = local.result } \ No newline at end of file diff --git a/modules/general/availability_set/variables.tf b/modules/general/availability_set/variables.tf index cb2af77..f4e0193 100644 --- a/modules/general/availability_set/variables.tf +++ b/modules/general/availability_set/variables.tf @@ -18,8 +18,4 @@ variable "suffixes" { description = "List of suffixes to append at the end of the resource name." type = list(string) default = null -} - -variable "nb_instances" { - default = 1 } \ No newline at end of file diff --git a/modules/general/availability_set/versions.tf b/modules/general/availability_set/versions.tf index d9b6f79..6b6318d 100644 --- a/modules/general/availability_set/versions.tf +++ b/modules/general/availability_set/versions.tf @@ -1,3 +1,3 @@ terraform { - required_version = ">= 0.12" + required_version = ">= 0.13" } diff --git a/modules/general/key_vault/main.tf b/modules/general/key_vault/main.tf index 4a968b8..0057fa6 100644 --- a/modules/general/key_vault/main.tf +++ b/modules/general/key_vault/main.tf @@ -5,16 +5,8 @@ module "key_vault" { suffixes = var.suffixes separator = var.separator != null ? var.separator : "-" max_length = 24 - nb_instances = var.nb_instances -} - -data "null_data_source" "names" { - count = var.nb_instances - inputs = { - result = var.nb_instances > 1 ? regex("^[a-zA-Z0-9]{1}[a-zA-Z0-9-]*$", module.key_vault.results[count.index]) : regex("^[a-zA-Z0-9]{1}[a-zA-Z0-9-]*$", module.key_vault.result) - } } locals { - results = data.null_data_source.names.*.outputs.result + result = regex("^[a-zA-Z0-9]{1}[a-zA-Z0-9-]*$", module.key_vault.result) } \ No newline at end of file diff --git a/modules/general/key_vault/outputs.tf b/modules/general/key_vault/outputs.tf index 1c63bbb..eb43365 100644 --- a/modules/general/key_vault/outputs.tf +++ b/modules/general/key_vault/outputs.tf @@ -1,9 +1,4 @@ output "result" { description = "The generated key vault name." - value = local.results[0] -} - -output "results" { - description = "The generated key vault names." - value = local.results + value = local.result } \ No newline at end of file diff --git a/modules/general/key_vault/variables.tf b/modules/general/key_vault/variables.tf index 309b5f0..ee15745 100644 --- a/modules/general/key_vault/variables.tf +++ b/modules/general/key_vault/variables.tf @@ -18,8 +18,4 @@ variable "suffixes" { description = "List of suffixes to append at the end of the resource name." type = list(string) default = null -} - -variable "nb_instances" { - default = 1 } \ No newline at end of file diff --git a/modules/general/key_vault/versions.tf b/modules/general/key_vault/versions.tf index d9b6f79..6b6318d 100644 --- a/modules/general/key_vault/versions.tf +++ b/modules/general/key_vault/versions.tf @@ -1,3 +1,3 @@ terraform { - required_version = ">= 0.12" + required_version = ">= 0.13" } diff --git a/modules/general/resource_group/main.tf b/modules/general/resource_group/main.tf index b74d9be..0b61b7b 100644 --- a/modules/general/resource_group/main.tf +++ b/modules/general/resource_group/main.tf @@ -5,16 +5,8 @@ module "resource_group" { suffixes = var.suffixes separator = var.separator != null ? var.separator : "-" max_length = 90 - nb_instances = var.nb_instances -} - -data "null_data_source" "names" { - count = var.nb_instances - inputs = { - result = var.nb_instances > 1 ? regex("^[a-zA-Z0-9]{1}[a-zA-Z0-9-_]*$", module.resource_group.results[count.index]) : regex("^[a-zA-Z0-9]{1}[a-zA-Z0-9-_]*$", module.resource_group.result) - } } locals { - results = data.null_data_source.names.*.outputs.result + result = regex("^[a-zA-Z0-9]{1}[a-zA-Z0-9-_]*$", module.resource_group.result) } \ No newline at end of file diff --git a/modules/general/resource_group/outputs.tf b/modules/general/resource_group/outputs.tf index 2d5e463..ee5d360 100644 --- a/modules/general/resource_group/outputs.tf +++ b/modules/general/resource_group/outputs.tf @@ -1,9 +1,4 @@ output "result" { description = "The generated resource group name." - value = local.results[0] -} - -output "results" { - description = "The generated resource group names." - value = local.results + value = local.result } \ No newline at end of file diff --git a/modules/general/resource_group/variables.tf b/modules/general/resource_group/variables.tf index 690a5de..8b9485a 100644 --- a/modules/general/resource_group/variables.tf +++ b/modules/general/resource_group/variables.tf @@ -18,8 +18,4 @@ variable "suffixes" { description = "List of suffixes to append at the end of the resource name." type = list(string) default = null -} - -variable "nb_instances" { - default = 1 } \ No newline at end of file diff --git a/modules/general/resource_group/versions.tf b/modules/general/resource_group/versions.tf index d9b6f79..6b6318d 100644 --- a/modules/general/resource_group/versions.tf +++ b/modules/general/resource_group/versions.tf @@ -1,3 +1,3 @@ terraform { - required_version = ">= 0.12" + required_version = ">= 0.13" } diff --git a/modules/messaging/event_hub/main.tf b/modules/messaging/event_hub/main.tf index 37d0ac3..ebb5e10 100644 --- a/modules/messaging/event_hub/main.tf +++ b/modules/messaging/event_hub/main.tf @@ -5,16 +5,8 @@ module "event_hub" { suffixes = var.suffixes separator = var.separator != null ? var.separator : "-" max_length = 50 - nb_instances = var.nb_instances -} - -data "null_data_source" "names" { - count = var.nb_instances - inputs = { - result = var.nb_instances > 1 ? regex("^[a-zA-Z0-9]{1}[a-zA-Z0-9-_.]*$", module.event_hub.results[count.index]) : regex("^[a-zA-Z0-9]{1}[a-zA-Z0-9-_.]*$", module.event_hub.result) - } } locals { - results = data.null_data_source.names.*.outputs.result + result = regex("^[a-zA-Z0-9]{1}[a-zA-Z0-9-_.]*$", module.event_hub.result) } \ No newline at end of file diff --git a/modules/messaging/event_hub/outputs.tf b/modules/messaging/event_hub/outputs.tf index 39fbcd2..75bcd1c 100644 --- a/modules/messaging/event_hub/outputs.tf +++ b/modules/messaging/event_hub/outputs.tf @@ -1,9 +1,4 @@ output "result" { description = "The generated event hub name." - value = local.results[0] -} - -output "results" { - description = "The generated event hub names." - value = local.results + value = local.result } \ No newline at end of file diff --git a/modules/messaging/event_hub/variables.tf b/modules/messaging/event_hub/variables.tf index b01812b..7826447 100644 --- a/modules/messaging/event_hub/variables.tf +++ b/modules/messaging/event_hub/variables.tf @@ -18,8 +18,4 @@ variable "suffixes" { description = "List of suffixes to append at the end of the resource name." type = list(string) default = null -} - -variable "nb_instances" { - default = 1 } \ No newline at end of file diff --git a/modules/messaging/event_hub/versions.tf b/modules/messaging/event_hub/versions.tf index d9b6f79..6b6318d 100644 --- a/modules/messaging/event_hub/versions.tf +++ b/modules/messaging/event_hub/versions.tf @@ -1,3 +1,3 @@ terraform { - required_version = ">= 0.12" + required_version = ">= 0.13" } diff --git a/modules/messaging/event_hubs_namespace/main.tf b/modules/messaging/event_hubs_namespace/main.tf index 3fbb0d1..8c4c2dd 100644 --- a/modules/messaging/event_hubs_namespace/main.tf +++ b/modules/messaging/event_hubs_namespace/main.tf @@ -5,16 +5,8 @@ module "event_hubs_namespace" { suffixes = var.suffixes separator = var.separator != null ? var.separator : "-" max_length = 50 - nb_instances = var.nb_instances -} - -data "null_data_source" "names" { - count = var.nb_instances - inputs = { - result = var.nb_instances > 1 ? regex("^[a-zA-Z]{1}[a-zA-Z0-9-]*$", module.event_hubs_namespace.results[count.index]) : regex("^[a-zA-Z]{1}[a-zA-Z0-9-]*$", module.event_hubs_namespace.result) - } } locals { - results = data.null_data_source.names.*.outputs.result + result = regex("^[a-zA-Z]{1}[a-zA-Z0-9-]*$", module.event_hubs_namespace.result) } \ No newline at end of file diff --git a/modules/messaging/event_hubs_namespace/outputs.tf b/modules/messaging/event_hubs_namespace/outputs.tf index aa8ff7d..c7bcc40 100644 --- a/modules/messaging/event_hubs_namespace/outputs.tf +++ b/modules/messaging/event_hubs_namespace/outputs.tf @@ -1,9 +1,4 @@ output "result" { description = "The generated event hubs namespace name." - value = local.results[0] -} - -output "results" { - description = "The generated event hubs namespace names." - value = local.results + value = local.result } \ No newline at end of file diff --git a/modules/messaging/event_hubs_namespace/variables.tf b/modules/messaging/event_hubs_namespace/variables.tf index ec288a3..e7e34b6 100644 --- a/modules/messaging/event_hubs_namespace/variables.tf +++ b/modules/messaging/event_hubs_namespace/variables.tf @@ -18,8 +18,4 @@ variable "suffixes" { description = "List of suffixes to append at the end of the resource name." type = list(string) default = null -} - -variable "nb_instances" { - default = 1 } \ No newline at end of file diff --git a/modules/messaging/event_hubs_namespace/versions.tf b/modules/messaging/event_hubs_namespace/versions.tf index d9b6f79..6b6318d 100644 --- a/modules/messaging/event_hubs_namespace/versions.tf +++ b/modules/messaging/event_hubs_namespace/versions.tf @@ -1,3 +1,3 @@ terraform { - required_version = ">= 0.12" + required_version = ">= 0.13" } diff --git a/modules/messaging/service_bus_namespace/main.tf b/modules/messaging/service_bus_namespace/main.tf index 6dba824..7b0ec6f 100644 --- a/modules/messaging/service_bus_namespace/main.tf +++ b/modules/messaging/service_bus_namespace/main.tf @@ -5,16 +5,8 @@ module "service_bus_namespace" { suffixes = var.suffixes separator = var.separator != null ? var.separator : "-" max_length = 50 - nb_instances = var.nb_instances -} - -data "null_data_source" "names" { - count = var.nb_instances - inputs = { - result = var.nb_instances > 1 ? regex("^[a-zA-Z]{1}[a-zA-Z0-9-]*$", module.service_bus_namespace.results[count.index]) : regex("^[a-zA-Z]{1}[a-zA-Z0-9-]*$", module.service_bus_namespace.result) - } } locals { - results = data.null_data_source.names.*.outputs.result + result = regex("^[a-zA-Z]{1}[a-zA-Z0-9-]*$", module.service_bus_namespace.result) } \ No newline at end of file diff --git a/modules/messaging/service_bus_namespace/outputs.tf b/modules/messaging/service_bus_namespace/outputs.tf index d390f5a..fe31e2f 100644 --- a/modules/messaging/service_bus_namespace/outputs.tf +++ b/modules/messaging/service_bus_namespace/outputs.tf @@ -1,9 +1,4 @@ output "result" { description = "The generated service bus namespace name." - value = local.results[0] -} - -output "results" { - description = "The generated service bus namespace names." - value = local.results + value = local.result } \ No newline at end of file diff --git a/modules/messaging/service_bus_namespace/variables.tf b/modules/messaging/service_bus_namespace/variables.tf index 940b041..0d44ff9 100644 --- a/modules/messaging/service_bus_namespace/variables.tf +++ b/modules/messaging/service_bus_namespace/variables.tf @@ -18,8 +18,4 @@ variable "suffixes" { description = "List of suffixes to append at the end of the resource name." type = list(string) default = null -} - -variable "nb_instances" { - default = 1 } \ No newline at end of file diff --git a/modules/messaging/service_bus_namespace/versions.tf b/modules/messaging/service_bus_namespace/versions.tf index d9b6f79..6b6318d 100644 --- a/modules/messaging/service_bus_namespace/versions.tf +++ b/modules/messaging/service_bus_namespace/versions.tf @@ -1,3 +1,3 @@ terraform { - required_version = ">= 0.12" + required_version = ">= 0.13" } diff --git a/modules/networking/application_gateway/main.tf b/modules/networking/application_gateway/main.tf index f26c9e2..301ee5f 100644 --- a/modules/networking/application_gateway/main.tf +++ b/modules/networking/application_gateway/main.tf @@ -5,16 +5,8 @@ module "application_gateway" { suffixes = var.suffixes separator = var.separator != null ? var.separator : "-" max_length = 80 - nb_instances = var.nb_instances -} - -data "null_data_source" "names" { - count = var.nb_instances - inputs = { - result = var.nb_instances > 1 ? regex("^[a-zA-Z0-9]{1}[a-zA-Z0-9-_.]*$", module.application_gateway.results[count.index]) : regex("^[a-zA-Z0-9]{1}[a-zA-Z0-9-_.]*$", module.application_gateway.result) - } } locals { - results = data.null_data_source.names.*.outputs.result + result = regex("^[a-zA-Z0-9]{1}[a-zA-Z0-9-_.]*$", module.application_gateway.result) } \ No newline at end of file diff --git a/modules/networking/application_gateway/outputs.tf b/modules/networking/application_gateway/outputs.tf index ad4020c..72c9207 100644 --- a/modules/networking/application_gateway/outputs.tf +++ b/modules/networking/application_gateway/outputs.tf @@ -1,9 +1,4 @@ output "result" { description = "The generated application gateway name." - value = local.results[0] -} - -output "results" { - description = "The generated application gateway names." - value = local.results + value = local.result } \ No newline at end of file diff --git a/modules/networking/application_gateway/variables.tf b/modules/networking/application_gateway/variables.tf index dbedaa7..4c309b6 100644 --- a/modules/networking/application_gateway/variables.tf +++ b/modules/networking/application_gateway/variables.tf @@ -18,8 +18,4 @@ variable "suffixes" { description = "List of suffixes to append at the end of the resource name." type = list(string) default = null -} - -variable "nb_instances" { - default = 1 } \ No newline at end of file diff --git a/modules/networking/application_gateway/versions.tf b/modules/networking/application_gateway/versions.tf index d9b6f79..6b6318d 100644 --- a/modules/networking/application_gateway/versions.tf +++ b/modules/networking/application_gateway/versions.tf @@ -1,3 +1,3 @@ terraform { - required_version = ">= 0.12" + required_version = ">= 0.13" } diff --git a/modules/networking/load_balancer/main.tf b/modules/networking/load_balancer/main.tf index a654379..830349c 100644 --- a/modules/networking/load_balancer/main.tf +++ b/modules/networking/load_balancer/main.tf @@ -5,16 +5,8 @@ module "load_balancer" { suffixes = var.suffixes separator = var.separator != null ? var.separator : "-" max_length = 80 - nb_instances = var.nb_instances -} - -data "null_data_source" "names" { - count = var.nb_instances - inputs = { - result = var.nb_instances > 1 ? regex("^[a-zA-Z0-9]{1}[a-zA-Z0-9-_.]*$", module.load_balancer.results[count.index]) : regex("^[a-zA-Z0-9]{1}[a-zA-Z0-9-_.]*$", module.load_balancer.result) - } } locals { - results = data.null_data_source.names.*.outputs.result + result = regex("^[a-zA-Z0-9]{1}[a-zA-Z0-9-_.]*$", module.load_balancer.result) } \ No newline at end of file diff --git a/modules/networking/load_balancer/outputs.tf b/modules/networking/load_balancer/outputs.tf index 68f9a17..8a89bbc 100644 --- a/modules/networking/load_balancer/outputs.tf +++ b/modules/networking/load_balancer/outputs.tf @@ -1,9 +1,4 @@ output "result" { description = "The generated load balancer name." - value = local.results[0] -} - -output "results" { - description = "The generated load balancer names." - value = local.results + value = local.result } \ No newline at end of file diff --git a/modules/networking/load_balancer/variables.tf b/modules/networking/load_balancer/variables.tf index 67d1782..d316152 100644 --- a/modules/networking/load_balancer/variables.tf +++ b/modules/networking/load_balancer/variables.tf @@ -18,8 +18,4 @@ variable "suffixes" { description = "List of suffixes to append at the end of the resource name." type = list(string) default = null -} - -variable "nb_instances" { - default = 1 } \ No newline at end of file diff --git a/modules/networking/load_balancer/versions.tf b/modules/networking/load_balancer/versions.tf index d9b6f79..6b6318d 100644 --- a/modules/networking/load_balancer/versions.tf +++ b/modules/networking/load_balancer/versions.tf @@ -1,3 +1,3 @@ terraform { - required_version = ">= 0.12" + required_version = ">= 0.13" } diff --git a/modules/networking/load_balancer_rules_config/main.tf b/modules/networking/load_balancer_rules_config/main.tf index dd69fd0..3df8758 100644 --- a/modules/networking/load_balancer_rules_config/main.tf +++ b/modules/networking/load_balancer_rules_config/main.tf @@ -5,16 +5,8 @@ module "load_balancer_rules_config" { suffixes = var.suffixes separator = var.separator != null ? var.separator : "-" max_length = 80 - nb_instances = var.nb_instances -} - -data "null_data_source" "names" { - count = var.nb_instances - inputs = { - result = var.nb_instances > 1 ? regex("^[a-zA-Z0-9]{1}[a-zA-Z0-9-_.]*$", module.load_balancer_rules_config.results[count.index]) : regex("^[a-zA-Z0-9]{1}[a-zA-Z0-9-_.]*$", module.load_balancer_rules_config.result) - } } locals { - results = data.null_data_source.names.*.outputs.result + result = regex("^[a-zA-Z0-9]{1}[a-zA-Z0-9-_.]*$", module.load_balancer_rules_config.result) } \ No newline at end of file diff --git a/modules/networking/load_balancer_rules_config/outputs.tf b/modules/networking/load_balancer_rules_config/outputs.tf index 62a2218..a56d1b3 100644 --- a/modules/networking/load_balancer_rules_config/outputs.tf +++ b/modules/networking/load_balancer_rules_config/outputs.tf @@ -1,9 +1,4 @@ output "result" { description = "The generated load balancer rules config name." - value = local.results[0] -} - -output "results" { - description = "The generated load balancer rules config names." - value = local.results + value = local.result } \ No newline at end of file diff --git a/modules/networking/load_balancer_rules_config/variables.tf b/modules/networking/load_balancer_rules_config/variables.tf index 9b89e5a..1a75c82 100644 --- a/modules/networking/load_balancer_rules_config/variables.tf +++ b/modules/networking/load_balancer_rules_config/variables.tf @@ -18,8 +18,4 @@ variable "suffixes" { description = "List of suffixes to append at the end of the resource name." type = list(string) default = null -} - -variable "nb_instances" { - default = 1 } \ No newline at end of file diff --git a/modules/networking/load_balancer_rules_config/versions.tf b/modules/networking/load_balancer_rules_config/versions.tf index d9b6f79..6b6318d 100644 --- a/modules/networking/load_balancer_rules_config/versions.tf +++ b/modules/networking/load_balancer_rules_config/versions.tf @@ -1,3 +1,3 @@ terraform { - required_version = ">= 0.12" + required_version = ">= 0.13" } diff --git a/modules/networking/network_interface/main.tf b/modules/networking/network_interface/main.tf index 1d220e0..6bfc6b9 100644 --- a/modules/networking/network_interface/main.tf +++ b/modules/networking/network_interface/main.tf @@ -5,16 +5,8 @@ module "network_interface" { suffixes = var.suffixes separator = var.separator != null ? var.separator : "-" max_length = 80 - nb_instances = var.nb_instances -} - -data "null_data_source" "names" { - count = var.nb_instances - inputs = { - result = var.nb_instances > 1 ? regex("^[a-zA-Z0-9]{1}[a-zA-Z0-9-_.]*$", module.network_interface.results[count.index]) : regex("^[a-zA-Z0-9]{1}[a-zA-Z0-9-_.]*$", module.network_interface.result) - } } locals { - results = data.null_data_source.names.*.outputs.result + result = regex("^[a-zA-Z0-9]{1}[a-zA-Z0-9-_.]*$", module.network_interface.result) } \ No newline at end of file diff --git a/modules/networking/network_interface/outputs.tf b/modules/networking/network_interface/outputs.tf index adb8303..0fa2588 100644 --- a/modules/networking/network_interface/outputs.tf +++ b/modules/networking/network_interface/outputs.tf @@ -1,9 +1,4 @@ output "result" { description = "The generated network interface name." - value = local.results[0] -} - -output "results" { - description = "The generated network interface names." - value = local.results + value = local.result } \ No newline at end of file diff --git a/modules/networking/network_interface/variables.tf b/modules/networking/network_interface/variables.tf index aa11671..3c754a3 100644 --- a/modules/networking/network_interface/variables.tf +++ b/modules/networking/network_interface/variables.tf @@ -18,8 +18,4 @@ variable "suffixes" { description = "List of suffixes to append at the end of the resource name." type = list(string) default = null -} - -variable "nb_instances" { - default = 1 } \ No newline at end of file diff --git a/modules/networking/network_interface/versions.tf b/modules/networking/network_interface/versions.tf index d9b6f79..6b6318d 100644 --- a/modules/networking/network_interface/versions.tf +++ b/modules/networking/network_interface/versions.tf @@ -1,3 +1,3 @@ terraform { - required_version = ">= 0.12" + required_version = ">= 0.13" } diff --git a/modules/networking/network_security_group/main.tf b/modules/networking/network_security_group/main.tf index 3c21f50..c1c058a 100644 --- a/modules/networking/network_security_group/main.tf +++ b/modules/networking/network_security_group/main.tf @@ -5,16 +5,8 @@ module "network_security_group" { suffixes = var.suffixes separator = var.separator != null ? var.separator : "-" max_length = 80 - nb_instances = var.nb_instances -} - -data "null_data_source" "names" { - count = var.nb_instances - inputs = { - result = var.nb_instances > 1 ? regex("^[a-zA-Z0-9]{1}[a-zA-Z0-9-_.]*$", module.network_security_group.results[count.index]) : regex("^[a-zA-Z0-9]{1}[a-zA-Z0-9-_.]*$", module.network_security_group.result) - } } locals { - results = data.null_data_source.names.*.outputs.result + result = regex("^[a-zA-Z0-9]{1}[a-zA-Z0-9-_.]*$", module.network_security_group.result) } \ No newline at end of file diff --git a/modules/networking/network_security_group/outputs.tf b/modules/networking/network_security_group/outputs.tf index 822811f..29d9075 100644 --- a/modules/networking/network_security_group/outputs.tf +++ b/modules/networking/network_security_group/outputs.tf @@ -1,9 +1,4 @@ output "result" { description = "The generated network security group name." - value = local.results[0] -} - -output "results" { - description = "The generated network security group names." - value = local.results + value = local.result } \ No newline at end of file diff --git a/modules/networking/network_security_group/variables.tf b/modules/networking/network_security_group/variables.tf index 7afbcff..33a28e8 100644 --- a/modules/networking/network_security_group/variables.tf +++ b/modules/networking/network_security_group/variables.tf @@ -18,8 +18,4 @@ variable "suffixes" { description = "List of suffixes to append at the end of the resource name." type = list(string) default = null -} - -variable "nb_instances" { - default = 1 } \ No newline at end of file diff --git a/modules/networking/network_security_group/versions.tf b/modules/networking/network_security_group/versions.tf index d9b6f79..6b6318d 100644 --- a/modules/networking/network_security_group/versions.tf +++ b/modules/networking/network_security_group/versions.tf @@ -1,3 +1,3 @@ terraform { - required_version = ">= 0.12" + required_version = ">= 0.13" } diff --git a/modules/networking/network_security_group_rule/main.tf b/modules/networking/network_security_group_rule/main.tf index 9e43007..0513370 100644 --- a/modules/networking/network_security_group_rule/main.tf +++ b/modules/networking/network_security_group_rule/main.tf @@ -5,16 +5,8 @@ module "network_security_group_rule" { suffixes = var.suffixes separator = var.separator != null ? var.separator : "-" max_length = 80 - nb_instances = var.nb_instances -} - -data "null_data_source" "names" { - count = var.nb_instances - inputs = { - result = var.nb_instances > 1 ? regex("^[a-zA-Z0-9]{1}[a-zA-Z0-9-_.]*$", module.network_security_group_rule.results[count.index]) : regex("^[a-zA-Z0-9]{1}[a-zA-Z0-9-_.]*$", module.network_security_group_rule.result) - } } locals { - results = data.null_data_source.names.*.outputs.result + result = regex("^[a-zA-Z0-9]{1}[a-zA-Z0-9-_.]*$", module.network_security_group_rule.result) } \ No newline at end of file diff --git a/modules/networking/network_security_group_rule/outputs.tf b/modules/networking/network_security_group_rule/outputs.tf index 32fc6b4..b7d841f 100644 --- a/modules/networking/network_security_group_rule/outputs.tf +++ b/modules/networking/network_security_group_rule/outputs.tf @@ -1,9 +1,4 @@ output "result" { description = "The generated network security group rule name." - value = local.results[0] -} - -output "results" { - description = "The generated network security group rule names." - value = local.results + value = local.result } \ No newline at end of file diff --git a/modules/networking/network_security_group_rule/variables.tf b/modules/networking/network_security_group_rule/variables.tf index e108725..a6cefac 100644 --- a/modules/networking/network_security_group_rule/variables.tf +++ b/modules/networking/network_security_group_rule/variables.tf @@ -18,8 +18,4 @@ variable "suffixes" { description = "List of suffixes to append at the end of the resource name." type = list(string) default = null -} - -variable "nb_instances" { - default = 1 } \ No newline at end of file diff --git a/modules/networking/network_security_group_rule/versions.tf b/modules/networking/network_security_group_rule/versions.tf index d9b6f79..6b6318d 100644 --- a/modules/networking/network_security_group_rule/versions.tf +++ b/modules/networking/network_security_group_rule/versions.tf @@ -1,3 +1,3 @@ terraform { - required_version = ">= 0.12" + required_version = ">= 0.13" } diff --git a/modules/networking/public_ip_address/main.tf b/modules/networking/public_ip_address/main.tf index 97e4370..7b7e355 100644 --- a/modules/networking/public_ip_address/main.tf +++ b/modules/networking/public_ip_address/main.tf @@ -5,16 +5,8 @@ module "public_ip_address" { suffixes = var.suffixes separator = var.separator != null ? var.separator : "-" max_length = 80 - nb_instances = var.nb_instances -} - -data "null_data_source" "names" { - count = var.nb_instances - inputs = { - result = var.nb_instances > 1 ? regex("^[a-zA-Z0-9]{1}[a-zA-Z0-9-_.]*$", module.public_ip_address.results[count.index]) : regex("^[a-zA-Z0-9]{1}[a-zA-Z0-9-_.]*$", module.public_ip_address.result) - } } locals { - results = data.null_data_source.names.*.outputs.result + result = regex("^[a-zA-Z0-9]{1}[a-zA-Z0-9-_.]*$", module.public_ip_address.result) } \ No newline at end of file diff --git a/modules/networking/public_ip_address/outputs.tf b/modules/networking/public_ip_address/outputs.tf index ccefd43..2ec1018 100644 --- a/modules/networking/public_ip_address/outputs.tf +++ b/modules/networking/public_ip_address/outputs.tf @@ -1,9 +1,4 @@ output "result" { description = "The generated public ip address name." - value = local.results[0] -} - -output "results" { - description = "The generated public ip address names." - value = local.results + value = local.result } \ No newline at end of file diff --git a/modules/networking/public_ip_address/variables.tf b/modules/networking/public_ip_address/variables.tf index 346f77b..4235723 100644 --- a/modules/networking/public_ip_address/variables.tf +++ b/modules/networking/public_ip_address/variables.tf @@ -18,8 +18,4 @@ variable "suffixes" { description = "List of suffixes to append at the end of the resource name." type = list(string) default = null -} - -variable "nb_instances" { - default = 1 } \ No newline at end of file diff --git a/modules/networking/public_ip_address/versions.tf b/modules/networking/public_ip_address/versions.tf index d9b6f79..6b6318d 100644 --- a/modules/networking/public_ip_address/versions.tf +++ b/modules/networking/public_ip_address/versions.tf @@ -1,3 +1,3 @@ terraform { - required_version = ">= 0.12" + required_version = ">= 0.13" } diff --git a/modules/networking/subnet/main.tf b/modules/networking/subnet/main.tf index 6a7302b..785f3ae 100644 --- a/modules/networking/subnet/main.tf +++ b/modules/networking/subnet/main.tf @@ -5,16 +5,8 @@ module "subnet" { suffixes = var.suffixes separator = var.separator != null ? var.separator : "-" max_length = 80 - nb_instances = var.nb_instances -} - -data "null_data_source" "names" { - count = var.nb_instances - inputs = { - result = var.nb_instances > 1 ? regex("^[a-zA-Z0-9]{1}[a-zA-Z0-9-_.]*$", module.subnet.results[count.index]) : regex("^[a-zA-Z0-9]{1}[a-zA-Z0-9-_.]*$", module.subnet.result) - } } locals { - results = data.null_data_source.names.*.outputs.result + result = regex("^[a-zA-Z0-9]{1}[a-zA-Z0-9-_.]*$", module.subnet.result) } \ No newline at end of file diff --git a/modules/networking/subnet/outputs.tf b/modules/networking/subnet/outputs.tf index 1951c8d..6cdbcff 100644 --- a/modules/networking/subnet/outputs.tf +++ b/modules/networking/subnet/outputs.tf @@ -1,9 +1,4 @@ output "result" { description = "The generated virtual network subnet name." - value = local.results[0] -} - -output "results" { - description = "The generated virtual network subnet names." - value = local.results + value = local.result } \ No newline at end of file diff --git a/modules/networking/subnet/variables.tf b/modules/networking/subnet/variables.tf index b4d70e3..24c8221 100644 --- a/modules/networking/subnet/variables.tf +++ b/modules/networking/subnet/variables.tf @@ -18,8 +18,4 @@ variable "suffixes" { description = "List of suffixes to append at the end of the resource name." type = list(string) default = null -} - -variable "nb_instances" { - default = 1 } \ No newline at end of file diff --git a/modules/networking/subnet/versions.tf b/modules/networking/subnet/versions.tf index d9b6f79..6b6318d 100644 --- a/modules/networking/subnet/versions.tf +++ b/modules/networking/subnet/versions.tf @@ -1,3 +1,3 @@ terraform { - required_version = ">= 0.12" + required_version = ">= 0.13" } diff --git a/modules/networking/traffic_manager_profile/main.tf b/modules/networking/traffic_manager_profile/main.tf index f2dbd42..a12fe21 100644 --- a/modules/networking/traffic_manager_profile/main.tf +++ b/modules/networking/traffic_manager_profile/main.tf @@ -5,16 +5,8 @@ module "traffic_manager_profile" { suffixes = var.suffixes separator = var.separator != null ? var.separator : "-" max_length = 80 - nb_instances = var.nb_instances -} - -data "null_data_source" "names" { - count = var.nb_instances - inputs = { - result = var.nb_instances > 1 ? regex("^[a-zA-Z0-9]{1}[a-zA-Z0-9-.]*$", module.traffic_manager_profile.results[count.index]) : regex("^[a-zA-Z0-9]{1}[a-zA-Z0-9-.]*$", module.traffic_manager_profile.result) - } } locals { - results = data.null_data_source.names.*.outputs.result + result = regex("^[a-zA-Z0-9]{1}[a-zA-Z0-9-.]*$", module.traffic_manager_profile.result) } \ No newline at end of file diff --git a/modules/networking/traffic_manager_profile/outputs.tf b/modules/networking/traffic_manager_profile/outputs.tf index 148404a..de5147a 100644 --- a/modules/networking/traffic_manager_profile/outputs.tf +++ b/modules/networking/traffic_manager_profile/outputs.tf @@ -1,9 +1,4 @@ output "result" { description = "The generated traffic manager profile name." - value = local.results[0] -} - -output "results" { - description = "The generated traffic manager profile names." - value = local.results + value = local.result } \ No newline at end of file diff --git a/modules/networking/traffic_manager_profile/variables.tf b/modules/networking/traffic_manager_profile/variables.tf index 709d42a..c05f0ed 100644 --- a/modules/networking/traffic_manager_profile/variables.tf +++ b/modules/networking/traffic_manager_profile/variables.tf @@ -18,8 +18,4 @@ variable "suffixes" { description = "List of suffixes to append at the end of the resource name." type = list(string) default = null -} - -variable "nb_instances" { - default = 1 } \ No newline at end of file diff --git a/modules/networking/traffic_manager_profile/versions.tf b/modules/networking/traffic_manager_profile/versions.tf index d9b6f79..6b6318d 100644 --- a/modules/networking/traffic_manager_profile/versions.tf +++ b/modules/networking/traffic_manager_profile/versions.tf @@ -1,3 +1,3 @@ terraform { - required_version = ">= 0.12" + required_version = ">= 0.13" } diff --git a/modules/networking/virtual_network/main.tf b/modules/networking/virtual_network/main.tf index 88b43af..5956476 100644 --- a/modules/networking/virtual_network/main.tf +++ b/modules/networking/virtual_network/main.tf @@ -5,16 +5,8 @@ module "virtual_network" { suffixes = var.suffixes separator = var.separator != null ? var.separator : "-" max_length = 64 - nb_instances = var.nb_instances -} - -data "null_data_source" "names" { - count = var.nb_instances - inputs = { - result = var.nb_instances > 1 ? regex("^[a-zA-Z0-9]{1}[a-zA-Z0-9-_.]*$", module.virtual_network.results[count.index]) : regex("^[a-zA-Z0-9]{1}[a-zA-Z0-9-_.]*$", module.virtual_network.result) - } } locals { - results = data.null_data_source.names.*.outputs.result + result = regex("^[a-zA-Z0-9]{1}[a-zA-Z0-9-_.]*$", module.virtual_network.result) } \ No newline at end of file diff --git a/modules/networking/virtual_network/outputs.tf b/modules/networking/virtual_network/outputs.tf index ac9fc63..ba68bf4 100644 --- a/modules/networking/virtual_network/outputs.tf +++ b/modules/networking/virtual_network/outputs.tf @@ -1,9 +1,4 @@ output "result" { description = "The generated virtual network name." - value = local.results[0] -} - -output "results" { - description = "The generated virtual network names." - value = local.results + value = local.result } \ No newline at end of file diff --git a/modules/networking/virtual_network/variables.tf b/modules/networking/virtual_network/variables.tf index 853b708..fbb51c0 100644 --- a/modules/networking/virtual_network/variables.tf +++ b/modules/networking/virtual_network/variables.tf @@ -18,8 +18,4 @@ variable "suffixes" { description = "List of suffixes to append at the end of the resource name." type = list(string) default = null -} - -variable "nb_instances" { - default = 1 } \ No newline at end of file diff --git a/modules/networking/virtual_network/versions.tf b/modules/networking/virtual_network/versions.tf index d9b6f79..6b6318d 100644 --- a/modules/networking/virtual_network/versions.tf +++ b/modules/networking/virtual_network/versions.tf @@ -1,3 +1,3 @@ terraform { - required_version = ">= 0.12" + required_version = ">= 0.13" } diff --git a/modules/storage/backup_policy/main.tf b/modules/storage/backup_policy/main.tf index 405b36b..beb4156 100644 --- a/modules/storage/backup_policy/main.tf +++ b/modules/storage/backup_policy/main.tf @@ -5,16 +5,8 @@ module "backup_policy" { suffixes = var.suffixes separator = var.separator != null ? var.separator : "-" max_length = 130 - nb_instances = var.nb_instances -} - -data "null_data_source" "names" { - count = var.nb_instances - inputs = { - result = var.nb_instances > 1 ? regex("^[a-zA-Z0-9]{1}[a-zA-Z0-9-][^-]*$", module.backup_policy.results[count.index]) : regex("^[a-zA-Z0-9]{1}[a-zA-Z0-9-][^-]*$", module.backup_policy.result) - } } locals { - results = data.null_data_source.names.*.outputs.result + result = regex("^[a-zA-Z0-9]{1}[a-zA-Z0-9-][^-]*$", module.backup_policy.result) } \ No newline at end of file diff --git a/modules/storage/backup_policy/outputs.tf b/modules/storage/backup_policy/outputs.tf index 38bb357..71b2b19 100644 --- a/modules/storage/backup_policy/outputs.tf +++ b/modules/storage/backup_policy/outputs.tf @@ -1,9 +1,4 @@ output "result" { description = "The generated backup policy name." - value = local.results[0] -} - -output "results" { - description = "The generated backup policy names." - value = local.results + value = local.result } \ No newline at end of file diff --git a/modules/storage/backup_policy/variables.tf b/modules/storage/backup_policy/variables.tf index ea1ef51..33d489e 100644 --- a/modules/storage/backup_policy/variables.tf +++ b/modules/storage/backup_policy/variables.tf @@ -18,8 +18,4 @@ variable "suffixes" { description = "List of suffixes to append at the end of the resource name." type = list(string) default = null -} - -variable "nb_instances" { - default = 1 } \ No newline at end of file diff --git a/modules/storage/backup_policy/versions.tf b/modules/storage/backup_policy/versions.tf index d9b6f79..6b6318d 100644 --- a/modules/storage/backup_policy/versions.tf +++ b/modules/storage/backup_policy/versions.tf @@ -1,3 +1,3 @@ terraform { - required_version = ">= 0.12" + required_version = ">= 0.13" } diff --git a/modules/storage/container_name/main.tf b/modules/storage/container_name/main.tf index 12ae4e9..cb0c56d 100644 --- a/modules/storage/container_name/main.tf +++ b/modules/storage/container_name/main.tf @@ -5,16 +5,8 @@ module "container_name" { suffixes = var.suffixes separator = var.separator != null ? var.separator : "-" max_length = 63 - nb_instances = var.nb_instances -} - -data "null_data_source" "names" { - count = var.nb_instances - inputs = { - result = var.nb_instances > 1 ? regex("^[a-z0-9]{1}[a-z0-9-]*$", module.container_name.results[count.index]) : regex("^[a-z0-9]{1}[a-z0-9-]*$", module.container_name.result) - } } locals { - results = data.null_data_source.names.*.outputs.result + result = regex("^[a-z0-9]{1}[a-z0-9-]*$", module.container_name.result) } \ No newline at end of file diff --git a/modules/storage/container_name/outputs.tf b/modules/storage/container_name/outputs.tf index f9643fc..e9c50c0 100644 --- a/modules/storage/container_name/outputs.tf +++ b/modules/storage/container_name/outputs.tf @@ -1,9 +1,4 @@ output "result" { description = "The generated storage account container name name." - value = local.results[0] -} - -output "results" { - description = "The generated storage account container name names." - value = local.results + value = local.result } \ No newline at end of file diff --git a/modules/storage/container_name/variables.tf b/modules/storage/container_name/variables.tf index 461779e..6b1d16d 100644 --- a/modules/storage/container_name/variables.tf +++ b/modules/storage/container_name/variables.tf @@ -18,8 +18,4 @@ variable "suffixes" { description = "List of suffixes to append at the end of the resource name." type = list(string) default = null -} - -variable "nb_instances" { - default = 1 } \ No newline at end of file diff --git a/modules/storage/container_name/versions.tf b/modules/storage/container_name/versions.tf index d9b6f79..6b6318d 100644 --- a/modules/storage/container_name/versions.tf +++ b/modules/storage/container_name/versions.tf @@ -1,3 +1,3 @@ terraform { - required_version = ">= 0.12" + required_version = ">= 0.13" } diff --git a/modules/storage/data_lake_storage/main.tf b/modules/storage/data_lake_storage/main.tf index 49b9ecd..82a1eb8 100644 --- a/modules/storage/data_lake_storage/main.tf +++ b/modules/storage/data_lake_storage/main.tf @@ -5,16 +5,8 @@ module "data_lake_storage" { suffixes = var.suffixes separator = var.separator != null ? var.separator : "0" max_length = 24 - nb_instances = var.nb_instances -} - -data "null_data_source" "names" { - count = var.nb_instances - inputs = { - result = var.nb_instances > 1 ? regex("^[a-z0-9]*$", module.data_lake_storage.results[count.index]) : regex("^[a-z0-9]*$", module.data_lake_storage.result) - } } locals { - results = data.null_data_source.names.*.outputs.result + result = regex("^[a-z0-9]*$", module.data_lake_storage.result) } \ No newline at end of file diff --git a/modules/storage/data_lake_storage/outputs.tf b/modules/storage/data_lake_storage/outputs.tf index 1a8ed86..f9d6ace 100644 --- a/modules/storage/data_lake_storage/outputs.tf +++ b/modules/storage/data_lake_storage/outputs.tf @@ -1,9 +1,4 @@ output "result" { description = "The generated data lake storage name name." - value = local.results[0] -} - -output "results" { - description = "The generated data lake storage name names." - value = local.results + value = local.result } \ No newline at end of file diff --git a/modules/storage/data_lake_storage/variables.tf b/modules/storage/data_lake_storage/variables.tf index e74d93d..d19723a 100644 --- a/modules/storage/data_lake_storage/variables.tf +++ b/modules/storage/data_lake_storage/variables.tf @@ -18,8 +18,4 @@ variable "suffixes" { description = "List of suffixes to append at the end of the resource name." type = list(string) default = null -} - -variable "nb_instances" { - default = 1 } \ No newline at end of file diff --git a/modules/storage/data_lake_storage/versions.tf b/modules/storage/data_lake_storage/versions.tf index d9b6f79..6b6318d 100644 --- a/modules/storage/data_lake_storage/versions.tf +++ b/modules/storage/data_lake_storage/versions.tf @@ -1,3 +1,3 @@ terraform { - required_version = ">= 0.12" + required_version = ">= 0.13" } diff --git a/modules/storage/file_share_name/main.tf b/modules/storage/file_share_name/main.tf index 068e085..f0a026e 100644 --- a/modules/storage/file_share_name/main.tf +++ b/modules/storage/file_share_name/main.tf @@ -5,16 +5,8 @@ module "file_share_name" { suffixes = var.suffixes separator = var.separator != null ? var.separator : "-" max_length = 63 - nb_instances = var.nb_instances -} - -data "null_data_source" "names" { - count = var.nb_instances - inputs = { - result = var.nb_instances > 1 ? regex("^[a-z0-9]{1}[a-z0-9-]*$", module.file_share_name.results[count.index]) : regex("^[a-z0-9]{1}[a-z0-9-]*$", module.file_share_name.result) - } } locals { - results = data.null_data_source.names.*.outputs.result + result = regex("^[a-z0-9]{1}[a-z0-9-]*$", module.file_share_name.result) } \ No newline at end of file diff --git a/modules/storage/file_share_name/outputs.tf b/modules/storage/file_share_name/outputs.tf index e2984c8..235ef2a 100644 --- a/modules/storage/file_share_name/outputs.tf +++ b/modules/storage/file_share_name/outputs.tf @@ -1,9 +1,4 @@ output "result" { description = "The generated storage account file share name name." - value = local.results[0] -} - -output "results" { - description = "The generated storage account file share name names." - value = local.results + value = local.result } \ No newline at end of file diff --git a/modules/storage/file_share_name/variables.tf b/modules/storage/file_share_name/variables.tf index 7491495..f0519e0 100644 --- a/modules/storage/file_share_name/variables.tf +++ b/modules/storage/file_share_name/variables.tf @@ -18,8 +18,4 @@ variable "suffixes" { description = "List of suffixes to append at the end of the resource name." type = list(string) default = null -} - -variable "nb_instances" { - default = 1 } \ No newline at end of file diff --git a/modules/storage/file_share_name/versions.tf b/modules/storage/file_share_name/versions.tf index d9b6f79..6b6318d 100644 --- a/modules/storage/file_share_name/versions.tf +++ b/modules/storage/file_share_name/versions.tf @@ -1,3 +1,3 @@ terraform { - required_version = ">= 0.12" + required_version = ">= 0.13" } diff --git a/modules/storage/managed_disk_name/main.tf b/modules/storage/managed_disk_name/main.tf index ddce922..92b1bc3 100644 --- a/modules/storage/managed_disk_name/main.tf +++ b/modules/storage/managed_disk_name/main.tf @@ -5,16 +5,8 @@ module "managed_disk_name" { suffixes = var.suffixes separator = var.separator != null ? var.separator : "-" max_length = 80 - nb_instances = var.nb_instances -} - -data "null_data_source" "names" { - count = var.nb_instances - inputs = { - result = var.nb_instances > 1 ? regex("^[a-zA-Z0-9]{1}[a-zA-Z0-9-_]*$", module.managed_disk_name.results[count.index]) : regex("^[a-zA-Z0-9]{1}[a-zA-Z0-9-_]*$", module.managed_disk_name.result) - } } locals { - results = data.null_data_source.names.*.outputs.result + result = regex("^[a-zA-Z0-9]{1}[a-zA-Z0-9-_]*$", module.managed_disk_name.result) } \ No newline at end of file diff --git a/modules/storage/managed_disk_name/outputs.tf b/modules/storage/managed_disk_name/outputs.tf index 0997d4e..26b8faf 100644 --- a/modules/storage/managed_disk_name/outputs.tf +++ b/modules/storage/managed_disk_name/outputs.tf @@ -1,9 +1,4 @@ output "result" { description = "The generated managed disk name name." - value = local.results[0] -} - -output "results" { - description = "The generated managed disk name names." - value = local.results + value = local.result } \ No newline at end of file diff --git a/modules/storage/managed_disk_name/variables.tf b/modules/storage/managed_disk_name/variables.tf index 88cd6f6..f9e3f39 100644 --- a/modules/storage/managed_disk_name/variables.tf +++ b/modules/storage/managed_disk_name/variables.tf @@ -18,8 +18,4 @@ variable "suffixes" { description = "List of suffixes to append at the end of the resource name." type = list(string) default = null -} - -variable "nb_instances" { - default = 1 } \ No newline at end of file diff --git a/modules/storage/managed_disk_name/versions.tf b/modules/storage/managed_disk_name/versions.tf index d9b6f79..6b6318d 100644 --- a/modules/storage/managed_disk_name/versions.tf +++ b/modules/storage/managed_disk_name/versions.tf @@ -1,3 +1,3 @@ terraform { - required_version = ">= 0.12" + required_version = ">= 0.13" } diff --git a/modules/storage/queue_name/main.tf b/modules/storage/queue_name/main.tf index d4ad9c6..fee253b 100644 --- a/modules/storage/queue_name/main.tf +++ b/modules/storage/queue_name/main.tf @@ -5,16 +5,8 @@ module "queue_name" { suffixes = var.suffixes separator = var.separator != null ? var.separator : "-" max_length = 63 - nb_instances = var.nb_instances -} - -data "null_data_source" "names" { - count = var.nb_instances - inputs = { - result = var.nb_instances > 1 ? regex("^[a-z0-9]{1}[a-z0-9-]*$", module.queue_name.results[count.index]) : regex("^[a-z0-9]{1}[a-z0-9-]*$", module.queue_name.result) - } } locals { - results = data.null_data_source.names.*.outputs.result + result = regex("^[a-z0-9]{1}[a-z0-9-]*$", module.queue_name.result) } \ No newline at end of file diff --git a/modules/storage/queue_name/outputs.tf b/modules/storage/queue_name/outputs.tf index 4c24857..6ea87bb 100644 --- a/modules/storage/queue_name/outputs.tf +++ b/modules/storage/queue_name/outputs.tf @@ -1,9 +1,4 @@ output "result" { description = "The generated storage account queue name name." - value = local.results[0] -} - -output "results" { - description = "The generated storage account queue name names." - value = local.results + value = local.result } \ No newline at end of file diff --git a/modules/storage/queue_name/variables.tf b/modules/storage/queue_name/variables.tf index 924c8d3..6813167 100644 --- a/modules/storage/queue_name/variables.tf +++ b/modules/storage/queue_name/variables.tf @@ -18,8 +18,4 @@ variable "suffixes" { description = "List of suffixes to append at the end of the resource name." type = list(string) default = null -} - -variable "nb_instances" { - default = 1 } \ No newline at end of file diff --git a/modules/storage/queue_name/versions.tf b/modules/storage/queue_name/versions.tf index d9b6f79..6b6318d 100644 --- a/modules/storage/queue_name/versions.tf +++ b/modules/storage/queue_name/versions.tf @@ -1,3 +1,3 @@ terraform { - required_version = ">= 0.12" + required_version = ">= 0.13" } diff --git a/modules/storage/recovery_services_vault/main.tf b/modules/storage/recovery_services_vault/main.tf index 643b5e8..7352359 100644 --- a/modules/storage/recovery_services_vault/main.tf +++ b/modules/storage/recovery_services_vault/main.tf @@ -5,16 +5,8 @@ module "recovery_services_vault" { suffixes = var.suffixes separator = var.separator != null ? var.separator : "-" max_length = 50 - nb_instances = var.nb_instances -} - -data "null_data_source" "names" { - count = var.nb_instances - inputs = { - result = var.nb_instances > 1 ? regex("^[a-zA-Z0-9]{1}[a-zA-Z0-9-]*$", module.recovery_services_vault.results[count.index]) : regex("^[a-zA-Z0-9]{1}[a-zA-Z0-9-]*$", module.recovery_services_vault.result) - } } locals { - results = data.null_data_source.names.*.outputs.result + result = regex("^[a-zA-Z0-9]{1}[a-zA-Z0-9-]*$", module.recovery_services_vault.result) } \ No newline at end of file diff --git a/modules/storage/recovery_services_vault/outputs.tf b/modules/storage/recovery_services_vault/outputs.tf index 43910d0..72b287f 100644 --- a/modules/storage/recovery_services_vault/outputs.tf +++ b/modules/storage/recovery_services_vault/outputs.tf @@ -1,9 +1,4 @@ output "result" { description = "The generated recovery services vault name." - value = local.results[0] -} - -output "results" { - description = "The generated recovery services vault names." - value = local.results + value = local.result } \ No newline at end of file diff --git a/modules/storage/recovery_services_vault/variables.tf b/modules/storage/recovery_services_vault/variables.tf index d4f92a8..678a382 100644 --- a/modules/storage/recovery_services_vault/variables.tf +++ b/modules/storage/recovery_services_vault/variables.tf @@ -18,8 +18,4 @@ variable "suffixes" { description = "List of suffixes to append at the end of the resource name." type = list(string) default = null -} - -variable "nb_instances" { - default = 1 } \ No newline at end of file diff --git a/modules/storage/recovery_services_vault/versions.tf b/modules/storage/recovery_services_vault/versions.tf index d9b6f79..6b6318d 100644 --- a/modules/storage/recovery_services_vault/versions.tf +++ b/modules/storage/recovery_services_vault/versions.tf @@ -1,3 +1,3 @@ terraform { - required_version = ">= 0.12" + required_version = ">= 0.13" } diff --git a/modules/storage/storage_account/main.tf b/modules/storage/storage_account/main.tf index 91d14a1..f28ba0f 100644 --- a/modules/storage/storage_account/main.tf +++ b/modules/storage/storage_account/main.tf @@ -5,16 +5,8 @@ module "storage_account" { suffixes = var.suffixes separator = var.separator != null ? var.separator : "0" max_length = 24 - nb_instances = var.nb_instances -} - -data "null_data_source" "names" { - count = var.nb_instances - inputs = { - result = var.nb_instances > 1 ? regex("^[a-z0-9]*$", module.storage_account.results[count.index]) : regex("^[a-z0-9]*$", module.storage_account.result) - } } locals { - results = data.null_data_source.names.*.outputs.result + result = regex("^[a-z0-9]*$", module.storage_account.result) } \ No newline at end of file diff --git a/modules/storage/storage_account/outputs.tf b/modules/storage/storage_account/outputs.tf index 3b69127..e8a5329 100644 --- a/modules/storage/storage_account/outputs.tf +++ b/modules/storage/storage_account/outputs.tf @@ -1,9 +1,4 @@ output "result" { description = "The generated storage account name." - value = local.results[0] -} - -output "results" { - description = "The generated storage account names." - value = local.results + value = local.result } \ No newline at end of file diff --git a/modules/storage/storage_account/variables.tf b/modules/storage/storage_account/variables.tf index 2233443..e370291 100644 --- a/modules/storage/storage_account/variables.tf +++ b/modules/storage/storage_account/variables.tf @@ -18,8 +18,4 @@ variable "suffixes" { description = "List of suffixes to append at the end of the resource name." type = list(string) default = null -} - -variable "nb_instances" { - default = 1 } \ No newline at end of file diff --git a/modules/storage/storage_account/versions.tf b/modules/storage/storage_account/versions.tf index d9b6f79..6b6318d 100644 --- a/modules/storage/storage_account/versions.tf +++ b/modules/storage/storage_account/versions.tf @@ -1,3 +1,3 @@ terraform { - required_version = ">= 0.12" + required_version = ">= 0.13" } diff --git a/modules/storage/table_name/main.tf b/modules/storage/table_name/main.tf index dbb49e4..517aac3 100644 --- a/modules/storage/table_name/main.tf +++ b/modules/storage/table_name/main.tf @@ -5,16 +5,8 @@ module "table_name" { suffixes = var.suffixes separator = var.separator != null ? var.separator : "0" max_length = 63 - nb_instances = var.nb_instances -} - -data "null_data_source" "names" { - count = var.nb_instances - inputs = { - result = var.nb_instances > 1 ? regex("^[a-zA-Z0-9]*$", module.table_name.results[count.index]) : regex("^[a-zA-Z0-9]*$", module.table_name.result) - } } locals { - results = data.null_data_source.names.*.outputs.result + result = regex("^[a-zA-Z0-9]*$", module.table_name.result) } \ No newline at end of file diff --git a/modules/storage/table_name/outputs.tf b/modules/storage/table_name/outputs.tf index f2385cb..ce09875 100644 --- a/modules/storage/table_name/outputs.tf +++ b/modules/storage/table_name/outputs.tf @@ -1,9 +1,4 @@ output "result" { description = "The generated storage account table name name." - value = local.results[0] -} - -output "results" { - description = "The generated storage account table name names." - value = local.results + value = local.result } \ No newline at end of file diff --git a/modules/storage/table_name/variables.tf b/modules/storage/table_name/variables.tf index 5752b08..a09e7d3 100644 --- a/modules/storage/table_name/variables.tf +++ b/modules/storage/table_name/variables.tf @@ -18,8 +18,4 @@ variable "suffixes" { description = "List of suffixes to append at the end of the resource name." type = list(string) default = null -} - -variable "nb_instances" { - default = 1 } \ No newline at end of file diff --git a/modules/storage/table_name/versions.tf b/modules/storage/table_name/versions.tf index d9b6f79..6b6318d 100644 --- a/modules/storage/table_name/versions.tf +++ b/modules/storage/table_name/versions.tf @@ -1,3 +1,3 @@ terraform { - required_version = ">= 0.12" + required_version = ">= 0.13" } diff --git a/modules/web/slot_name/main.tf b/modules/web/slot_name/main.tf index 7b84233..febd832 100644 --- a/modules/web/slot_name/main.tf +++ b/modules/web/slot_name/main.tf @@ -5,16 +5,8 @@ module "slot_name" { suffixes = var.suffixes separator = var.separator != null ? var.separator : "-" max_length = 59 - nb_instances = var.nb_instances -} - -data "null_data_source" "names" { - count = var.nb_instances - inputs = { - result = var.nb_instances > 1 ? regex("^[a-zA-Z0-9]{1}[a-zA-Z0-9-]*$", module.slot_name.results[count.index]) : regex("^[a-zA-Z0-9]{1}[a-zA-Z0-9-]*$", module.slot_name.result) - } } locals { - results = data.null_data_source.names.*.outputs.result + result = regex("^[a-zA-Z0-9]{1}[a-zA-Z0-9-]*$", module.slot_name.result) } \ No newline at end of file diff --git a/modules/web/slot_name/outputs.tf b/modules/web/slot_name/outputs.tf index 2d5b83a..8aa43b1 100644 --- a/modules/web/slot_name/outputs.tf +++ b/modules/web/slot_name/outputs.tf @@ -1,9 +1,4 @@ output "result" { description = "The generated slot name name." - value = local.results[0] -} - -output "results" { - description = "The generated slot name names." - value = local.results + value = local.result } \ No newline at end of file diff --git a/modules/web/slot_name/variables.tf b/modules/web/slot_name/variables.tf index 4de6bd6..95deb21 100644 --- a/modules/web/slot_name/variables.tf +++ b/modules/web/slot_name/variables.tf @@ -18,8 +18,4 @@ variable "suffixes" { description = "List of suffixes to append at the end of the resource name." type = list(string) default = null -} - -variable "nb_instances" { - default = 1 } \ No newline at end of file diff --git a/modules/web/slot_name/versions.tf b/modules/web/slot_name/versions.tf index d9b6f79..6b6318d 100644 --- a/modules/web/slot_name/versions.tf +++ b/modules/web/slot_name/versions.tf @@ -1,3 +1,3 @@ terraform { - required_version = ">= 0.12" + required_version = ">= 0.13" } diff --git a/modules/web/web_app/main.tf b/modules/web/web_app/main.tf index bca41dc..defa6eb 100644 --- a/modules/web/web_app/main.tf +++ b/modules/web/web_app/main.tf @@ -5,16 +5,8 @@ module "web_app" { suffixes = var.suffixes separator = var.separator != null ? var.separator : "-" max_length = 60 - nb_instances = var.nb_instances -} - -data "null_data_source" "names" { - count = var.nb_instances - inputs = { - result = var.nb_instances > 1 ? regex("^[a-zA-Z0-9]{1}[a-zA-Z0-9-]*$", module.web_app.results[count.index]) : regex("^[a-zA-Z0-9]{1}[a-zA-Z0-9-]*$", module.web_app.result) - } } locals { - results = data.null_data_source.names.*.outputs.result + result = regex("^[a-zA-Z0-9]{1}[a-zA-Z0-9-]*$", module.web_app.result) } \ No newline at end of file diff --git a/modules/web/web_app/outputs.tf b/modules/web/web_app/outputs.tf index c3e0fb7..ab1e5da 100644 --- a/modules/web/web_app/outputs.tf +++ b/modules/web/web_app/outputs.tf @@ -1,9 +1,4 @@ output "result" { description = "The generated web app name." - value = local.results[0] -} - -output "results" { - description = "The generated web app names." - value = local.results + value = local.result } \ No newline at end of file diff --git a/modules/web/web_app/variables.tf b/modules/web/web_app/variables.tf index 02a8906..19fff1f 100644 --- a/modules/web/web_app/variables.tf +++ b/modules/web/web_app/variables.tf @@ -18,8 +18,4 @@ variable "suffixes" { description = "List of suffixes to append at the end of the resource name." type = list(string) default = null -} - -variable "nb_instances" { - default = 1 } \ No newline at end of file diff --git a/modules/web/web_app/versions.tf b/modules/web/web_app/versions.tf index d9b6f79..6b6318d 100644 --- a/modules/web/web_app/versions.tf +++ b/modules/web/web_app/versions.tf @@ -1,3 +1,3 @@ terraform { - required_version = ">= 0.12" + required_version = ">= 0.13" } diff --git a/modules/web/web_app_name/main.tf b/modules/web/web_app_name/main.tf index c1fa9d7..4fa9196 100644 --- a/modules/web/web_app_name/main.tf +++ b/modules/web/web_app_name/main.tf @@ -5,16 +5,8 @@ module "web_app_name" { suffixes = var.suffixes separator = var.separator != null ? var.separator : "-" max_length = 24 - nb_instances = var.nb_instances -} - -data "null_data_source" "names" { - count = var.nb_instances - inputs = { - result = var.nb_instances > 1 ? regex("^[a-zA-Z0-9]{1}[a-zA-Z0-9-]*$", module.web_app_name.results[count.index]) : regex("^[a-zA-Z0-9]{1}[a-zA-Z0-9-]*$", module.web_app_name.result) - } } locals { - results = data.null_data_source.names.*.outputs.result + result = regex("^[a-zA-Z0-9]{1}[a-zA-Z0-9-]*$", module.web_app_name.result) } \ No newline at end of file diff --git a/modules/web/web_app_name/outputs.tf b/modules/web/web_app_name/outputs.tf index 605504b..ab0c0c9 100644 --- a/modules/web/web_app_name/outputs.tf +++ b/modules/web/web_app_name/outputs.tf @@ -1,9 +1,4 @@ output "result" { description = "The generated web app name name." - value = local.results[0] -} - -output "results" { - description = "The generated web app name names." - value = local.results + value = local.result } \ No newline at end of file diff --git a/modules/web/web_app_name/variables.tf b/modules/web/web_app_name/variables.tf index e6be923..b9368d3 100644 --- a/modules/web/web_app_name/variables.tf +++ b/modules/web/web_app_name/variables.tf @@ -18,8 +18,4 @@ variable "suffixes" { description = "List of suffixes to append at the end of the resource name." type = list(string) default = null -} - -variable "nb_instances" { - default = 1 } \ No newline at end of file diff --git a/modules/web/web_app_name/versions.tf b/modules/web/web_app_name/versions.tf index d9b6f79..6b6318d 100644 --- a/modules/web/web_app_name/versions.tf +++ b/modules/web/web_app_name/versions.tf @@ -1,3 +1,3 @@ terraform { - required_version = ">= 0.12" + required_version = ">= 0.13" } diff --git a/modules/web/web_job_name/main.tf b/modules/web/web_job_name/main.tf index f055714..5a6f813 100644 --- a/modules/web/web_job_name/main.tf +++ b/modules/web/web_job_name/main.tf @@ -5,16 +5,8 @@ module "web_job_name" { suffixes = var.suffixes separator = var.separator != null ? var.separator : "-" max_length = 29 - nb_instances = var.nb_instances -} - -data "null_data_source" "names" { - count = var.nb_instances - inputs = { - result = var.nb_instances > 1 ? regex("^[a-zA-Z0-9]{1}[a-zA-Z0-9-]*$", module.web_job_name.results[count.index]) : regex("^[a-zA-Z0-9]{1}[a-zA-Z0-9-]*$", module.web_job_name.result) - } } locals { - results = data.null_data_source.names.*.outputs.result + result = regex("^[a-zA-Z0-9]{1}[a-zA-Z0-9-]*$", module.web_job_name.result) } \ No newline at end of file diff --git a/modules/web/web_job_name/outputs.tf b/modules/web/web_job_name/outputs.tf index f9e8643..98dd4da 100644 --- a/modules/web/web_job_name/outputs.tf +++ b/modules/web/web_job_name/outputs.tf @@ -1,9 +1,4 @@ output "result" { description = "The generated web job name name." - value = local.results[0] -} - -output "results" { - description = "The generated web job name names." - value = local.results + value = local.result } \ No newline at end of file diff --git a/modules/web/web_job_name/variables.tf b/modules/web/web_job_name/variables.tf index d7269cf..d10a2c0 100644 --- a/modules/web/web_job_name/variables.tf +++ b/modules/web/web_job_name/variables.tf @@ -18,8 +18,4 @@ variable "suffixes" { description = "List of suffixes to append at the end of the resource name." type = list(string) default = null -} - -variable "nb_instances" { - default = 1 } \ No newline at end of file diff --git a/modules/web/web_job_name/versions.tf b/modules/web/web_job_name/versions.tf index d9b6f79..6b6318d 100644 --- a/modules/web/web_job_name/versions.tf +++ b/modules/web/web_job_name/versions.tf @@ -1,3 +1,3 @@ terraform { - required_version = ">= 0.12" + required_version = ">= 0.13" } diff --git a/outputs.tf b/outputs.tf index f5b34f7..e426677 100644 --- a/outputs.tf +++ b/outputs.tf @@ -1,9 +1,4 @@ output "result" { description = "The generated resource name." - value = local.results[0] -} - -output "results" { - description = "The generated resource names." - value = local.results + value = local.result } diff --git a/templating/package-lock.json b/templating/package-lock.json index b03946d..0c1acb2 100644 --- a/templating/package-lock.json +++ b/templating/package-lock.json @@ -1,8 +1,29 @@ { "name": "templating", "version": "1.0.0", - "lockfileVersion": 1, + "lockfileVersion": 2, "requires": true, + "packages": { + "": { + "version": "1.0.0", + "license": "ISC", + "devDependencies": { + "mustache": "^3.1.0" + } + }, + "node_modules/mustache": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/mustache/-/mustache-3.1.0.tgz", + "integrity": "sha512-3Bxq1R5LBZp7fbFPZzFe5WN4s0q3+gxZaZuZVY+QctYJiCiVgXHOTIC0/HgZuOPFt/6BQcx5u0H2CUOxT/RoGQ==", + "dev": true, + "bin": { + "mustache": "bin/mustache" + }, + "engines": { + "npm": ">=1.4.0" + } + } + }, "dependencies": { "mustache": { "version": "3.1.0", diff --git a/templating/templates/main.tf.mustache b/templating/templates/main.tf.mustache index c06a2b2..01c7dce 100644 --- a/templating/templates/main.tf.mustache +++ b/templating/templates/main.tf.mustache @@ -5,16 +5,8 @@ module "{{name}}" { suffixes = var.suffixes separator = var.separator != null ? var.separator : "{{{separator}}}" max_length = {{max_length}} - nb_instances = var.nb_instances -} - -data "null_data_source" "names" { - count = var.nb_instances - inputs = { - result = var.nb_instances > 1 ? regex("{{{regex}}}", module.{{name}}.results[count.index]) : regex("{{{regex}}}", module.{{name}}.result) - } } locals { - results = data.null_data_source.names.*.outputs.result + result = regex("{{{regex}}}", module.{{name}}.result) } \ No newline at end of file diff --git a/templating/templates/outputs.tf.mustache b/templating/templates/outputs.tf.mustache index 9cb436e..17bceac 100644 --- a/templating/templates/outputs.tf.mustache +++ b/templating/templates/outputs.tf.mustache @@ -1,9 +1,4 @@ output "result" { description = "The generated {{{long_name}}} name." - value = local.results[0] -} - -output "results" { - description = "The generated {{{long_name}}} names." - value = local.results + value = local.result } \ No newline at end of file diff --git a/templating/templates/variables.tf.mustache b/templating/templates/variables.tf.mustache index 04483ae..06f71b5 100644 --- a/templating/templates/variables.tf.mustache +++ b/templating/templates/variables.tf.mustache @@ -18,8 +18,4 @@ variable "suffixes" { description = "List of suffixes to append at the end of the resource name." type = list(string) default = null -} - -variable "nb_instances" { - default = 1 } \ No newline at end of file diff --git a/templating/templates/versions.tf.mustache b/templating/templates/versions.tf.mustache index d9b6f79..6b6318d 100644 --- a/templating/templates/versions.tf.mustache +++ b/templating/templates/versions.tf.mustache @@ -1,3 +1,3 @@ terraform { - required_version = ">= 0.12" + required_version = ">= 0.13" } diff --git a/variables.tf b/variables.tf index 8d275d5..91dea9d 100644 --- a/variables.tf +++ b/variables.tf @@ -3,10 +3,6 @@ variable "name" { type = string } -variable "nb_instances" { - default = 1 -} - variable "prefixes" { description = "List of prefixes to append in front of the resource name." type = list(string) diff --git a/versions.tf b/versions.tf index ac97c6a..2606a5a 100644 --- a/versions.tf +++ b/versions.tf @@ -1,4 +1,4 @@ terraform { - required_version = ">= 0.12" + required_version = ">= 0.13" }