cic

cloudfront-invalidate-cli

A CLI for invalidating cloudfront distributions that's a bit easier to use than the official AWS CLI.

Showing:

Popularity

Downloads/wk

434

GitHub Stars

5

Maintenance

Last Commit

5yrs ago

Contributors

2

Package

Dependencies

3

Size (min+gzip)

400.3KB

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

node-cloudfront-invalidate-cli

A CLI for creating invalidations on CloudFront, that's a bit easier to use than the official AWS CLI.

Install

npm install cloudfront-invalidate-cli -g

Use

cf-invalidate [--wait] [--config <AWS config .ini file> --accessKeyId <keyId> --secretAccessKey <key>] -- <distribution> <path>...

# Examples:
cf-invalidate -- ABCDEFGHIJK index.html
cf-invalidate --wait -- ABCDEFGHIJK file1 file2 file3

Use either config ini file or send access and secret keys. If you omit --config, --accessKeyId and --secretAccessKey, it'll use the default method of finding credentials (Environment, INI File, EC2 Metadata Service), which is documented here: docs.aws.amazon.com/AWSJavaScriptSDK/guide/node-configuring.html.

If you use the --wait option, the command will not exit until the invalidation is complete. It does this by polling GetInvalidation after min(60000, 1000ms * 2^iterationCycle) (e.g. it increases the timeout between polls exponentially).

If you use --config, set path to .ini file in format:

[default]
access_key =
secret_key =

This tool needs permission for cloudfront:CreateInvalidation and cloudfront:GetInvalidation.

If there is an error, it exit(1)s, and prints the error message to stderr.

It's not intended to be used programmatically, but if you want:

require("node-cloudfront-invalidate-cli")("ABCDEFGHIJK", ["file1", "file2", "file3"], {wait: true}, function (err) {
    console.log(err || "Success");
});

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100