File tree Expand file tree Collapse file tree 1 file changed +1
-2
lines changed
packer/windows/conf/buildkite-agent/scripts Expand file tree Collapse file tree 1 file changed +1
-2
lines changed Original file line number Diff line number Diff line change @@ -5,13 +5,12 @@ $InstanceId = (Invoke-WebRequest -UseBasicParsing http://169.254.169.254/latest/
5
5
$Region = (Invoke-WebRequest - UseBasicParsing http:// 169.254 .169.254 / latest/ meta- data/ placement/ availability- zone).content -replace " .$"
6
6
7
7
Write-Output " terminate-instance: requesting instance termination..."
8
- aws autoscaling terminate- instance- in- auto- scaling- group -- region " $Region " -- instance- id " $InstanceId " " --should-decrement-desired-capacity"
8
+ aws autoscaling terminate- instance- in- auto- scaling- group -- region " $Region " -- instance- id " $InstanceId " " --should-decrement-desired-capacity" 2> $null
9
9
10
10
if ($lastexitcode -eq 0 ) { # If autoscaling request was successful, we will terminate
11
11
Write-Output " terminate-instance: disabling buildkite-agent service"
12
12
nssm stop buildkite- agent
13
13
}
14
14
else {
15
15
Write-Output " terminate-instance: ASG could not decrement (we're already at minSize)"
16
- nssm start buildkite- agent
17
16
}
You can’t perform that action at this time.
0 commit comments