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.

已提問 1 年前檢視次數 309 次
1 個回答
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}}')"

已回答 1 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南