Here is my sign URL function:
private function signUrl($lesson) {
$cloudFrontClient = AWS::createClient('CloudFront', [
'region' => '<my-region>',
'version' => '2017-03-25'
]);
$streamHostUrl = 'https://<mydomain>.cloudfront.net';
$resourceKey = $object->s3_video;
$expires = time() + 300;
// Create a signed URL for the resource using the canned policy
$signedUrlCannedPolicy = $cloudFrontClient->getSignedUrl([
'url' => $streamHostUrl . '/' . $resourceKey,
'expires' => $expires,
'private_key' => '<MY_PEM_FILE_PATH>',
'key_pair_id' => '<KEY_PAIR_ID>'
]);
return $signedUrlCannedPolicy;
}
When clicking on the link I get this ambiguous error message, which can't really help me debug the problem:
<Error><Code>AccessDenied</Code><Message>Access
Denied</Message><RequestId>SOME_ID_HERE</RequestId><HostId>SOME_BASE64_HERE_NOT_READABLE</HostId></Error>
I wondered if there is some way to debug this, maybe in the AWS console or some API call?