Question

Hello there and thanks for reading my question.

I am looking into Amazon Cloudfront (CF) at the moment and need to define exactly the steps to setting up CF with our own origin server before I can proceed past inputting payment details. The basic steps I have been able to find out through Googling are:

  1. Register with CF
  2. Set-up a CF distribution (this is where you register your origin server)
  3. Update your resource references on your site

The problem I am having is with step 2. Although Amazon describe it as a simple API call, I am still not quite sure exactly what this means and what I would have to do to perform this call.

A lot of bloggers/forum posters suggest using a third party software like CloudBerry - the problem is is that CloudBerry costs to do the CF/origin server bit and I only need to do it once (everything else after that can be handled by the AWS management console.

I have looked at loads of other similar pieces of software but have found them to either error on download or on install or not have the functionality I am looking for on the Windows version!

Now, this page describes how to setup the origin server manually (http://docs.amazonwebservices.com/AmazonCloudFront/latest/DeveloperGuide/) but I am still not sure exactly how this is performed.

Has anyone done this before and can offer some guidance or step on how to do this?

Many thanks in advance!

Greg

Was it helpful?

Solution

I had success using Fog gem. Once you establish a connection to the Amazon API, it was painless to create a distribution.

cdn = Fog::AWS::CDN.new(
  :aws_access_key_id => YOUR_ID,
  :aws_secret_access_key => YOUR_SECRET_KEY
)

cdn.post_distribution(options = YOUR_OPTIONS_HASH )

And with that you should receive a 201.

The documentation is great, too.

OTHER TIPS

Cloudbuddy (http://m1.mycloudbuddy.com/downloads.html) is free and you can use it to setup the Cloudfront custom origin. Windows only, unfortunately, but you only have to use it once, right? :-D

This page walks through the custom origin server in a bit more detail http://docs.amazonwebservices.com/AmazonCloudFront/latest/DeveloperGuide/index.html?CreatingDistributions.html. The API call you need to make is to create a new distribution which points at your custom origin server. Basically you would craft the request as described and post it to amazon's web services.

Amazon just updated their CloudFront Management console to support features that were previously only available through their API, so you should be able to configure it without using the API.

http://aws.amazon.com/about-aws/whats-new/2010/11/09/cloudfront-adds-support-for-custom-origins-and-sla/?ref_=pe_2170_19753730

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top