0

I'm trying to List Snapshot ID's with time under specific VPC ID using PowerShell or AWS CLI

Anthony Neace
  • 25,013
  • 7
  • 114
  • 129

1 Answers1

2

Snapshots are region specific, not VPC specific, therefore you can't directly list all snapshots for a specific VPC.

If you need that kind of filtering, then you can tag each snapshot with a VPC it "belongs" to (i.e VPCID:value-of-VPC-id). And then use this command.

aws ec2 describe-snapshots --owner-ids <your-account-id> --filters Name=tag:VPCID,Values=<value-of-VPC-id>

If you want to retrieve only VPC ID and time, then you can enhance the above with query parameter

aws ec2 describe-snapshots --owner-ids <your-account-id> --filters Name=tag:VPCID,Values=<value-of-VPC-id> --query "Snapshots[*].{ID:SnapshotId,Time:StartTime}"
Matus Dubrava
  • 13,637
  • 2
  • 38
  • 54
  • @NarasimhaThejaRao Hey, could you ask that as a followup question so it could be answered separately? That will give the answerer more room to work with than this small comment UI. Thanks! – Anthony Neace Jan 23 '19 at 04:22