File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -40,6 +40,9 @@ function ess_up {
4040}
4141
4242function ess_down {
43+ param (
44+ [string ]$EssRegion = " gcp-us-west2"
45+ )
4346 $Workspace = & git rev- parse -- show-toplevel
4447 $TfDir = Join-Path - Path $Workspace - ChildPath " test_infra/ess/"
4548 $stateFilePath = Join-Path - Path $TfDir - ChildPath " terraform.tfstate"
@@ -52,7 +55,8 @@ function ess_down {
5255 try {
5356 Push-Location - Path $TfDir
5457 & terraform init
55- & terraform destroy - auto- approve
58+ & terraform destroy - auto- approve `
59+ - var= " ess_region=$EssRegion "
5660 Pop-Location
5761 } catch {
5862 Write-Output " Error: Failed to destroy ESS stack(it will be auto-deleted later): $_ "
Original file line number Diff line number Diff line change @@ -40,13 +40,15 @@ function ess_up() {
4040}
4141
4242function ess_down() {
43- echo " ~~~ Tearing down the ESS Stack"
43+ echo " ~~~ Tearing down the ESS Stack"
44+ local ESS_REGION=${1:- " gcp-us-west2" }
4445 local WORKSPACE=$( git rev-parse --show-toplevel)
4546 local TF_DIR=" ${WORKSPACE} /test_infra/ess/"
4647
4748 pushd " ${TF_DIR} "
4849 terraform init
49- terraform destroy -auto-approve
50+ terraform destroy -auto-approve \
51+ -var=" ess_region=${ESS_REGION} "
5052 popd
5153}
5254
Original file line number Diff line number Diff line change @@ -3,4 +3,6 @@ set -euo pipefail
33
44source .buildkite/scripts/steps/ess.sh
55
6- ess_down
6+ ESS_REGION=" ${ESS_REGION:- gcp-us-west2} "
7+
8+ ess_down " $ESS_REGION "
You can’t perform that action at this time.
0 commit comments