createDistribution() public static method

Create a CloudFront distribution
public static createDistribution ( string $bucket, boolean $enabled = true, array $cnames = [], string $comment = null, string $defaultRootObject = null, string $originAccessIdentity = null, array $trustedSigners = [] ) : array | false
$bucket string Bucket name
$enabled boolean Enabled (true/false)
$cnames array Array containing CNAME aliases
$comment string Use the bucket name as the hostname
$defaultRootObject string Default root object
$originAccessIdentity string Origin access identity
$trustedSigners array Array of trusted signers
return array | false | false
Example #1
0
function test_createDistribution($bucket, $cnames = array())
{
    if (($dist = S3::createDistribution($bucket, true, $cnames, 'New distribution created')) !== false) {
        echo "createDistribution({$bucket}): ";
        var_dump($dist);
    } else {
        echo "createDistribution({$bucket}): Failed to create distribution\n";
    }
}