gulp-invalidate-cloudfront

A gulp plugin to invalidate files in a cloudfront distribution

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
gulp-invalidate-cloudfront
950.1.29 years ago9 years agoMinified + gzip package size for gulp-invalidate-cloudfront in KB

Readme

gulp-invalidate-cloudfront
Invalidate cloudfront files

Install

npm install gulp-invalidate-cloudfront --save-dev

Usage

var gulp = require('gulp');
var cloufront = require('gulp-invalidate-cloudfront');

var invalidationBatch = {
    CallerReference: new Date().now().toString(),
    Paths: {
        Quantity: 1,
        Items: ['/index.html/']
    }
};

var awsSettings = {
    credentials: {
        accessKeyId: 'aaaa',
        secretKeyId: 'bbbb'
    },
    distributionId: 'EAKJKJSS',
    region: 'us-east-1'
};

gulp.task('deploy', function() {
    return gulp.src(['**/*.js'])
               .pipe(cloudfront(invalidationBatch, awsSettings));
});