diff --git a/src/ALZ/Private/Config-Helpers/Convert-ParametersToInputConfig.ps1 b/src/ALZ/Private/Config-Helpers/Convert-ParametersToInputConfig.ps1 index 340c7dd..4ba8458 100644 --- a/src/ALZ/Private/Config-Helpers/Convert-ParametersToInputConfig.ps1 +++ b/src/ALZ/Private/Config-Helpers/Convert-ParametersToInputConfig.ps1 @@ -15,8 +15,8 @@ function Convert-ParametersToInputConfig { Write-Verbose "Alias $parameterAlias exists in input config, renaming..." $configItem = $inputConfig.PSObject.Properties | Where-Object { $_.Name -eq $parameterAlias } $inputConfig | Add-Member -NotePropertyName $parameterKey -NotePropertyValue @{ - Value = $configItem.Value - Source = "parameter" + Value = $configItem.Value.Value + Source = $configItem.Value.Source } $inputConfig.PSObject.Properties.Remove($configItem.Name) continue diff --git a/src/ALZ/Private/Config-Helpers/Remove-TerraformMetaFileSet.ps1 b/src/ALZ/Private/Config-Helpers/Remove-TerraformMetaFileSet.ps1 index 0bc1498..d2f0d03 100644 --- a/src/ALZ/Private/Config-Helpers/Remove-TerraformMetaFileSet.ps1 +++ b/src/ALZ/Private/Config-Helpers/Remove-TerraformMetaFileSet.ps1 @@ -11,7 +11,8 @@ function Remove-TerraformMetaFileSet { "terraform.tfvars", ".terraform.lock.hcl", "examples", - "yaml.tf" + "yaml.tf", + ".alzlib" ), [Parameter(Mandatory = $false)] [switch]$writeVerboseLogs diff --git a/src/ALZ/Private/Config-Helpers/Request-SpecialInput.ps1 b/src/ALZ/Private/Config-Helpers/Request-SpecialInput.ps1 index 13957b9..b6009b4 100644 --- a/src/ALZ/Private/Config-Helpers/Request-SpecialInput.ps1 +++ b/src/ALZ/Private/Config-Helpers/Request-SpecialInput.ps1 @@ -42,7 +42,7 @@ function Request-SpecialInput { } if($type -eq "starter") { - foreach($starter in $starterConfig.starter_modules.PsObject.Properties) { + foreach($starter in $starterConfig.starter_modules.Value.PsObject.Properties) { if($starter.Name -eq $starterPipelineFolder) { continue } diff --git a/src/ALZ/Private/Deploy-Accelerator-Helpers/Get-BootstrapAndStarterConfig.ps1 b/src/ALZ/Private/Deploy-Accelerator-Helpers/Get-BootstrapAndStarterConfig.ps1 index 7011e58..041a985 100644 --- a/src/ALZ/Private/Deploy-Accelerator-Helpers/Get-BootstrapAndStarterConfig.ps1 +++ b/src/ALZ/Private/Deploy-Accelerator-Helpers/Get-BootstrapAndStarterConfig.ps1 @@ -29,7 +29,7 @@ function Get-BootstrapAndStarterConfig { $bootstrapConfigFullPath = Join-Path $bootstrapPath $bootstrapConfigPath Write-Verbose "Bootstrap config path $bootstrapConfigFullPath" $bootstrapConfig = Get-ALZConfig -configFilePath $bootstrapConfigFullPath - $validationConfig = $bootstrapConfig.validators + $validationConfig = $bootstrapConfig.validators.Value # Get the supported regions and availability zones Write-Verbose "Getting Supported Regions and Availability Zones with Terraform" @@ -40,7 +40,7 @@ function Get-BootstrapAndStarterConfig { $azureLocationValidator.AllowedValues.Values = $regionsAndZones.supportedRegions # Get the available bootstrap modules - $bootstrapModules = $bootstrapConfig.bootstrap_modules + $bootstrapModules = $bootstrapConfig.bootstrap_modules.Value # Get the bootstrap details and validate it exists (use alias for legacy values) $bootstrapDetails = $bootstrapModules.PsObject.Properties | Where-Object { $_.Name -eq $bootstrap -or $bootstrap -in $_.Value.aliases } @@ -55,9 +55,9 @@ function Get-BootstrapAndStarterConfig { if($null -ne $bootstrapStarterModule) { # If the bootstrap has starter modules, get the details and url $hasStarterModule = $true - $starterModules = $bootstrapConfig.PSObject.Properties | Where-Object { $_.Name -eq "starter_modules" } + $starterModules = $bootstrapConfig.starter_modules.Value $starterModuleType = $bootstrapStarterModule.Value - $starterModuleDetails = $starterModules.Value.PSObject.Properties | Where-Object { $_.Name -eq $starterModuleType } + $starterModuleDetails = $starterModules.PSObject.Properties | Where-Object { $_.Name -eq $starterModuleType } if($null -eq $starterModuleDetails) { Write-InformationColored "The starter modules '$($starterModuleType)' for the bootstrap type '$bootstrap' that you have selected does not exist. This could be an issue with your custom configuration, please check and try again..." -ForegroundColor Red -InformationAction Continue throw diff --git a/src/ALZ/Private/Deploy-Accelerator-Helpers/New-Bootstrap.ps1 b/src/ALZ/Private/Deploy-Accelerator-Helpers/New-Bootstrap.ps1 index 57c4efc..fd5324f 100644 --- a/src/ALZ/Private/Deploy-Accelerator-Helpers/New-Bootstrap.ps1 +++ b/src/ALZ/Private/Deploy-Accelerator-Helpers/New-Bootstrap.ps1 @@ -86,7 +86,7 @@ function New-Bootstrap { } } - $chosenStarterConfig = $starterConfig.starter_modules.$($inputConfig.starter_module_name.Value) + $chosenStarterConfig = $starterConfig.starter_modules.Value.$($inputConfig.starter_module_name.Value) Write-Verbose "Selected Starter: $($inputConfig.starter_module_name.Value))" $starterModulePath = (Resolve-Path (Join-Path -Path $starterPath -ChildPath $chosenStarterConfig.location)).Path @@ -140,7 +140,7 @@ function New-Bootstrap { } if($iac -eq "bicep") { - $starterParameters = Convert-BicepConfigToInputConfig -bicepConfig $starterConfig.starter_modules.$($inputConfig.starter_module_name.Value) -validators $validationConfig + $starterParameters = Convert-BicepConfigToInputConfig -bicepConfig $starterConfig.starter_modules.Value.$($inputConfig.starter_module_name.Value) -validators $validationConfig } } @@ -229,22 +229,22 @@ function New-Bootstrap { } if($iac -eq "bicep") { - Copy-ParametersFileCollection -starterPath $starterModulePath -configFiles $starterConfig.starter_modules.$($inputConfig.starter_module_name.Value).deployment_files + Copy-ParametersFileCollection -starterPath $starterModulePath -configFiles $starterConfig.starter_modules.Value.$($inputConfig.starter_module_name.Value).deployment_files Set-ComputedConfiguration -configuration $starterConfiguration Edit-ALZConfigurationFilesInPlace -alzEnvironmentDestination $starterModulePath -configuration $starterConfiguration Write-JsonFile -jsonFilePath $starterBicepVarsPath -configuration $starterConfiguration # Remove unrequired files - $foldersOrFilesToRetain = $starterConfig.starter_modules.$($inputConfig.starter_module_name.Value).folders_or_files_to_retain + $foldersOrFilesToRetain = $starterConfig.starter_modules.Value.$($inputConfig.starter_module_name.Value).folders_or_files_to_retain $foldersOrFilesToRetain += "parameters.json" $foldersOrFilesToRetain += "config" $foldersOrFilesToRetain += "starter-cache.json" - foreach($deployment_file in $starterConfig.starter_modules.$($inputConfig.starter_module_name.Value).deployment_files) { + foreach($deployment_file in $starterConfig.starter_modules.Value.$($inputConfig.starter_module_name.Value).deployment_files) { $foldersOrFilesToRetain += $deployment_file.templateParametersSourceFilePath } - $subFoldersOrFilesToRemove = $starterConfig.starter_modules.$($inputConfig.starter_module_name.Value).subfolders_or_files_to_remove + $subFoldersOrFilesToRemove = $starterConfig.starter_modules.Value.$($inputConfig.starter_module_name.Value).subfolders_or_files_to_remove Remove-UnrequiredFileSet -path $starterModulePath -foldersOrFilesToRetain $foldersOrFilesToRetain -subFoldersOrFilesToRemove $subFoldersOrFilesToRemove -writeVerboseLogs:$writeVerboseLogs.IsPresent }