fix cloudfront invalidations
This commit is contained in:
parent
e9a0c1c512
commit
0dcbf1da3d
|
@ -2,6 +2,7 @@ const fs = require("fs")
|
||||||
const { join } = require("../../../utilities/centralPath")
|
const { join } = require("../../../utilities/centralPath")
|
||||||
const AWS = require("aws-sdk")
|
const AWS = require("aws-sdk")
|
||||||
const fetch = require("node-fetch")
|
const fetch = require("node-fetch")
|
||||||
|
const uuid = require("uuid")
|
||||||
const { budibaseAppsDir } = require("../../../utilities/budibaseDir")
|
const { budibaseAppsDir } = require("../../../utilities/budibaseDir")
|
||||||
const PouchDB = require("../../../db")
|
const PouchDB = require("../../../db")
|
||||||
const environment = require("../../../environment")
|
const environment = require("../../../environment")
|
||||||
|
@ -13,7 +14,7 @@ async function invalidateCDN(cfDistribution, appId) {
|
||||||
.createInvalidation({
|
.createInvalidation({
|
||||||
DistributionId: cfDistribution,
|
DistributionId: cfDistribution,
|
||||||
InvalidationBatch: {
|
InvalidationBatch: {
|
||||||
CallerReference: appId,
|
CallerReference: `${appId}-${uuid.v4()}`,
|
||||||
Paths: {
|
Paths: {
|
||||||
Quantity: 1,
|
Quantity: 1,
|
||||||
Items: [`/assets/${appId}/*`],
|
Items: [`/assets/${appId}/*`],
|
||||||
|
|
Loading…
Reference in New Issue