File tree Expand file tree Collapse file tree 1 file changed +2
-5
lines changed
Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Original file line number Diff line number Diff line change @@ -281,15 +281,12 @@ module.exports = class S3Plugin {
281281 const { clientConfig, cloudfrontInvalidateOptions} = this
282282
283283 if ( cloudfrontInvalidateOptions . DistributionId ) {
284- const { accessKeyId, secretAccessKey} = clientConfig . s3Options
285- const cloudfront = new CloudFront ( )
284+ const { accessKeyId, secretAccessKey, sessionToken } = clientConfig . s3Options
285+ const cloudfront = new CloudFront ( { accessKeyId , secretAccessKey , sessionToken } )
286286
287287 if ( ! _ . isArray ( cloudfrontInvalidateOptions . DistributionId ) )
288288 cloudfrontInvalidateOptions . DistributionId = [ cloudfrontInvalidateOptions . DistributionId ]
289289
290- if ( accessKeyId && secretAccessKey )
291- cloudfront . config . update ( { accessKeyId, secretAccessKey} )
292-
293290 const cloudfrontInvalidations = cloudfrontInvalidateOptions . DistributionId
294291 . map ( ( DistributionId ) => new Promise ( ( resolve , reject ) => {
295292 cloudfront . createInvalidation ( {
You can’t perform that action at this time.
0 commit comments