This step-by-step walk-through will guide you through the process of
using Amazon CloudFront
to distribute public Roku content such as poster images, logo artwork,
or video/audio streams.
CloudFront is used to deliver your content using a global network of edge locations.
Roku player requests for your content are automatically routed to the nearest edge
location, so content is delivered with the best possible performance.
What is an origin server?
An origin server (or origin bucket) is the location where CloudFront retrieves the
original versions of your files.
This can be your own hosted web server, or it can be an Amazon S3 bucket.
CloudFront caches copies of your files at edge locations around the world,
but when a file is not in the cache or has expired,
CloudFront fetches a fresh copy from your origin server.
This walk-through will cover using an S3 bucket as the origin server.
To use Amazon CloudFront with Instant TV Channel, you will:
Store the original versions of your poster artwork or streams in an S3 bucket
(the origin server).
Create a CloudFront Distribution to register your origin servers
through the AWS Management Console.
Use your CloudFront Distribution's domain name
as part of the poster URLs or streaming URLs in your Roku channel.
When a Roku player requests a poster or stream using this domain name,
the player is automatically routed to the nearest edge location for
high performance delivery of the content.
Create an Amazon S3 bucket to use as an origin server (optional if you already have a bucket)
If you already have an S3 bucket containing your poster images, video streams, or other content,
you can skip this section and use your existing bucket when creating the CloudFront distribution below.
Log into your AWS (Amazon Web Services) account and
go to the S3 section of your AWS control panel.
Click the Create Bucket button.
Provide a Bucket Name, for example "my-origin-bucket".
Very Important: Use only lower-case characters, digits, and dashes in your bucket name.
Instant TV Channel does not support the use of upper-case characters or other symbols in bucket names.
Good Bucket Name: test-bucket
Good Bucket Name: bucket123
Bad Bucket Name: test.bucket(contains unsupported period character ".")
Bad Bucket Name: bucket+123(contains unsupported plus character "+")
The bucket Region should be set to "US East (N. Virginia)".
Click the Create button, do not click the Next button.
At this point your new S3 bucket is ready to store files that will be used by CloudFront.
You can upload files to the new bucket by clicking the Upload
button in the S3 control panel.
Create a public CloudFront distribution:
Log into your AWS (Amazon Web Services) account and
go to the CloudFront section of your AWS control panel.
From the left-hand Navigation panel, click Distributions.
Click the Create Distribution button.
In Distribution name, enter a name for the distribution,
for example "My Public Content Distribution".
Optionally, in Description, enter a description of the distribution,
for example "CloudFront distribution for my Roku channel poster images and video streams".
Leave the Distribution type set to the default "Single website or app" selection.
Leave the Route 53 managed domain blank,
unless you have already configured a custom domain in Route 53.
Click Next.
Leave Origin type set to the default "Amazon S3" selection.
Under Origin, click the Browse S3 button and select the S3 bucket
previously created to use as the origin server for this CloudFront distribution.
Leave Origin path blank.
Leave everything under Settings at the default values.
Click Next.
Choose whether or not to use WAF (Web Application Firewall).
Note: Using WAF can incur significant costs.
For most Roku channels, select "Do not enable security protections".
Click Next.
Review the settings, then click Create distribution.
CloudFront will automatically update your S3 bucket policy to allow access from the distribution.
In the upper left-hand corner, you will see a breadcrumb navigation that looks like
"CloudFront > Distributions > E5432ABCDEFGH1".
Click on Distributions in the breadcrumb to view the list of all distributions.
Click the row containing the Distribution that you just created.
Record the Distribution domain name which will look something like this:
d12m3fxh45v67a.cloudfront.net.
The domain name will be used to access your CloudFront content from
your Roku channel.
Wait for "Deploying" under the Last Modified column to change to today's date.
If a poster named "poster.jpg" is stored in the origin S3 bucket,
and the CloudFront domain name is "d12m3fxh45v67a.cloudfront.net",
then the URL that would be used to access the poster is:
http://d12m3fxh45v67a.cloudfront.net/poster.jpg
For a walk-through on building a Roku channel using Instant TV Channel,
please visit this
link.
Comments or questions about this Roku, CloudFront & S3 developer tutorial can be emailed to .
Instant TV Channel
Instant TV Channel is a cloud-based tool for Roku developers and content providers that shortens development time and eases maintenance after deployment.