Skip to content

Instantly share code, notes, and snippets.

@kawaz

kawaz/calc-aws-az-hash.sh

Last active Dec 20, 2015
Embed
What would you like to do?
複数アカウントの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

This comment has been minimized.

Copy link
Owner Author

@kawaz kawaz commented Jul 29, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.