File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
packer/windows/conf/buildkite-agent/scripts Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 1
1
# Stop script execution when a non-terminating error occurs
2
2
$ErrorActionPreference = " Stop"
3
3
4
+ Write-Output " terminate-instance: waiting for 10 seconds to allow agent logs to drain to Cloudwatch..."
5
+ Start-Sleep - Seconds 10
6
+
4
7
$InstanceId = (Invoke-WebRequest - UseBasicParsing http:// 169.254 .169.254 / latest/ meta- data/ instance- id).content
5
8
$Region = (Invoke-WebRequest - UseBasicParsing http:// 169.254 .169.254 / latest/ meta- data/ placement/ availability- zone).content -replace " .$"
6
9
10
+ Write-Output " terminate-instance: requesting instance termination..."
7
11
aws autoscaling terminate- instance- in- auto- scaling- group -- region " $Region " -- instance- id " $InstanceId " " --should-decrement-desired-capacity"
8
-
9
- Stop-Computer $env: computername - Force
You can’t perform that action at this time.
0 commit comments