Skip to content

Does using aws cli s3 sync --delete files in s3 folder cost any money?

0

Using life cycle to set rules or directly delete files in s3 doesn't cost money.

But what if I use aws cli sync --delete command to sync local folder to s3 folder, when I delete files in local, is there any fee for s3 file deletion?

Like api operation fee?

Thanks.

asked 2 years ago697 views

2 Answers
1

Hello.

Executing the "aws s3 sync" command requires "s3:ListBucket" authority, so when you execute the command, it probably retrieves a list of objects and checks the differences.
Therefore, when you execute a command, I think that at least the fee for List API will be incurred.
https://aws.amazon.com/s3/pricing/?nc1=h_ls

EXPERT

answered 2 years ago

0

Great question! 👇

Yes, using aws s3 sync --delete can incur a small cost, but not for the deletion itself. Here's how it breaks down:

  1. No Cost for Deletion S3 does not charge you for deleting objects—whether it's through lifecycle rules, console, or CLI (like --delete).

So the act of deleting an object via aws s3 sync --delete is free.

  1. Cost Comes from API Requests The sync command makes multiple ListObjects and DeleteObject API calls.

While deletions are free, API requests are billable, depending on the volume:

ListObjects (used to compare local/S3): $0.005 per 1,000 requests

DELETE requests: $0 (free!)

So if you sync large buckets or run syncs frequently, you may see minor request costs.

Summary Deleting files? Free.

API request volume? May cost pennies.

If you're running syncs occasionally or in small batches, the cost should be negligible.

Hope this helps! Let me know if you want a breakdown based on your usage.

answered a year 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.