You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/ALZ/ALZ.psd1
+5-1Lines changed: 5 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -41,6 +41,8 @@ Included Cmdlets:
41
41
- Grant-SubscriptionCreatorRole: Grants the Subscription Creator role to a specified user or service principal.
42
42
- Remove-PlatformLandingZone: Removes the deployed Azure Landing Zone from your Azure subscription
43
43
- New-AcceleratorFolderStructure: Creates a new folder structure for the Azure Landing Zone accelerator with necessary configuration files.
44
+
- Remove-GitHubAccelerator: Removes GitHub resources (repositories, teams, runner groups) created by the ALZ accelerator bootstrap.
45
+
- Remove-AzureDevOpsAccelerator: Removes Azure DevOps resources (projects, agent pools) created by the ALZ accelerator bootstrap.
44
46
'@
45
47
46
48
CompatiblePSEditions='Core'
@@ -87,7 +89,9 @@ Included Cmdlets:
87
89
'Deploy-Accelerator',
88
90
'Grant-SubscriptionCreatorRole',
89
91
'Remove-PlatformLandingZone',
90
-
'New-AcceleratorFolderStructure'
92
+
'New-AcceleratorFolderStructure',
93
+
'Remove-GitHubAccelerator',
94
+
'Remove-AzureDevOpsAccelerator'
91
95
)
92
96
93
97
# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export.
"description": "Whether to grant permissions for the current Azure CLI user to be able to deploy the Platform Landing Zones. Set to false if you plan to configure a third-party Version Control System.",
Write-ToConsoleLog"Found $($azureContext.ManagementGroups.Count) management groups, $($azureContext.Subscriptions.Count) subscriptions, and $($azureContext.Regions.Count) regions"
93
118
94
119
# Save to cache
95
120
try {
@@ -102,7 +127,7 @@ function Get-AzureContext {
102
127
Write-Verbose"Failed to write cache file: $_"
103
128
}
104
129
} catch {
105
-
Write-InformationColored" Warning: Could not query Azure resources. You will need to enter IDs manually."-ForegroundColor Yellow -InformationAction Continue
130
+
Write-ToConsoleLog"Could not query Azure resources. You will need to enter IDs manually."-IsWarning
Write-InformationColored"The bootstrap type '$bootstrap' that you have selected does not exist. Please try again with a valid bootstrap type..."-ForegroundColor Red -InformationAction Continue
37
+
Write-ToConsoleLog"The bootstrap type '$bootstrap' that you have selected does not exist. Please try again with a valid bootstrap type..."-IsError
38
38
throw
39
39
}
40
40
@@ -48,7 +48,7 @@ function Get-BootstrapAndStarterConfig {
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
51
+
Write-ToConsoleLog"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..."-IsError
Copy file name to clipboardExpand all lines: src/ALZ/Private/Deploy-Accelerator-Helpers/Invoke-Terraform.ps1
+11-11Lines changed: 11 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -61,7 +61,7 @@ function Invoke-Terraform {
61
61
}
62
62
63
63
if (!$silent) {
64
-
Write-InformationColored"Terraform init has completed, now running the $action..."-ForegroundColor Green -NewLineBefore -InformationAction Continue
64
+
Write-ToConsoleLog"Terraform init has completed, now running the $action..."-IsSuccess
65
65
}
66
66
67
67
$planFileName="tfplan"
@@ -85,7 +85,7 @@ function Invoke-Terraform {
85
85
}
86
86
87
87
if (!$silent) {
88
-
Write-InformationColored"Running Plan Command for $action : $command$arguments"-ForegroundColor Green -NewLineBefore -InformationAction Continue
88
+
Write-ToConsoleLog"Running Plan Command for $action : $command$arguments"-IsSuccess
89
89
&$command$arguments
90
90
} else {
91
91
&$command$arguments|Write-Verbose
@@ -96,23 +96,23 @@ function Invoke-Terraform {
96
96
# Stop and display timer
97
97
$StopWatch.Stop()
98
98
if (!$silent) {
99
-
Write-InformationColored"Time taken to complete Terraform plan:"-ForegroundColor Green -NewLineBefore -InformationAction Continue
99
+
Write-ToConsoleLog"Time taken to complete Terraform plan:"-IsSuccess
100
100
}
101
101
$StopWatch.Elapsed|Format-Table
102
102
103
103
if ($exitCode-ne0) {
104
-
Write-InformationColored"Terraform plan for $action failed with exit code $exitCode. Please review the error and try again or raise an issue."-ForegroundColor Red -NewLineBefore -InformationAction Continue
104
+
Write-ToConsoleLog"Terraform plan for $action failed with exit code $exitCode. Please review the error and try again or raise an issue."-IsError
105
105
throw"Terraform plan failed with exit code $exitCode. Please review the error and try again or raise an issue."
106
106
}
107
107
108
108
if (!$autoApprove) {
109
-
Write-InformationColored"Terraform plan has completed, please review the plan and confirm you wish to continue."-ForegroundColor Yellow -NewLineBefore -InformationAction Continue
109
+
Write-ToConsoleLog"Terraform plan has completed, please review the plan and confirm you wish to continue."-IsWarning
Write-InformationColored"You have chosen not to apply the plan. Exiting..."-ForegroundColor Red -NewLineBefore -InformationAction Continue
115
+
Write-ToConsoleLog"You have chosen not to apply the plan. Exiting..."-IsError
116
116
return
117
117
}
118
118
}
@@ -130,7 +130,7 @@ function Invoke-Terraform {
130
130
$arguments+="$planFileName"
131
131
132
132
if (!$silent) {
133
-
Write-InformationColored"Running Apply Command for $action : $command$arguments"-ForegroundColor Green -NewLineBefore -InformationAction Continue
133
+
Write-ToConsoleLog"Running Apply Command for $action : $command$arguments"-IsSuccess
134
134
&$command$arguments
135
135
} else {
136
136
&$command$arguments|Write-Verbose
@@ -142,7 +142,7 @@ function Invoke-Terraform {
142
142
$maxAttempts=5
143
143
144
144
while ($exitCode-ne0-and$currentAttempt-lt$maxAttempts) {
145
-
Write-InformationColored"Terraform $action failed with exit code $exitCode. This is likely a transient issue, so we are retrying..."-ForegroundColor Yellow -NewLineBefore -InformationAction Continue
145
+
Write-ToConsoleLog"Terraform $action failed with exit code $exitCode. This is likely a transient issue, so we are retrying..."-IsWarning
146
146
$currentAttempt++
147
147
$command="terraform"
148
148
$arguments=@()
@@ -157,7 +157,7 @@ function Invoke-Terraform {
157
157
$arguments+="-destroy"
158
158
}
159
159
160
-
Write-InformationColored"Running Apply Command for $action : $command$arguments"-ForegroundColor Green -NewLineBefore -InformationAction Continue
160
+
Write-ToConsoleLog"Running Apply Command for $action : $command$arguments"-IsSuccess
161
161
&$command$arguments
162
162
$exitCode=$LASTEXITCODE
163
163
}
@@ -170,12 +170,12 @@ function Invoke-Terraform {
170
170
# Stop and display timer
171
171
$StopWatch.Stop()
172
172
if (!$silent) {
173
-
Write-InformationColored"Time taken to complete Terraform apply:"-ForegroundColor Green -NewLineBefore -InformationAction Continue
173
+
Write-ToConsoleLog"Time taken to complete Terraform apply:"-IsSuccess
174
174
}
175
175
$StopWatch.Elapsed|Format-Table
176
176
177
177
if ($exitCode-ne0) {
178
-
Write-InformationColored"Terraform $action failed with exit code $exitCode after $maxAttempts attempts. Please review the error and try again or raise an issue."-ForegroundColor Red -NewLineBefore -InformationAction Continue
178
+
Write-ToConsoleLog"Terraform $action failed with exit code $exitCode after $maxAttempts attempts. Please review the error and try again or raise an issue."-IsError
179
179
throw"Terraform $action failed with exit code $exitCode after $maxAttempts attempts. Please review the error and try again or raise an issue."
0 commit comments