Invalidate cloudfront files
npm install gulp-invalidate-cloudfront --save-dev
var gulp = require('gulp');
var cloudfront = require('gulp-invalidate-cloudfront');
var invalidationBatch = {
CallerReference: new Date().now().toString(),
Paths: {
Quantity: 1,
Items: ['/index.html']
}
};
var awsSettings = {
credentials: {
accessKeyId: 'aaaa',
secretAccessKey: 'bbbb'
},
distributionId: 'EAKJKJSS',
region: 'us-east-1'
};
gulp.task('deploy', function() {
return gulp.src(['**/*.js'])
.pipe(cloudfront(invalidationBatch, awsSettings));
});