Created
May 20, 2015 09:23
-
-
Save yujihamaguchi/8d7f25b28bd3046201f9 to your computer and use it in GitHub Desktop.
amiに紐付いていないsnapshotのIDを抽出
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
aws ec2 describe-snapshots --owner {12桁のアカウントID} | jq '.Snapshots[].SnapshotId' > ./all_snapshot_ids.log | |
aws ec2 describe-images --owner {12桁のアカウントID} | jq '.Images[].BlockDeviceMappings[].Ebs.SnapshotId' | grep ^\" > ./linked_snapshot_ids.log | |
comm -23 <(sort ./all_snapshot_ids.log) <(sort ./linked_snapshot_ids.log) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment