0

I want to delete multiple objects from S3 with AWS.jl. Looping over S3.delete_object() works fine, but is not that fast.

using AWS
@service S3

bucket = "my_bucket"
keys = ["tmp/file1", "tmp/file2"]
for key in keys 
     S3.delete_object(bucket, key)
end

That's why I want to use S3.delete_objects() without a loop (as long as I have less than 1000 files to delete). But I don't know how to specify the delete parameter.

I tried that:

to_delete = Dict("Objects" => [Dict("Key" => "tmp/file1"), Dict("Key" => "tmp/file2")])
S3.delete_objects(bucket, to_delete)

But only receive an HTTP/1.1 403 Forbidden error. I'm pretty sure the credentials are fine, as it is working in R and Python.

Thans for help

2
  • 1
    The README Limitations section says the high level S3.DeleteObjects does not work, and the low level s3 must be used. Maybe try xml with multiple <Object> elements. Commented Jun 5 at 13:27
  • Yes you are right. XML is working with multiple elements. Commented Jun 16 at 8:38

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.