2.2.0 • Published 2 months ago

cloudfront-invalidate-cache v2.2.0

Weekly downloads
113
License
MIT
Repository
github
Last release
2 months ago

cloudfront-invalidate-cache

Simple CLI to invalidate cache for AWS CloudFront. You can create invalidation with CNAME.

npm NPM Build Status Coverage Status

Installation

npm install cloudfront-invalidate-cache --save

Also, you can install with -g (global) option. Alternatively, you can use npx to run it without installing.

AWS permissions

You need 2 permissions to run cloudfront-invalidate-cache.

  • cloudfront:CreateInvalidation
  • cloudfront:ListDistributions

The minimum policy to run is below.

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

Usage

cloudfront-invalidate-cache --cname your.domain.example.com

Or, without installing,

npx cloudfront-invalidate-cache --cname your.domain.example.com

Argument

cloudfront-invalidate-cache has only one argument.

--cname <domain name> (require)

CNAME alias for the distribution.

APIs

const { invalidateCache } = require('cloudfront-invalidate-cache');

invalidateCache('your.domain.example.com')
  .then(() => {
    console.log('done!');
  })
  .catch(err => {
    console.error(err);
  });
2.2.0

2 months ago

2.1.0

3 years ago

2.0.0

4 years ago

1.1.6

4 years ago

1.1.5

4 years ago

1.1.4

4 years ago

1.1.3

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago