0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

AWS CLIでEC2関連情報を出力する

Last updated at Posted at 2022-12-07

AWS CLIでEC2のインスタンスID(InstanceId)、名前(KeyName)、インスタンスタイプ(InstanceType)、インスタンスの状態(State)をテーブル形式で出力するコマンド。

aws ec2 describe-instances --query "Reservations[*].Instances[*].[{OS:PlatformDetails,Name:KeyName,InstanceID:InstanceId,Type:InstanceType,State:State.Name}]" --out table

AWS CLIでEBSのインスタンスID(InstanceId)、ボリュームID(VolumeID)、サイズ(Size)、ボリュームタイプ(VolumeType)をテーブル形式で出力するコマンド。

aws ec2 describe-volumes --query 'Volumes[*].{VolumeID:Attachments[0].VolumeId,InstanceID:Attachments[0].InstanceId,Size:Size,VolumeType:VolumeType}'  --out table
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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?