-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDeploy-Module.ps1
More file actions
24 lines (19 loc) · 872 Bytes
/
Copy pathDeploy-Module.ps1
File metadata and controls
24 lines (19 loc) · 872 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
[CmdletBinding()]
param (
[Parameter(Mandatory)] [ValidateSet("oke", "k8s", "azure-pinger")] [string] $Module,
[Parameter()] [string] [ValidateSet("TRACE", "DEBUG", "INFO", "WARN", "ERROR")] $LogLevel = "ERROR",
[Parameter()] [switch] $SkipAzureInteractiveLogin
)
$private:sharedDir = Join-Path $PSScriptRoot "terraform-modules" "shared-config"
$private:modulePath = Join-path $PSScriptRoot "terraform-modules" $Module
$env:TF_LOG = $LogLevel
terraform -chdir="$modulePath" init
if ($Module -eq "azure-pinger") {
if (-not $SkipAzureInteractiveLogin) {
az login
}
terraform -chdir="$modulePath" apply -var-file="$sharedDir/shared.tfvars" -var-file="$modulePath/values.tfvars"
}
else {
terraform -chdir="$modulePath" apply -var-file="$sharedDir/shared.tfvars" -var-file="$sharedDir/oci.tfvars" -var-file="$modulePath/values.tfvars"
}