Skip to content

s3 lock files - cant delete

0

Hi, i cant delete S3 bucket and files, this buckt has lock object activated, i try to disable it, but it seems that is not working I have already deleted other files in that bucket, but I can't empty it completely; any idea how i can empty this bucket? Locked object is enable and i cant change that, i use a police with my user to bypassgovermentretention whitout luck.

Thanks C.

asked 2 years ago652 views

3 Answers
2

Hi

Object Lock is a feature in Amazon S3 that helps protect objects from accidental deletion or modification for a specific retention period. Once enabled for a bucket, it cannot be disabled

There are two main ways Object Lock can be enforced: retention period and legal hold.

Retention Period: If it's a retention period, you might need to wait until the retention expires to delete the object.


Legal Hold: If it's a legal hold, it's likely placed for compliance reasons. You'll need to remove the legal hold using the AWS console or API before deleting the object...

Consult the AWS documentation for detailed instructions on managing Object Lock

https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-lock.html

EXPERT

answered 2 years ago

EXPERT

reviewed 2 years ago

  • I dont find the option to change the Legal Hold setting, any idea where i can update/change this? Thanks

2

Hii,

You can't delete locked objects with Compliance mode Object Lock. Here are your options:

Wait: If the mode is Governance, use s3:BypassGovernanceRetention permission (double-check your policy). Otherwise, wait for the retention period to expire.

Overwrite (might work): In some cases, you can overwrite the locked object with an empty one (check your specific use case)

EXPERT

answered 2 years ago

  • Hi, this is vmware backup file parts, but we dont need it any more, how we can overwrite it? Thanks

2

Which object lock mode? If it is Legal Hold then see https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-lock-managing.html#object-lock-managing-bypass

If you have the s3:BypassGovernanceRetention permission, you can perform operations on object versions that are locked in governance mode as if they were unprotected.

Note

Bypassing governance mode doesn't affect an object version's legal hold status. If an object version has a legal hold enabled, the legal hold remains and prevents requests to overwrite or delete the object version.

EXPERT

answered 2 years ago

EXPERT

reviewed 2 years 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.