# cdk-cloudfront-invalidator

> An AWS CDK construct that can perform a CloudFront invalidation.

Latest version **1.0.0** (published 2020-11-23) · ISC license · 0 weekly downloads

## Install

```sh
npm install cdk-cloudfront-invalidator
pnpm add cdk-cloudfront-invalidator
yarn add cdk-cloudfront-invalidator
bun add cdk-cloudfront-invalidator
```

## 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 | 2020-11-23 |
| First published | 2020-11-22 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 20.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Maintainers | mpvosseller |
| Keywords | aws, cdk, construct, cloudfront, invalidate, invalidation |

## Links

- npm: https://www.npmjs.com/package/cdk-cloudfront-invalidator
- Repository: https://github.com/mpvosseller/cdk-cloudfront-invalidator
- npm.io page: https://npm.io/package/cdk-cloudfront-invalidator

## 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) — 2020-11-23
- 0.1.3 — 2020-11-22
- 0.1.2 — 2020-11-22
- 0.1.0 — 2020-11-22

## README

# cdk-cloudfront-invalidator

An AWS CDK construct that can perform a CloudFront invalidation.

`CloudFrontInvalidator` is an [AWS CDK](https://aws.amazon.com/cdk) construct that performs
a CloundFront invalidation when it is first created and any time the `hash` property
changes thereafter.

As an example you could perform a CloudFront invalidation any time a Lambda function changes
by setting `hash` to `lambdaFunction.currentVersion.version`.

## Installation

```
npm install cdk-cloudfront-invalidator

# install any peer dependencies not already installed
npm install @aws-cdk/aws-iam @aws-cdk/aws-lambda @aws-cdk/core
```

## Usage

```typescript
import { CloudFrontInvalidator } from 'cdk-cloudfront-invalidator'
import * as cloudfront from '@aws-cdk/aws-cloudfront'

const webDistribution = new cloudfront.CloudFrontWebDistribution(this, 'WebDistribution', {
  //...
})

new CloudFrontInvalidator(this, 'CloudFrontInvalidator', {
  distributionId: webDistribution.distributionId,
  hash: '12345', // set to a string value that changes when you want to perform an invalidation
})
```

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