我不得不使用AWS控制台删除并删除S3存储桶感到沮丧,所以我创建了一个Python
脚本来为我做!
BUCKETS = [
"bucket-one",
"bucket-two",
]
import boto3
s3 = boto3.resource("s3")
for bucket_name in BUCKETS:
bucket = s3.Bucket(bucket_name)
bucket.object_versions.delete()
bucket.delete()