Last active
December 20, 2015 08:49
-
-
Save kawaz/6103296 to your computer and use it in GitHub Desktop.
複数アカウントのAZ名の対応を調査する
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
| #!/bin/bash | |
| ec2-describe-regions | | |
| while read dummy region dummy; do | |
| for az in a b c d; do | |
| history="$(ec2-describe-spot-price-history \ | |
| --region $region \ | |
| -s "$(date -u -d "2 day ago" +%Y-%m-%dT00:00:00)" \ | |
| -e "$(date -u -d "1 day ago" +%Y-%m-%dT00:00:00)" \ | |
| -a $region$az 2>/dev/null | sed -e s/$region$az// | sort | |
| )" | |
| if [[ -n $history ]]; then | |
| echo "$region$az $(sha1sum<<<"$history")" | |
| fi | |
| done | |
| done |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
解説はこちら↓
AWS - 複数アカウントのAZ名の対応を調査する - Qiita [キータ]