I have used boto3 in the past to find all images which were not public
, so as to decrease my list of returned images from the thousands to a manageable number.
However, I can not work out how to filter EBS snapshots in this fashion. I have tried the following
ec2.describe_snapshots(OwnerIds=self)
However, OwnerIds only takes a list of Ids.
I have been reading the following documentation: describe_snapshots, and it states that
The results can include the AWS account IDs of the specified owners, amazon for snapshots owned by Amazon, or self for snapshots that you own
but I can not work out where this self
is meant to go.
Can anybody help? Thanks.
Try:
client.describe_snapshots(OwnerIds=['self'])
or you can specify your account number/id:
client.describe_snapshots(OwnerIds=['123456736123'])
Both are equivalent.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With