This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-10-12
Channels
- # announcements (13)
- # aws (18)
- # babashka (60)
- # babashka-sci-dev (83)
- # beginners (32)
- # biff (18)
- # calva (22)
- # cider (8)
- # clj-on-windows (101)
- # clojure (59)
- # clojure-bay-area (2)
- # clojure-europe (36)
- # clojure-india (4)
- # clojure-nl (3)
- # clojure-norway (5)
- # clojure-spec (4)
- # clojure-uk (1)
- # clojurescript (5)
- # conjure (1)
- # core-async (10)
- # cursive (7)
- # data-science (5)
- # datahike (10)
- # datalog (11)
- # datomic (3)
- # docker (3)
- # figwheel-main (2)
- # gratitude (3)
- # improve-getting-started (1)
- # introduce-yourself (5)
- # jobs (3)
- # joyride (12)
- # leiningen (1)
- # lsp (67)
- # malli (27)
- # off-topic (36)
- # random (1)
- # rdf (1)
- # re-frame (17)
- # reagent (21)
- # reitit (4)
- # releases (4)
- # remote-jobs (2)
- # ring (2)
- # sci (35)
- # shadow-cljs (28)
- # sql (3)
- # squint (9)
- # tools-deps (11)
does anyone have some aws-api code that will delete a bucket and all its objects? apparently aws doesn't believe i would ever want to do such a thing and requires this to be several steps.
you need to combine ListObjectsV2
with DeleteVersion
and/or DeleteObject
- there's no single API call that nukes a bucket and its contents
And then delete bucket. Yeah thats what i figured, it really feels like aws doesn't use there own api's. A file system where you cant delete a folder? That's unheard of.
Sure, but the fact remains, it's forcing it's users to jump through hopes for reasons i can't fathom.
It's because of customer support: if there was a DeleteBucketAndEverything
API call, there's no way to recover, at least with object versioning (if it's enabled!) you have a chance to get your data back somehow. Source: I deleted customer data way too many times I'm caring to admit and had to build DR features into many products
Thanks, yeah. I guess I see why they would think that, even if i fundementally disagree that adding steps makes things more secure. Where do you draw the line? What if you had to call aws and talk to a s3 supervisor to delete your bucket? Sure less buckets would get deleted, but at what cost?
You can't actually, I have a 2TB bucket that needs to go and support told me to do it myself, carefully
can't what? call support? I was suggesting it would be a huge time sink if you had to call support, not that i wanted to.
sorry, what I meant was that I requested that from support (my co had/has a paid support tier) and they do not perform data deletion requests on your behalf - at least they didn't in my case
depending on how big the bucket is ive seen creating a lifecycle policy of deletion after 0 daysand attaching to all objects is nicer. we had 3 ~550TB buckets, that did it much better than any direct api calls
Somewhat related: a technique for speeding up list object calls https://www.genui.com/open-source/s3p-massively-parallel-s3-copying
You can shell out to this: https://docs.aws.amazon.com/cli/latest/reference/s3/rb.html There is a --force option that deletes bucket contents
you may need to implement retries if you have lots of items in a bucket, I remember running this a more than once on a bucket
(clojure.java.shell/sh "aws" "s3" "rb" (str "s3://" bucket-name) "--force")
you must have the aws cli installed though