2017-12-21 5 views
-1

私のCloudFrontメディアコンテンツファイルのURLを取得したいと思っています。 私はS3のPresigned URLのためにC#でコードを持っていますが、それはColudFrontのために働いていません この点について私を助けてください。 私はcloudFrontのC#コードを持っていますが、実装方法を理解することはできません。以下 コードである:CloudFrontメディアコンテンツのURLを事前に取得する方法

private const string AccessKeyId = "";- what to put here 

    private const string SecretAccessKey = "";- what to put here 

    private const string KeyPairId = "";- what to put here 

    private const string PrivateKey = "";- what to put here , is it a filename or the path 

    private static void Main() 
    { 
     const string FileName = "My.File.Zip"; 
     const string S3Bucket = "mybucket"; 
     const string CloudFrontBaseUrl = @"http://blahblah.cloudfront.net/"; 
     const int MinutesValid = 15; 

     var expiry = DateTime.Now.AddMinutes(MinutesValid); 

     var s3SecureUrl = S3.GetSecureUrl(S3Bucket, FileName, expiry, AccessKeyId, SecretAccessKey); 
     var cloudFrontSecureUrl = CloudFront.GetSecureUrl(CloudFrontBaseUrl + FileName, expiry, PrivateKey, KeyPairId); 

}

+0

私たちはあなたのためのgoogleはしていない、ドキュメントを読んで理解してください。 – cguedel

+0

私は私の研究を行っており、コード –

+0

を見つけました。 const string S3Bucket = "Bucketname"; const string CloudFrontBaseUrl = @ "https://mydomainCloudfront.net/"; const int Min = 15; var expiry = DateTime.Now.AddMinutes(Min); var s3SecureUrl = S3.GetSecureUrl(S3Bucket、 "VideFile.mp4"、expiry、AccessKeyId、SecretAccessKey); var cloudFrontSecUrl = CloudFront.GetSecureUrl(FileName、DateTime.Now.AddHours(2)、PrivateKey、KeyPairId); URL文字列を生成するためにまだアクセス拒否メッセージが表示されています。 ここで私は何が不足しているか知りたいだけです –

答えて

関連する問題