-
Notifications
You must be signed in to change notification settings - Fork 266
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add new "TerminateInstanceAfterJob" configuration
This new setting will allow you to stop (and terminate) an instance after it has completed a job. Signed-off-by: Tom Duffield <tom@chef.io>
- Loading branch information
Showing
5 changed files
with
58 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/bash | ||
|
||
set -euo pipefail | ||
|
||
instance_id=$(curl -fsSL http://169.254.169.254/latest/meta-data/instance-id) | ||
region=$(curl -fsSL http://169.254.169.254/latest/meta-data/placement/availability-zone | head -c -1) | ||
|
||
aws autoscaling set-instance-health --instance-id "$instance_id" --region "$region" --health-status "Unhealthy" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters