Search code examples
amazon-web-servicesamazon-s3botoamazon-ebs

Getting higher number of aws snapshot than the snapshots I've in my AWS account


When I try to do :

conn = boto.connect_ec2(access_key = "xxxxxxx", access_secret = "yyyyyy")
snapshots = conn.get_all_snapshots()

I get different number of snapshots(more than snapshots I see on console)

but when try to execute

snapshots = conn.get_all_snapshots(owner="xxxxxyyyyyyy")

I get real number of snapshot that I see on console.

Why is that behaviour in boto. Where I can find those extra snaphots.


Solution

  • snapshots = conn.get_all_snapshots()
    

    ^ Returns all the snapshot that you've access to. It may be many public accessible snapshots.

    snapshots = conn.get_all_snapshots(owner="xxxxxyyyyyyy")  OR snapshots = conn.get_all_snapshots(owner="self") 
    

    xxxxxyyyyyy > AWS_Account_ID

    ^^ Returns the the snapshots you own.


    Thnx to: @BMW

    Reference : https://github.com/boto/boto/issues/2031