Skip to content

Instantly share code, notes, and snippets.

@cm-watanabeseigo
Last active March 1, 2017 08:51
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 cm-watanabeseigo/a722e2012bf09f5f1b48c550466e97fc to your computer and use it in GitHub Desktop.
Save cm-watanabeseigo/a722e2012bf09f5f1b48c550466e97fc to your computer and use it in GitHub Desktop.
RDSの今の状態をみながら作業したい時
$ RDS_NAME=hogehoge
$ echo "[Time] DBInstanceIdentifier AvailabilityZone (SecondaryAvailabilityZone) DBInstanceClass DBInstanceStatus" ; while :
do
printf "[%s] %s %s (%s) %s %s\n" $(date +%T) \
$(aws rds describe-db-instances --db-instance-identifier ${RDS_NAME} --query DBInstances[].[DBInstanceIdentifier,AvailabilityZone,SecondaryAvailabilityZone,DBInstanceClass,DBInstanceStatus] --output text);
sleep 10 || exit
done
[Time] DBInstanceIdentifier AvailabilityZone (SecondaryAvailabilityZone) DBInstanceClass DBInstanceStatus
[14:09:49] hogehoge ap-northeast-1a (ap-northeast-1c) db.t2.small available
[14:10:00] hogehoge ap-northeast-1a (ap-northeast-1c) db.t2.small available
[14:10:12] hogehoge ap-northeast-1a (ap-northeast-1c) db.t2.small modifying
[14:10:23] hogehoge ap-northeast-1a (ap-northeast-1c) db.t2.small modifying
(snip)
[14:21:04] hogehoge ap-northeast-1a (ap-northeast-1c) db.t2.small modifying
[14:21:15] hogehoge ap-northeast-1a (ap-northeast-1c) db.t2.small modifying
[14:21:26] hogehoge ap-northeast-1c (ap-northeast-1a) db.t2.small modifying
[14:21:37] hogehoge ap-northeast-1c (ap-northeast-1a) db.t2.small modifying
(snip)
[14:24:12] hogehoge ap-northeast-1c (ap-northeast-1a) db.t2.small modifying
[14:24:23] hogehoge ap-northeast-1c (ap-northeast-1a) db.t2.small modifying
[14:24:34] hogehoge ap-northeast-1c (ap-northeast-1a) db.t2.micro available
[14:24:45] hogehoge ap-northeast-1c (ap-northeast-1a) db.t2.micro available
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment