Skip to content
This repository

Amazon CloudFront Management Tool

branch: master

Bump version

latest commit 7077fa9924
Alexander Greim authored October 07, 2013
Octocat-spinner-32 bin created the existing project as a gem December 08, 2010
Octocat-spinner-32 lib Bump version October 07, 2013
Octocat-spinner-32 .gitignore bundle gem December 08, 2010
Octocat-spinner-32 Gemfile bundle gem December 08, 2010
Octocat-spinner-32 README.rdoc updated documentation January 14, 2011
Octocat-spinner-32 Rakefile bundle gem December 08, 2010
Octocat-spinner-32 aws-cloudfront.gemspec updated gemspec and bumped to version 0.0.2 January 14, 2011

Amazon CloudFront Management Tool

This tool enables you to manage your CloudFront distributions via Ruby or command line.


gem install aws-cloudfront

General Usage

cloudfront_cmd.rb <parameters> <command>


--access-key <access key>

your AWS access key id

--secret-access-key <secret key>

the corresponding AWS secret access key

--distribution-id <id>

the AWS CloudFront distribution id. It can be found on the AWS Management Console.

Setting a root object

Set the root object that gets returned when the root url of the distribution is called:

cloudfront_cmd.rb <parameters> set_default_root_object <object>

<object> - a file name that exists in the distribution


cloudfront_cmd.rb \
  --distribution-id AB12FWEEXAMPLE \
  --access-key 15B4D3461BDF1EXAMPLE \
  --secret-access-key "AQE0diMbLRepdf3YBDF/EXAMPLE" \
  set_default_root_object "index.html"

Invalidating objects

If an object on S3 gets overwritten by a newer version a redistribution through CloudFront isn't triggered automatically. Therefore you have to invalidate the objects afterwards.

cloudfront_cmd.rb <parameters> invalidate_objects <list of objects>

<list of objects> - space seperated list of absolute path names for files to invalidate


cloudfront_cmd.rb \
  --distribution-id AB12FWEEXAMPLE \
  --access-key 15B4D3461BDF1EXAMPLE \
  --secret-access-key "AQE0diMbLRepdf3YBDF/EXAMPLE" \
  invalidate_objects "/index.html" "/styles.css"


Alexander Greim


Copyright © 2010 il tempo - Alexander Greim, released under the MIT license

Something went wrong with that request. Please try again.