aws-cloudfront icon indicating copy to clipboard operation
aws-cloudfront copied to clipboard

Amazon CloudFront Management Tool

= Amazon CloudFront Management Tool

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

== Requirements gem install aws-cloudfront

== General Usage

cloudfront_cmd.rb

=== Parameters

--access-key

your AWS access key id

--secret-access-key

the corresponding AWS secret access key

--distribution-id

the AWS CloudFront distribution id. It can be found on the {AWS Management Console}[https://console.aws.amazon.com/cloudfront/home].

== Setting a root object

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

cloudfront_cmd.rb set_default_root_object

- a file name that exists in the distribution

Example: 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 invalidate_objects

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

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

==Author

{Alexander Greim}[http://github.com/iltempo]

== Copyright

Copyright (c) 2010 {il tempo}[http://github.com/iltempo] - {Alexander Greim}[http://github.com/iltempo], released under the MIT license