LoginSignup
0
0

More than 5 years have passed since last update.

AWS CLI オレオレTIPS

Last updated at Posted at 2017-01-05

これから書き溜めていく。
主にインスタンスの調査用に使用するAWS CLIコマンド類。

RDSの情報取得系

RDSのインスタンス名とMySQLのEngineVersionを引っ張る。

$ aws rds describe-db-instances | jq '.DBInstances[] |{DBInstanceIdentifier,EngineVersion}'

EC2の情報取得系

自分の作成したAMIイメージのNameと作成日を作成日順に逆順ソートして取得する。

  • --owners selfで自分所有(作成)を指定。
    • IAM環境なら同じ環境にいる人も含むっぽい。
  • sort_by(Images,&CreationDate)でソート。
    • トップツリーのImages内のCreationDateでソートかけているイメージ。
      • たぶん↑の解釈は間違っている気がするので、どなたか教えてください
$ aws ec2 describe-images --owners self --query 'sort_by(Images,&CreationDate)[].{Name:Name,CreationDate:CreationDate}'

逆順ソートはこっち。reverse()で囲む。

$ aws ec2 describe-images --owners self --query 'reverse(sort_by(Images,&CreationDate)[].{Name:Name,CreationDate:CreationDate})'
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0