Using Amazon CloudFront with Roku

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.

To use Amazon CloudFront with Instant TV Channel, you will:

  • Store the original versions of your poster artwork or streams on one or more origin servers. An origin server is the location of the definitive version of the file, and can be your own hosted web server, or it could be an Amazon S3 bucket. The walk-through below will cover using an S3 bucket as 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.
A note about Amazon AWS pricing: Amazon's CloudFront and S3 pricing are separate from Instant TV Channel's monthly charges. Amazon has a Free Tier for new customers which may include some or all of your CloudFront and S3 charges. All Amazon CloudFront and S3 charges are billed directly from Amazon, and are dependent mainly on the sizes of the files, how often they are accessed, and the location that they are accessed from. For example, Amazon will bill you approximately $0.00005 for each download or use of a 500KB file within the continental United States, and Amazon will bill you approximately $0.05 (five cents) for each download or use of a 500MB file within the continental United States.

DISCLAIMER: Instant TV Channel cannot guarantee that this AWS pricing information is accurate or complete. Please visit Amazon at http://aws.amazon.com/cloudfront/pricing/ or http://aws.amazon.com/s3/pricing/ for current pricing.

Create an Amazon S3 bucket to use as an origin server:

  1. Log into your AWS (Amazon Web Services) account and go to the S3 section of your AWS control panel.
  2. Click the Create Bucket button.
  3. 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 "+")

  4. The bucket Region should be set to "US East (N. Virginia)".
  5. 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:

  1. Log into your AWS (Amazon Web Services) account and go to the CloudFront section of your AWS control panel.
  2. From the left-hand Navigation panel, click Distributions.
  3. Click the Create Distribution button.
  4. Under Origin domain, click in the Choose origin domain box, and select the S3 bucket previously created to use as the origin server for this CloudFront distribution.
  5. Under Origin access, select Legacy access identities.
  6. Under Origin access, locate the Origin access identity setting and select "Create new OAI", then click "Create".
  7. Under Origin access, locate the Bucket policy setting and select "Yes, update the bucket policy".
  8. Under Web Application Firewall (WAF), select "Do not enable security protections".
  9. In the Description box, enter a comment to identify this CloudFront Distribution, for example "My 1st CloudFront Distribution".
  10. Click the Create Distribution button.
  11. From the left-hand Navigation panel, click Distribution again.
  12. Click the row containing the Distribution that you just created.
  13. Record the Distribution domain name which will look something like this: d77m7fxh64v63a.cloudfront.net. The domain name will be used to access your CloudFront content from your Roku channel.
  14. 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 "d77m7fxh64v63a.cloudfront.net", then the URL that would be used to access the poster is: http://d77m7fxh64v63a.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 is a cloud-based tool for Roku developers and content providers that shortens development time and eases maintenance after deployment.


Subtitles

If you are considering subtitles for your Roku video content, our sister-site InstantSubtitles.com provides an easy-to-use and inexpensive solution. Click here for more information.




Access Code: ID1
Check out Instant TV Channel by adding our latest demonstration channel to your Roku player.



Instant TV Channel is not affiliated with nor endorsed by Roku Inc.