Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cloudfrontInvalidateOptions not compatible with s3options.credentials #132

Open
davidstelter opened this issue Mar 30, 2020 · 0 comments
Open

Comments

@davidstelter
Copy link

node version: v12.13.0
webpack-s3-plugin version: 1.0.3
os: macos Mojave

Receiving following error on build:

Missing credentials in config, if using AWS_CONFIG_FILE, set AWS_SDK_LOAD_CONFIG=1

The s3options section supports providing credentials like this:

  s3Options: {
      credentials: new AWS.SharedIniFileCredentials({profile: 'my-profile'})
    },

This works for the S3 calls, but produces an error after the S3 upload if cloudfrontInvalidateOptions is present.

From looking at the source it's clear why, the s3Options.credentials value is simply not considered as a credentials source:

    if (cloudfrontInvalidateOptions.DistributionId) {
      const {accessKeyId, secretAccessKey, sessionToken} = clientConfig.s3Options
      const cloudfront = new CloudFront({accessKeyId, secretAccessKey, sessionToken})

Presumably CloudFront can also use the s3Options.credentials source, if not the documentation should be updated to indicate this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant