Skip to content

Commit 4fe6f72

Browse files
committed
jared pedant changes
1 parent 13705e7 commit 4fe6f72

File tree

11 files changed

+22
-229
lines changed

11 files changed

+22
-229
lines changed

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,8 @@ body:
4646
description: Which starter module are you using?
4747
multiple: false
4848
options:
49-
- bicep - complete
49+
- bicep - platform_landing_zone
5050
- terraform - platform_landing_zone
51-
- terraform - microsoft_cloud_for_sovereignty
52-
- terraform - microsoft_cloud_for_financial_services
5351
- other
5452
- not relevant
5553
validations:

.github/ISSUE_TEMPLATE/feature_request.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,8 @@ body:
3333
description: Which starter module are you using?
3434
multiple: false
3535
options:
36-
- bicep - complete
36+
- bicep - platform_landing_zone
3737
- terraform - platform_landing_zone
38-
- terraform - microsoft_cloud_for_sovereignty
39-
- terraform - microsoft_cloud_for_financial_services
4038
- other
4139
- not relevant
4240
validations:

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ This repository contains the PowerShell module and documentation for the Azure l
1515
The accelerators support multiple Infrastructure as Code approaches:
1616

1717
- **terraform**: Terraform-based Azure Landing Zones
18-
- **bicep**: Bicep-based Azure Landing Zones using the traditional [ALZ-Bicep](https://github.com/Azure/ALZ-Bicep) framework
19-
- **bicep-avm**: Bicep-based Azure Landing Zones using the new [alz-bicep-accelerator](https://github.com/Azure/alz-bicep-accelerator) framework built on Azure Verified Modules
18+
- **bicep**: Bicep-based Azure Landing Zones using the new [alz-bicep-accelerator](https://github.com/Azure/alz-bicep-accelerator) framework built on Azure Verified Modules
19+
- **bicep-classic**: Bicep-based Azure Landing Zones using the classic [ALZ-Bicep](https://github.com/Azure/ALZ-Bicep) framework
2020

2121
It is designed to be used as a template to enable you to get started quickly deploying ALZ with any of these approaches.
2222

src/ALZ/Private/Config-Helpers/Convert-BicepConfigToInputConfig.ps1

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ function Convert-BicepConfigToInputConfig {
44
[Parameter(Mandatory = $false)]
55
[PSCustomObject]$bicepConfig,
66

7-
[Parameter(Mandatory = $false)]
8-
[PSCustomObject]$validators,
9-
107
[Parameter(Mandatory = $false)]
118
[PSCustomObject]$appendToObject = $null
129
)
@@ -18,8 +15,6 @@ function Convert-BicepConfigToInputConfig {
1815
$configItems = $appendToObject
1916
}
2017

21-
Write-Verbose $validators
22-
2318
foreach ($variable in $bicepConfig.inputs.PSObject.Properties) {
2419
Write-Verbose "Parsing variable $($variable.Name)"
2520
$description = $variable.Value.description
@@ -45,20 +40,6 @@ function Convert-BicepConfigToInputConfig {
4540
$configItem | Add-Member -NotePropertyName "DefaultValue" -NotePropertyValue $defaultValue
4641
}
4742

48-
if ($variable.Value.PSObject.Properties.Name -contains "validation") {
49-
$validationType = $variable.Value.validation
50-
$validator = $validators.PSObject.Properties[$validationType].Value
51-
$description = "$description ($($validator.Description))"
52-
Write-Verbose "Adding $($variable.Value.validation) validation for $($variable.Name). Validation type: $($validator.Type)"
53-
if ($validator.Type -eq "AllowedValues") {
54-
$configItem | Add-Member -NotePropertyName "AllowedValues" -NotePropertyValue $validator.AllowedValues
55-
}
56-
if ($validator.Type -eq "Valid") {
57-
$configItem | Add-Member -NotePropertyName "Valid" -NotePropertyValue $validator.Valid
58-
}
59-
$configItem | Add-Member -NotePropertyName "Validator" -NotePropertyValue $validationType
60-
}
61-
6243
if ($variable.Value.PSObject.Properties.Name -contains "targets") {
6344
$configItem | Add-Member -NotePropertyName "targets" -NotePropertyValue $variable.Value.targets
6445
}

src/ALZ/Private/Config-Helpers/Convert-HCLVariablesToInputConfig.ps1

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@ function Convert-HCLVariablesToInputConfig {
77
[Parameter(Mandatory = $false)]
88
[string] $hclParserToolPath,
99

10-
[Parameter(Mandatory = $false)]
11-
[PSCustomObject]$validators,
12-
1310
[Parameter(Mandatory = $false)]
1411
[PSCustomObject]$appendToObject = $null
1512
)
@@ -32,19 +29,6 @@ function Convert-HCLVariablesToInputConfig {
3229
foreach ($variable in $terraformVariables.variable.PSObject.Properties) {
3330
if ($variable.Value[0].PSObject.Properties.Name -contains "description") {
3431
$description = $variable.Value[0].description
35-
$validationTypeSplit = $description -split "\|"
36-
37-
$hasValidation = $false
38-
39-
if ($validationTypeSplit.Length -gt 1) {
40-
$description = $validationTypeSplit[0].Trim()
41-
}
42-
43-
if ($validationTypeSplit.Length -eq 2) {
44-
$splitItem = $validationTypeSplit[1].Trim()
45-
$validationType = $splitItem
46-
$hasValidation = $true
47-
}
4832
}
4933

5034
$configItem = [PSCustomObject]@{}
@@ -55,18 +39,6 @@ function Convert-HCLVariablesToInputConfig {
5539
$configItem | Add-Member -NotePropertyName "DefaultValue" -NotePropertyValue $variable.Value[0].default
5640
}
5741

58-
if ($hasValidation) {
59-
$validator = $validators.PSObject.Properties[$validationType].Value
60-
$description = "$description ($($validator.Description))"
61-
if ($validator.Type -eq "AllowedValues") {
62-
$configItem | Add-Member -NotePropertyName "AllowedValues" -NotePropertyValue $validator.AllowedValues
63-
}
64-
if ($validator.Type -eq "Valid") {
65-
$configItem | Add-Member -NotePropertyName "Valid" -NotePropertyValue $validator.Valid
66-
}
67-
$configItem | Add-Member -NotePropertyName "Validator" -NotePropertyValue $validationType
68-
}
69-
7042
$configItem | Add-Member -NotePropertyName "Description" -NotePropertyValue $description
7143

7244
Write-Verbose "Adding variable $($variable.Name) to the configuration..."

src/ALZ/Private/Config-Helpers/Request-SpecialInput.ps1

Lines changed: 0 additions & 130 deletions
This file was deleted.

src/ALZ/Private/Config-Helpers/Set-Config.ps1

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,6 @@ function Set-Config {
143143
continue
144144
}
145145

146-
# TODO: Add validation here...
147-
148146
# Use the default value if no input config is supplied
149147
if($configurationValue.Value.PSObject.Properties.Name -match "DefaultValue") {
150148
Write-Verbose "Input not supplied, so using default value of $($configurationValue.Value.DefaultValue) for $($configurationValue.Name)"

src/ALZ/Private/Deploy-Accelerator-Helpers/Get-BootstrapAndStarterConfig.ps1

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,22 +22,18 @@ function Get-BootstrapAndStarterConfig {
2222
$starterConfigFilePath = ""
2323

2424
$bootstrapDetails = $null
25-
$validationConfig = $null
2625
$zonesSupport = $null
2726

28-
# Get the bootstap configuration
27+
# Get the bootstrap configuration
2928
$bootstrapConfigFullPath = Join-Path $bootstrapPath $bootstrapConfigPath
3029
Write-Verbose "Bootstrap config path $bootstrapConfigFullPath"
3130
$bootstrapConfig = Get-ALZConfig -configFilePath $bootstrapConfigFullPath
32-
$validationConfig = $bootstrapConfig.validators.Value
3331

3432
# Get the supported regions and availability zones
3533
Write-Verbose "Getting Supported Regions and Availability Zones with Terraform"
3634
$regionsAndZones = Get-AzureRegionData -toolsPath $toolsPath
3735
Write-Verbose "Supported Regions: $($regionsAndZones.supportedRegions)"
3836
$zonesSupport = $regionsAndZones.zonesSupport
39-
$azureLocationValidator = $validationConfig.PSObject.Properties["azure_location"].Value
40-
$azureLocationValidator.AllowedValues.Values = $regionsAndZones.supportedRegions
4137

4238
# Get the available bootstrap modules
4339
$bootstrapModules = $bootstrapConfig.bootstrap_modules.Value
@@ -76,7 +72,6 @@ function Get-BootstrapAndStarterConfig {
7672
starterModuleSourceFolder = $starterModuleSourceFolder
7773
starterReleaseArtifactName = $starterReleaseArtifactName
7874
starterConfigFilePath = $starterConfigFilePath
79-
validationConfig = $validationConfig
8075
zonesSupport = $zonesSupport
8176
}
8277
}

src/ALZ/Private/Deploy-Accelerator-Helpers/New-Bootstrap.ps1

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@ function New-Bootstrap {
77
[Parameter(Mandatory = $false)]
88
[PSCustomObject] $bootstrapDetails,
99

10-
[Parameter(Mandatory = $false)]
11-
[PSCustomObject] $validationConfig,
12-
1310
[Parameter(Mandatory = $false)]
1411
[PSCustomObject] $inputConfig,
1512

@@ -84,10 +81,8 @@ function New-Bootstrap {
8481

8582
if ($hasStarter) {
8683
if ($inputConfig.starter_module_name.Value -eq "") {
87-
$inputConfig.starter_module_name = @{
88-
Value = Request-SpecialInput -type "starter" -starterConfig $starterConfig
89-
Source = "user"
90-
}
84+
Write-InformationColored "No starter module has been specified. Please supply the starter module you wish to deploy..." -ForegroundColor Red -InformationAction Continue
85+
throw "No starter module has been specified. Please supply the starter module you wish to deploy..."
9186
}
9287

9388
$chosenStarterConfig = $starterConfig.starter_modules.Value.$($inputConfig.starter_module_name.Value)
@@ -128,7 +123,7 @@ function New-Bootstrap {
128123
Write-Verbose "Getting the bootstrap configuration..."
129124
$terraformFiles = Get-ChildItem -Path $bootstrapModulePath -Filter "*.tf" -File
130125
foreach ($terraformFile in $terraformFiles) {
131-
$bootstrapParameters = Convert-HCLVariablesToInputConfig -targetVariableFile $terraformFile.FullName -hclParserToolPath $hclParserToolPath -validators $validationConfig -appendToObject $bootstrapParameters
126+
$bootstrapParameters = Convert-HCLVariablesToInputConfig -targetVariableFile $terraformFile.FullName -hclParserToolPath $hclParserToolPath -appendToObject $bootstrapParameters
132127
}
133128

134129
# Getting the configuration for the starter module user input
@@ -139,12 +134,12 @@ function New-Bootstrap {
139134
if ($iac -eq "terraform") {
140135
$terraformFiles = Get-ChildItem -Path $starterRootModuleFolderPath -Filter "*.tf" -File
141136
foreach ($terraformFile in $terraformFiles) {
142-
$starterParameters = Convert-HCLVariablesToInputConfig -targetVariableFile $terraformFile.FullName -hclParserToolPath $hclParserToolPath -validators $validationConfig -appendToObject $starterParameters
137+
$starterParameters = Convert-HCLVariablesToInputConfig -targetVariableFile $terraformFile.FullName -hclParserToolPath $hclParserToolPath -appendToObject $starterParameters
143138
}
144139
}
145140

146-
if ($iac -in @("bicep", "bicep-avm")) {
147-
$starterParameters = Convert-BicepConfigToInputConfig -bicepConfig $starterConfig.starter_modules.Value.$($inputConfig.starter_module_name.Value) -validators $validationConfig
141+
if ($iac -like "bicep*") {
142+
$starterParameters = Convert-BicepConfigToInputConfig -bicepConfig $starterConfig.starter_modules.Value.$($inputConfig.starter_module_name.Value)
148143
}
149144
}
150145

@@ -248,7 +243,7 @@ function New-Bootstrap {
248243
}
249244
}
250245

251-
if ($iac -eq "bicep" -or $iac -eq "bicep-avm") {
246+
if ($iac -like "bicep*") {
252247
Copy-ParametersFileCollection -starterPath $starterModulePath -configFiles $starterConfig.starter_modules.Value.$($inputConfig.starter_module_name.Value).deployment_files
253248
Set-ComputedConfiguration -configuration $starterConfiguration
254249
Edit-ALZConfigurationFilesInPlace -alzEnvironmentDestination $starterModulePath -configuration $starterConfiguration

0 commit comments

Comments
 (0)