LoginSignup
1
0

More than 5 years have passed since last update.

aws-cli AMIに紐付いているEBSスナップショットのIDを取得する

Last updated at Posted at 2016-12-10

マネジメントコンソールでAMIに紐付いているEBSスナップショットの情報が取得できなかったのでコマンドで取得します。

0. 環境

  • macOS Sierra 10.12.1
  • aws cli
$ aws --version
aws-cli/1.11.27 Python/2.7.10 Darwin/16.1.0 botocore/1.4.84

1. AMIとEBSスナップショットの情報を取得

$ aws ec2 describe-images \
  --owners self \
  --query "Images[].{ImageId:ImageId, SnapshotId:BlockDeviceMappings[].Ebs.SnapshotId, Name:Name}" \
  --output json
[
    {
        "SnapshotId": [
            "snap-xxxxxxxx"
        ],
        "Name": "hoge-snapshot",
        "ImageId": "ami-xxxxxxxx"
    }
]

x. 関連

1
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
1
0