LoginSignup
0
0

More than 3 years have passed since last update.

[AWS] aws cliで、EC2のスナップショットIDの一覧を取得する

Posted at

EC2ヘッダ画像.png

aws cliを利用して、EC2のスナップショットIDの一覧を取得する方法を紹介します。

aws cliのバージョン

% aws --version
aws-cli/2.1.28 Python/3.8.8 Darwin/20.3.0 exe/x86_64 prompt/off

リージョンとプロファイルの設定

% export AWS_DEFAULT_REGION=ap-northeast-1
% export AWS_PROFILE=xxxx

スナップショットIDの一覧を取得

% aws ec2 describe-snapshots \
--query "Snapshots[*].[SnapshotId]" \
--owner-ids self \
--output text \
--no-cli-pager

実行結果

snap-XXb21e34857fXXXXX
snap-XX6b9ae9820aXXXXX
snap-XX42a5e4f320XXXXX
snap-XX89dd6d4a27XXXXX
snap-XXe5d373fc47XXXXX
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