Skip to content

Commit ab5cad8

Browse files
fix: boolean true output issue (#215)
# Pull Request ## Issue Issue #212 ## Description Resolve issue with exporting true boolean valued variables to TF VARS file. ## License By submitting this pull request, I confirm that my contribution is made under the terms of the projects associated license.
1 parent 31c701e commit ab5cad8

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/ALZ/Private/Config-Helpers/Write-TfvarsJsonFile.ps1

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,19 @@ function Write-TfvarsJsonFile {
1919
foreach($configurationProperty in $configuration.PSObject.Properties | Sort-Object Name) {
2020
$configurationValue = $configurationProperty.Value.Value
2121

22-
if($configurationValue -eq "sourced-from-env") {
22+
if($configurationValue.ToString() -eq "sourced-from-env") {
2323
continue
2424
}
2525

2626
if($configurationProperty.Value.Validator -eq "configuration_file_path") {
2727
$configurationValue = [System.IO.Path]::GetFileName($configurationValue)
2828
}
2929

30-
$jsonObject["$($configurationProperty.Name)"] = $configurationValue
30+
Write-Verbose "Writing to tfvars.json - Configuration Property: $($configurationProperty.Name) - Configuration Value: $configurationValue"
31+
$jsonObject.Add("$($configurationProperty.Name)", $configurationValue)
3132
}
3233

3334
$jsonString = ConvertTo-Json $jsonObject -Depth 100
3435
$jsonString | Out-File $tfvarsFilePath
3536
}
36-
}
37+
}

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,8 @@ function New-Bootstrap {
135135
-inputConfig $inputConfig `
136136
-copyEnvVarToConfig
137137

138+
Write-Verbose "Final Starter Parameters: $(ConvertTo-Json $starterParameters -Depth 100)"
139+
138140
# Creating the tfvars files for the bootstrap and starter module
139141
$tfVarsFileName = "terraform.tfvars.json"
140142
$bootstrapTfvarsPath = Join-Path -Path $bootstrapModulePath -ChildPath $tfVarsFileName

0 commit comments

Comments
 (0)