Azure / ALZ-PowerShell-Module

The Azure Landing Zones Accelerators PowerShell module
https://www.powershellgallery.com/packages/ALZ/
MIT License
79 stars 39 forks source link

Bug: Bool, List, and Set variables are converted to string #196

Closed sdeguchi closed 1 month ago

sdeguchi commented 2 months ago

Is there an existing issue for this?

Infrastrcuture as Code Type? (Required)

terraform

Module Versions (Required)

ALZ PowerShell Module: 3.0.4 Accelerator Bootstrap Modules: 3.1.3 Terraform Starter Modules: microsoft_cloud_for_financial_services

Input arguments of the ALZ-PowerShell-Module (Optional)

No response

Debug Output/Panic Output (Optional)

No response

Expected Behaviour (Required)

Actual Behaviour (Required)

List/Set variables do not allow you to use the default values and are getting converted to string. Boolean variables are getting converted to string in starter-cache.json and bootstrap-cache.json, and the default values always end up in the terraform.tfvars and override.tvars.json

variable "allowed_locations" { type = set(string) default = [] description = "Full list of Azure regions allowed by policy where resources can be deployed that should include at least the deployment location." }

variable "allowed_locations_for_confidential_computing" { type = list(string) default = [] description = "Full list of Azure regions allowed by policy where Confidential computing resources can be deployed. This may be a completely different list from allowed_locations." }

starter-cache.json: image

terraform.tfvars.json: image

bootstrap-cache.json: image

override.tfvars.json: image

Steps to Reproduce (Optional)

Run the Deploy-Accelerator command without a -inputs parameter and populate a bool, set or list variable through the UI.

Important Factoids (Optional)

No response

References (Optional)

No response

jaredfholgate commented 1 month ago

We now just use the types supplied in the config file, so hopefully this issue has gone away with the removal of the UI input support.