I'm using aws/aws-sdk-php-laravel to create buckets and store content. With each bucket created, I add a lifecycle using putBucketLifecycle() to have it automatically deleted after 7 days, like this:
$s3->putBucketLifecycle([
'Bucket' => $bucket,
'Rules' => [
[
'Expiration' => 7,
'ID' => 'expires-after-7-days--' . uniqid(),
'Prefix' => '',
'Status' => 'Enabled',
],
],
]);
And it works well... sort of. After 7 days, in fact, all files in the bucket are cleared. But strange enough, the bucket itself persists. As a result, my S3 is now full of empty buckets:
So the question is, how can I set the buckets to remove themselves also? Am I missing some paremeter/configuration? Or need I call deleteBucket() explicitly?
