Number of LIST request in one DeleteObject call

0

Hi everyone,

I would like to know how many LIST request will be made in one DeleteObject api call. Let's say I am deleting 1,000 objects, will it be 1,000 LIST requests OR just 1 request? Is there any difference in using DeleteObjects instead of DeleteObject? For e.g., when deleting 1000 objects, DeleteObjects only makes 1 LIST request whereas DeleteObject makes 1,000 LIST requests, which will cost me a lot more.

Thank you so much for your time.

AKMin
asked 16 days ago160 views
1 Answer
3
Accepted Answer

Hello.

I also answered at the URL below.
https://repost.aws/ja/questions/QUZouQPXJERluPStXFvke0tw/s3-deleteobject-pricing

The "DeleteObject" and "DeleteObjects" APIs themselves do not execute the LIST API.
You will be charged a fee if you run the LIST API yourself to search for objects to include in a "DeleteObject" or "DeleteObjects" API request.
In other words, if you know all the file names and paths of objects to be deleted, there is no need to run the LIST API, so there is no charge for the LIST API.

It is easy to understand when looking at the AWS CLI, but the "--key" option of the "delete-object" command specifies the object to be deleted.
If you know this "--key", there is no need to run the LIST API.
https://awscli.amazonaws.com/v2/documentation/api/latest/reference/s3api/delete-object.html

Also, if you have a large number of objects, I think setting life cycle rules is effective.
https://repost.aws/knowledge-center/s3-empty-bucket-lifecycle-rule

profile picture
EXPERT
answered 16 days ago
profile picture
EXPERT
reviewed 16 days ago
profile pictureAWS
EXPERT
reviewed 16 days ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions