0

I'm uploading videos to an AWS s3 bucket. That's working great. I now need to render those videos via Nationbuilder templates, which will look like <video><source src="...s3_url"></video>

From my current testing, I'm getting a 403 forbidden error when the page tries to load the video, but when I visit the s3 link I CAN view the video.

What I've tried:

  • I've 'unblocked' ALL public access enter image description here
  • I tried the opening CORS:
[
    {
        "AllowedHeaders": [
            "*"
        ],
        "AllowedMethods": [
            "GET"
        ],
        "AllowedOrigins": [
            "*"
        ],
        "ExposeHeaders": []
    }
]
  • I tried opening via "Bucket policies":
{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "PublicReadGetObject",
            "Effect": "Allow",
            "Principal": "*",
            "Action": "s3:GetObject",
            "Resource": "arn:aws:s3:::<bucketname>/*"
        }
    ]
}

What I can't tell, is where/how I should be giving permission for my website "videoexample.com" to access the s3 bucket.

The possibilities from what I've read so far seem to be:

  1. CORS (AWS > S3 > Bucket > Permissions)
  2. "access control lists" (ACLs)
  3. "bucket policies"
  4. "access point policies"
  5. or possibly "Access Points"
  6. or still possibly via IAM: s3:PutObjectAcl, or s3:PutObject.

From AWS > S3 > Bucket > Permissions

Block public access (bucket settings) Public access is granted to buckets and objects through access control lists (ACLs), bucket policies, access point policies, or all.

I'd really appreciate any pointers/suggestions/explanations.

Will continue reading in the meantime.

Best

Pete

Pete
  • 35
  • 1
  • 9
  • 1
    Did you grant public read with either a bucket policy or ACL? https://docs.aws.amazon.com/AmazonS3/latest/userguide/WebsiteAccessPermissionsReqd.html – jingx Feb 15 '21 at 05:11
  • Thanks for your help @jingx - just tried the bucket policy, will try the ACL now. I note the linked permission guide is for a website hosted with a bucket, rather than my use-case which is storing videos for a different website – Pete Feb 15 '21 at 05:31
  • Well if I read your post correctly, you *are* effectively hosting a static web site out of the bucket. It's just that everything on that web site is a video, linked to from another web site. – jingx Feb 15 '21 at 05:34
  • Hmm - possibly - is it different because it's being fetched (via some ajax kinda thing?) by the video component? Rather than a website which is fetched by a... ...uh... browser request? – Pete Feb 15 '21 at 06:11
  • Still a link... ajax requests are still http(s) requests... – jingx Feb 15 '21 at 06:38

0 Answers0