Can't delete s3 Bucket with locking enabled

0

I created a Terraform-managed s3 bucket with DynamoDB locking enabled and while trying to delete it as a root or admin user I get an error:

Enter image description here

Furthermore, I do not have access to Terraform anymore, so I have to use AWS Console or CLI.

asked 10 months ago294 views
1 Answer
1

No sure what is it you are looking for, If you are using AWS console and have permission to bypass object lock "s3:BypassGovernanceRetention" it should work automatically. if you are looking for cli option you can check the options here

and example command to delete all the object version with locks overwrite should look like this:

aws s3api delete-objects --bucket BUCKET_NAME --bypass-governance-retention --delete "$(aws s3api list-object-versions --bucket BUCKET_NAME --output=json --query='{Objects: Versions[].{Key:Key,VersionId:VersionId}}')"

answered 10 months 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