Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
simple gem to invalidate a list of keys in a cloudfront distribution
Ruby
branch: master

Merge pull request #10 from troex/fix-response-formats

update response formats to match current
latest commit f8e5cd2c73
@jelder jelder authored
Failed to load latest commit information.
bin
lib
LICENSE.txt
README.md
cloudfront-invalidator.gemspec

README.md

Usage

invalidator = CloudfrontInvalidator.new(AWS_KEY, AWS_SECRET, CF_DISTRIBUTION_ID)
list = %w[
  index.html
  favicon.ico
]
invalidator.invalidate(list) do |status,time|   # Block is optional.
  invalidator.list                              # Or invalidator.list_detail
  puts "Complete after < #{time.to_f.ceil} seconds." if status == "Complete"
end

A command line utility is also included.

$ cloudfront-invalidator invalidate $AWS_KEY $AWS_SECRET $DISTRIBUTION_ID index.html favicon.ico
$ cloudfront-invalidator list $AWS_KEY $AWS_SECRET $DISTRIBUTION_ID
$ cloudfront-invalidator list_detail $AWS_KEY $AWS_SECRET $DISTRIBUTION_ID

Amazon IAM Policy

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Action": [
        "cloudfront:CreateInvalidation",
        "cloudfront:GetInvalidation",
        "cloudfront:ListInvalidations"
      ],
      "Effect": "Allow",
      "Resource": "*"
    }
  ]
}

Authors

  • Reid M Lynch
  • Jacob Elder
Something went wrong with that request. Please try again.