Is it possible to mass delete EBS snapshots from the command line on Windows?

I am trying to delete all the EBS snapshots except the X latest in an instance of Windows AWS using the EC2 command line API tools. I found the following for Linux, is it possible to do the same on Windows?

ec2-describe-snapshots | sort -r -k 5 | sed 1,6d | awk '{print "Delete snapshot:" $ 2 "; system (" ec2-delete-snapshot "$ 2)'

+3
source share
1 answer

Update

, , -, EBS, , , script boto get_all_snapshots(), , , EBS, .

, , ,

snapshots = volume.snapshots()

snapshots = conn.get_all_snapshots()

, , Amazon EC2 API Tools PowerShell script, boto AWS (.. Linux, MacOS, Windows) - Boto - Python, - Amazon.

- , Vaibhav Puranik , . EBS python script - script ebs , .

, , , script , , . , , :

if volume.create_snapshot(description):
    print 'Snapshot created with description: ' + description

. script.

, , script , , .

!

+1

Source: https://habr.com/ru/post/1763244/


All Articles