@reapit-cdk/cloudfront-invalidation
CloudFront invalidations are very error prone, making it hard to invalidate distributions reliably. This construct aims to solve this problem by using a step function which is triggered on stack update, and uses exponential backoff to retry the invalidation. Inspired by https://github.com/aws/aws-cdk/issues/15891#issuecomment-1362163142.
Package Installation:
yarn add --dev @reapit-cdk/cloudfront-invalidation
# or
npm install @reapit-cdk/cloudfront-invalidation --save-dev
Usage
import { Stack, App } from 'aws-cdk-lib'
import { Distribution } from 'aws-cdk-lib/aws-cloudfront'
import { HttpOrigin } from 'aws-cdk-lib/aws-cloudfront-origins'
import { CloudfrontInvalidation } from '@reapit-cdk/cloudfront-invalidation'
const app = new App()
const stack = new Stack(app, 'stack-name', {
env: {
region: 'us-east-1', // region must be specified
},
})
const distribution = new Distribution(stack, 'distribution', {
defaultBehavior: {
origin: new HttpOrigin('example.org'),
},
})
new CloudfrontInvalidation(stack, 'invalidation', {
distribution,
items: ['/index.html', '/config.js'], // path patterns you want invalidated
})
Metadata
Release files for reapit-cdk.cloudfront-invalidation 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| reapit-cdk.cloudfront-invalidation-0.1.2.tar.gz | 112.4 kB | Without provenance | Details for reapit-cdk.cloudfront-invalidation-0.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| reapit_cdk.cloudfront_invalidation-0.1.2-py3-none-any.whl | Python 3 | none | any | Details for reapit_cdk.cloudfront_invalidation-0.1.2-py3-none-any.whl |
Total release size: 223.7 kB
Release files / reapit-cdk.cloudfront-invalidation-0.1.2.tar.gz
| Download URL | reapit-cdk.cloudfront-invalidation-0.1.2.tar.gz |
|---|---|
| Size | 112.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
83483e4da270a65041d19afda458a35b0532baed0a10ecf4b64d320702e77e9a
|
|
BLAKE2b-256 checksum How to use checksums |
82d4f5a3bb0d515854e6a820c4294253b7ae45b0454562a4c5aba1edcd138bd6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.10.12
|
Release files / reapit_cdk.cloudfront_invalidation-0.1.2-py3-none-any.whl
| Download URL | reapit_cdk.cloudfront_invalidation-0.1.2-py3-none-any.whl |
|---|---|
| Size | 111.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7a1a1a704879145f49c63597889d2436885007762bcf397cec1149b217f1c56f
|
|
BLAKE2b-256 checksum How to use checksums |
d2b196e07ee0ef09918b222d55bca6ec836b6e8a2200135f19ee321437a5f6fa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.10.12
|
Security for reapit-cdk.cloudfront-invalidation 0.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.