Amazon CloudFront
Developer Guide (API Version 2016-09-29)

Creating an AWS CloudFormation Stack for On-Demand Streaming

You use an AWS CloudFormation template to create a stack that creates the AWS resources required by on-demand streaming. These resources include an Amazon EC2 instance, an Amazon S3 bucket, and a CloudFront distribution. (You can optionally use an existing bucket.)


You incur charges for your AWS resources beginning when you create the AWS CloudFormation stack:

  • Hourly charges for the Amazon EC2 instances and the load balancer and monthly charges for CloudWatch continue to accrue until you delete the AWS CloudFormation stack regardless of whether you use the resources to stream video.

  • Usage charges for Amazon S3 and CloudFront depend on how much you use the resources.

When you no longer want to use the resources that the AWS CloudFormation stack creates, delete the stack. This deletes the AWS resources that the stack created, and stops the AWS charges for the resources. (Deleting the stack does not delete the Amazon S3 bucket because the bucket might contain your media files.)

For more information about pricing for AWS resources, see AWS Service Pricing Overview. For more information about how to delete an AWS CloudFormation stack, see Deleting the AWS CloudFormation Stack and Amazon S3 Bucket for On-Demand Streaming. For more information about AWS CloudFormation, see AWS CloudFormation Documentation.

To create an AWS CloudFormation stack for on-demand streaming

  1. To start the Create Stack wizard, choose the link that corresponds with the applicable Amazon EC2 region. Click a link in the first group or the second group depending on whether you want AWS CloudFormation to create an Amazon S3 bucket for you in addition to creating an Amazon EC2 instance and a CloudFront distribution:

    • If you choose a link in the first group, AWS CloudFormation creates an Amazon EC2 instance and an Amazon S3 bucket in the corresponding region. (CloudFront distributions aren't associated with a specific region.)

    • If you choose a link in the second group, AWS CloudFormation creates an Amazon EC2 instance and prompts you to specify the Amazon S3 bucket that you want to use. We recommend that you choose a region in which you already have an Amazon S3 bucket so you aren't charged for transferring data between regions.

    Create all required resources, including a new Amazon S3 bucket for media upload and storage

    Create an Amazon EC2 instance and a CloudFront distribution but use an existing Amazon S3 bucket for media upload and storage

    The wizard starts and the applicable URL automatically appears in the Provide an S3 URL to template field.

  2. If you aren't already signed in to the AWS Management Console, sign in when prompted.

  3. (Optional) Change the Stack Name. The stack name must not contain spaces, and it must be unique within your AWS account.

    Do not change the Template option or the address in Provide an S3 URL to template.

  4. Click Next.

  5. For Amazon EC2KeyPair, enter the name of an Amazon EC2 key pair in the same region that you chose in Step 1. The key pair must be associated with the account that you're currently signed in with. If you created a key pair when you performed the procedure in Creating an Amazon EC2 Key Pair, enter the name of that key pair.

  6. If you chose a link to use an existing Amazon S3 bucket in step 1, enter the name of the bucket in the AmazonS3BucketName field.

  7. For InstanceType, enter an instance type, which determines pricing for your Amazon EC2 instance. For more information about Amazon EC2 instance types, see Available Instance Types in the Amazon EC2 User Guide for Linux Instances.

    For information about pricing, see the Unified Streaming (USP) page on the AWS Marketplace website.

  8. Click Next.

  9. (Optional) On the Options page, add one or more tags. The tags that you specify are applied to the Amazon EC2 instance and the Amazon S3 bucket that AWS CloudFormation creates. However, the tags are not applied to the CF; distribution that AWS CloudFormation creates; AWS CloudFormation does not support adding tags to CloudFront distributions.

  10. (Optional) To configure SNS notification, to specify how long you're willing to wait for the stack to be created, to choose whether to roll back changes if stack creation fails, and to enter a stack policy, choose Advanced, and adjust settings as desired.

  11. Click Next.

  12. Review the settings for the stack. When you're satisfied with the settings, choose Create, and AWS CloudFormation creates the stack.

    Creating your stack might take several minutes. To track the progress of the stack creation, select the stack, and choose the Events tab in the bottom frame. If AWS CloudFormation cannot create the stack, the Events tab lists error messages.

    When your stack is ready, the status for the stack changes to CREATE_COMPLETE.

Next: Verifying that Unified Streaming Server Is Running