Hacker News new | past | comments | ask | show | jobs | submit login

You can use lifecycle policies to delete it for free, but its best to confirm it via support. Not saying this is the great way, maybe its intentionally hidden, but at least there is a way.

https://stackoverflow.com/questions/59170391/s3-lifecycle-ex...




Yes, this was mentioned as the preferred method in the article. As the article states, it's free for objects in the standard storage tier but will incur a Transition cost for other tiers. It's not hidden, but it's not exactly advertised as a way to empty a bucket.


I'm an AWS Solutions Architect and I was helping a customer with the same issue as in the article a couple of months ago.

What I found out when I researched it is that there is a subtle difference between using lifecycles to move objects to other storage classes and for deleting objects: deletions are not transitions, they are expirations – and expirations are free. I submitted a clarification to the S3 documentation and now it says "You are not charged for expiration or the storage time associated with an object that has expired." (https://docs.aws.amazon.com/AmazonS3/latest/userguide/lifecy...)

If you have objects in IA or Glacier there is a minimum duration you're charged for, but there will be no extra charges for expiring these objects.


Thanks for the clarification. Since you looked into this recently, could you elaborate on any possible scenarios when S3 Intelligent Tiering would cost more than S3 Standard? All other storage classes have gotchas built in that can cost more if you're not careful, but I'm thinking Intelligent Tiering might be friendly enough to set it up on all buckets/objects. Are there situations where this is not advisable?


Intelligent Tiering no longer has the 30 day and 128KB limit[0], but it does still have a "monitoring and automation" charge of $0.0025 per 1,000 objects[1] for the objects larger than 128KB. This may be significant if you have a very large number of objects. Potentially you could pay more than Standard if your objects all end up staying in the frequent access tier.

[0] https://aws.amazon.com/about-aws/whats-new/2021/09/amazon-s3...

[1] https://aws.amazon.com/s3/pricing/?nc=sn&loc=4


This is not a "Transition cost", because it is not a transition lifecycle policy, rather an expiration lifecycle policy.

"Minimum storage duration charge" along with "Minimum capacity charge per object" is a property of an S3 Storage Class, not a lifecycle policy. Therefore this cost needs to be considered before selecting a storage class.

The charges for deleting before the minimum storage duration are documented for each storage class at https://docs.aws.amazon.com/AmazonS3/latest/userguide/storag...

Refer to the "Performance across the S3 Storage Classes" table at https://aws.amazon.com/s3/storage-classes/


There's some caveats to that...

"If you create an S3 Lifecycle expiration rule that causes objects that have been in S3 Standard-IA or S3 One Zone-IA storage for less than 30 days to expire, you are charged for 30 days"

It goes on to say 90 days for Glacier and 180 days for Glacier Deep.

https://docs.aws.amazon.com/AmazonS3/latest/userguide/lifecy...


That isn't a property of using the lifecycle policy, though. It would be the same if you manually deleted the files.


Lifecycle rules are the preferred (cheapest) way to do it for standard-storage objects in S3 for sure!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: