Skip to content

Instantly share code, notes, and snippets.

@kawaz
Last active December 20, 2015 08:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kawaz/6103296 to your computer and use it in GitHub Desktop.
Save kawaz/6103296 to your computer and use it in GitHub Desktop.
複数アカウントのAZ名の対応を調査する
#!/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
@kawaz
Copy link
Author

kawaz commented Jul 29, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment