aws-cloudfront-invalidator
Version:
A CLI tool that invalidates CloudFront distributions based on the S3 origin
48 lines (30 loc) • 1.36 kB
Markdown
**Forked from cloudfront-invalidator**
A command line tool that invalidates the cache of a web hosting CloudFront distribution by providing a S3 Bucket name.
install globally via npm:
```
npm i -g aws-cloudfront-invalidator
```
This program will assume the AWS region to be defined as a global variable.
If the region is not defined as a global variable, then it will retrieve the region from the ~/.aws/credentials or the ~/.aws/config.
You can read more about how the aws-sdk handles the region [here](https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/setting-region.html#setting-region-order-of-precedence)
Easiest way to switch/modify the region would be to set the AWS_REGION global variable
~~~
export AWS_REGION=<your region>
// example:
export AWS_REGION=us-west-2
~~~
Examples:
~~~bash
cloudfront-invalidator -b [s3 bucket name]
~~~
* [aws-sdk](https://aws.amazon.com/sdk-for-node-js/) - SDK for managing AWS resources
* [Commander](https://github.com/tj/commander.js/) - Tooling to create CLI tools with node.js
* **Qais Aboujaoude**
* **Eric Swann**
This project is licensed under the Mozilla Public License MPL License - see the [LICENSE.md](LICENSE.md) file for details