# cf-invalidate

> Send invalidations to cloudfront distributions that are part of a cloudformation stack

Latest version **1.0.0** (published 2021-12-17) · ISC license · 0 weekly downloads

## Install

```sh
npm install cf-invalidate
pnpm add cf-invalidate
yarn add cf-invalidate
bun add cf-invalidate
```

Provides the command `cf-invalidate`.

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2021-12-17 |
| First published | 2021-12-16 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 10.5 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | joeflateau |
| Maintainers | joeflateau |
| Keywords | cloudfront, cloudformation, cdk, invalidate, invalidation |

## Links

- npm: https://www.npmjs.com/package/cf-invalidate
- Repository: https://github.com/joeflateau/cf-invalidate
- Homepage: https://github.com/joeflateau/cf-invalidate#readme
- Issues: https://github.com/joeflateau/cf-invalidate/issues
- npm.io page: https://npm.io/package/cf-invalidate

## Dependencies (4)

- [aws-sdk](https://npm.io/package/aws-sdk.md) ^2.1046.0
- [fs-extra](https://npm.io/package/fs-extra.md) ^8.1.0
- [commander](https://npm.io/package/commander.md) ^8.3.0
- [release-it](https://npm.io/package/release-it.md) ^14.11.8

## Alternatives

- [@regle/core](https://npm.io/package/@regle/core.md) — 47.0K weekly downloads
- [typeof-arguments](https://npm.io/package/typeof-arguments.md) — 12.5K weekly downloads
- [@lokalise/projects-engine-contracts](https://npm.io/package/@lokalise/projects-engine-contracts.md) — 978 weekly downloads
- [@osjwnpm/nam-laboriosam-quibusdam](https://npm.io/package/@osjwnpm/nam-laboriosam-quibusdam.md) — 70 weekly downloads
- [@oridune/validator](https://npm.io/package/@oridune/validator.md) — 16 weekly downloads

## Recent versions

- 1.0.0 (latest) — 2021-12-17
- 0.0.5 — 2021-12-17
- 0.0.4 — 2021-12-17
- 0.0.3 — 2021-12-16
- 0.0.2 — 2021-12-16
- 0.0.1 — 2021-12-16

## README

# cf-invalidate

Send invalidations to cloudfront distributions that are part of a cloudformation stack

## Installation

I recommend you install this as a dev dependency in your project and run it with npx.

```shell
npm i -D cf-invalidate
npx cf-invalidate MyStack cloudfrontDistributionId
```

You can also install this globally on your system (but I don't recommend it)

```shell
npm i -g cf-invalidate
```

## Usage

```shell
$ npx cf-invalidate --help

Usage: cf-invalidate [options] <stackName> <outputExportName> [invalidationPath...]

Arguments:
  stackName              Cloudformation Stack Name
  outputExportName       Name that the Cloudfront Distribution Id is exported from the stack as
  invalidationPath       Paths on Cloudfront Distibution to invalidate (default: ["/*"])

Options:
  -r, --region <region>  AWS region
  -h, --help             display help for command
```

### Example with CDK

Add a `cdk.CfnOutput` that outputs `cloudfront.Distribution#distributionId`

```typescript
const dist = new cloudfront.Distribution(this, "CFDist", {
  defaultBehavior: {
    origin: new origins.LoadBalancerV2Origin(loadBalancer),
  },
});

new cdk.CfnOutput(this, "CFDistNameOutput", {
  value: dist.distributionId,
  exportName: "cloudfrontDistributionId",
});
```

Run cdk deploy then run cf-invalidate

```shell
npx cdk deploy MyStack
npx cf-invalidate MyStack cloudfrontDistributionId
```

---
_Source: https://npm.io/package/cf-invalidate · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
