PHP code example of benjamin-smith / craft-awscloudfront-private-content

1. Go to this page and download the library: Download benjamin-smith/craft-awscloudfront-private-content library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

benjamin-smith / craft-awscloudfront-private-content example snippets



return [
  'awsRegion'         => 'us-east-1',
  'hostUrl'           => 'https://example-distribution.cloudfront.net',
  'keyPairId'         => 'xxx',
];

craft()->awsCloudfront_privateResource->getPrivateUrl('path/to/content', 'yourPolicyHandle');