Last active
October 6, 2020 15:39
-
-
Save exequielrafaela/3294d5c0481cfd751dfa91ca269e67fe to your computer and use it in GitHub Desktop.
aws s3api delete-objects from aws s3api list
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
AWS_SHARED_CREDENTIALS_FILE="/home/user/.aws/test/credentials" \ | |
AWS_CONFIG_FILE="/home/user/.aws/test/config" \ | |
aws s3api delete-objects \ | |
--profile test-shared-devops \ | |
--bucket test-shared-gdrive-backup \ | |
--delete \ | |
"$(AWS_SHARED_CREDENTIALS_FILE="/home/user/.aws/test/credentials" AWS_CONFIG_FILE="/home/user/.aws/test/config" aws s3api list-object-versions \ | |
--profile test-shared-devops \ | |
--bucket test-shared-gdrive-backup | jq '{Objects: [.Versions[] | {Key:.Key, VersionId : .VersionId}], Quiet: false}')" | |
# | |
## Shell Console Output | |
# | |
# { | |
# "Deleted": [ | |
# { | |
# "Key": "Drive_folder_name/Drive_subfolder_name KB/GCP/Architecting with GCP Fundamentals:\nInfrastructure.zip", | |
# "VersionId": "LVoxxxxxxxxxxxxxxxxxxxxxxxx" | |
# } | |
# ] | |
# } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment