普通网友 2012-03-22 12:11
浏览 106

在CloudFront中使用私有ACL?

I am developing a web app where video files are stored on Amazon S3 and using CloudFront is an optional feature which can be turned on and off at any time.

I have a bunch of video files set with private ACLs, and I use signed URLs to access them. This works great.

However, I want to create a CloudFront RTMP distribution on that bucket, but it would be difficult to programmatically update every single (Could be well over 300) object's ACL each time (And would take a long time for all the requests to happen since you can't do it by batch, right?).

Is there a way to either:

  • Set ACLs in bulk, in one call?
  • Set a bucket access policy so that CloudFront can read any private files in the bucket?

I have attempted creating an Origin Access Identity, and then adding this to the bucket's Access Control Policy but this doesn't appear to work.

And finally do I still need to sign the URLs when I send them to the video player?

This does all need to be done programatically in PHP so using CloudBerry and such won't be helpful to me unfortunately.

  • 写回答

1条回答 默认 最新

  • duanlu5055 2012-05-29 06:14
    关注

    This is a useful guide to get started, it tells how to set up the private distribution: http://www.bucketexplorer.com/documentation/cloudfront--how-to-create-private-streaming-distribution.html

    You can set the ACLs via the AWS API looping through your videos in a series (I don't think this can be done in bulk, even BucketExplorer does this in a queue). You only need to set the ACLs on each file once. You need to make sure you grant access to the Canonical User you have in your Origin Access Identity for the distribution. This way the distribution can access the protected file from the S3 origin. You then need to set up a key-pair and a trusted signer.

    You do need to sign the URLs every time someone accesses the video. There are a number of scripts available. This is a useful guide for Ruby, but you could quite easily rewrite the code in PHP: http://r2d6.com/posts/1301220789-setting-up-private-streaming-with-cloudfront-and-ruby-on-rails

    评论

报告相同问题?

悬赏问题

  • ¥15 Vue3 大型图片数据拖动排序
  • ¥15 划分vlan后不通了
  • ¥15 GDI处理通道视频时总是带有白色锯齿
  • ¥20 用雷电模拟器安装百达屋apk一直闪退
  • ¥15 算能科技20240506咨询(拒绝大模型回答)
  • ¥15 自适应 AR 模型 参数估计Matlab程序
  • ¥100 角动量包络面如何用MATLAB绘制
  • ¥15 merge函数占用内存过大
  • ¥15 使用EMD去噪处理RML2016数据集时候的原理
  • ¥15 神经网络预测均方误差很小 但是图像上看着差别太大