删除桶策略

您可以使用 deleteBucketPolicy 接口删除桶策略。以下代码展示如何删除一个桶的策略:

$bucket = '<your-bucket-name>';
try {
    $resp = $s3Client->deleteBucketPolicy([
        'Bucket' => $bucket
    ]);
    echo "Succeed in deleting policy of bucket: " . $bucket . "\n";
} catch (AwsException $e) {
    echo $e->getMessage();
    echo "\n";
}