Last active
December 10, 2018 14:59
-
-
Save sandeepkunkunuru/5bc866886fcca2535775d863a913ccde to your computer and use it in GitHub Desktop.
awless : stop, start instances
This file contains hidden or 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
#!/usr/bin/env bash | |
set -ex | |
AWS_DEFAULT_REGION=xxxx | |
AWS_DEFAULT_PROFILE=xxxx | |
awless config set aws.region ${AWS_DEFAULT_REGION} | |
awless config set aws.profile ${AWS_DEFAULT_PROFILE} | |
SCRIPT_HOME=/home/xxx/scripts/awless | |
DATA_HOME=/home/xxx/cloud/data | |
function join_by { local IFS="$1"; shift; echo "$*"; } |
This file contains hidden or 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
#!/usr/bin/env bash | |
source ../env.sh | |
instances=( $(cut -d ',' -f1 ${DATA_HOME}/instances.csv ) ) | |
printf "%s\n" "${instances[0]}" | |
echo "starting instances ---> "`join_by , "${instances[@]}"` | |
awless start instance id=`join_by , "${instances[@]}"` |
This file contains hidden or 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
#!/usr/bin/env bash | |
source ../env.sh | |
instances=( $(cut -d ',' -f1 ${DATA_HOME}/instances.csv ) ) | |
printf "%s\n" "${instances[0]}" | |
echo "Stopping instances ---> "`join_by , "${instances[@]}"` | |
awless stop instance id=`join_by , "${instances[@]}"` |
This file contains hidden or 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
i-xxxxxxxx | xxx | xxxx |
---|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment