Files
oracle-deep-data-security-lab/scripts/validate-terraform.ps1
Rodrigo Pace 5cd8752a90
Some checks failed
Repo Quality / structure (push) Has been cancelled
Terraform Validate / validate (push) Has been cancelled
Initial Oracle Deep Data Security lab kit
2026-05-08 12:08:05 -03:00

28 lines
602 B
PowerShell

param(
[string]$Environment = "demo"
)
$ErrorActionPreference = "Stop"
$repoRoot = Split-Path -Parent $PSScriptRoot
$tfDir = Join-Path $repoRoot "terraform/envs/$Environment"
if (-not (Test-Path $tfDir)) {
throw "Terraform environment not found: $tfDir"
}
$terraform = Get-Command terraform -ErrorAction SilentlyContinue
if ($null -eq $terraform) {
throw "Terraform is not installed or not in PATH. Install Terraform 1.6+ and rerun this script."
}
Push-Location $tfDir
try {
terraform fmt -recursive -check
terraform init -backend=false
terraform validate
}
finally {
Pop-Location
}