Created
January 12, 2020 19:06
-
-
Save ashutoshkarna03/ff5bfbff3a21415e027bf2dc3be9ccca to your computer and use it in GitHub Desktop.
This file contains 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
# proceed for deletion | |
for each_volume_id in volumes_to_delete: | |
try: | |
print("Deleting Volume with volume_id: " + each_volume_id) | |
response = client.delete_volume( | |
VolumeId=each_volume_id | |
) | |
except Exception as e: | |
print("Issue in deleting volume with id: " + each_volume_id + "and error is: " + str(e)) | |
# waiters to verify deletion and keep alive deletion process until completed | |
waiter = client.get_waiter('volume_deleted') | |
try: | |
waiter.wait( | |
VolumeIds=volumes_to_delete, | |
) | |
print("Successfully deleted all volumes") | |
except Exception as e: | |
print("Error in process with error being: " + str(e)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment