s3-plugin-webpack icon indicating copy to clipboard operation
s3-plugin-webpack copied to clipboard

Slow Uploading to S3 when using IAM Role

Open edwardjlam opened this issue 5 years ago • 4 comments

Complete the following or your issue will be deleted (delete me after)

Please complete these steps and check these boxes (by putting an x inside the brackets) before filing your issue:

  • [x] I have read and understood this plugin's README
  • [x] If filing a bug report, I have included my version of node and s3-plugin-webpack
  • [x] If filing a bug report, I have included which OS (including specific OS version) I am using.
  • [x] If filing a bug report, I have included a minimal test case that reproduces my issue.
  • [x] I understand this is an open-source project staffed by someone with a job and that any help I receive is done on free time. I know I am not entitled to anything and will be polite and courteous.
  • [x] I understand my issue may be closed if it becomes obvious I didn't actually perform all of these steps or the issue is not with the library itself

Thank you for adhering to this process! This ensures that I can pay attention to issues that are relevant and answer questions faster.

Issue Details

If filing a bug report, please include a list of steps that describe how to reproduce the bug you are experiencing. Include your config being passed to the S3Plugin.

Versions used: os: ubuntu 16.04 node: 8.11.4 npm: 6.4.0 webpack: 3.12.0 s3-webpack-plugin: 1.0.0-rc.0

Issue: When uploading to s3 the process is slow when credentials are pulled through the IAM Role meta-data that is associated with the ec2 instance.

Steps to reproduce: Run webpack with the s3-webpack-plugin and attempt to upload to s3 with out providing credentials in either the config file or as an environment variable.

Expected result: uploading of all assets should take the same time when using IAM role or hard coding credentials

Actual results: uploading with the IAM role takes about 4 times as long as hardcoding the Credentials.

edwardjlam avatar Sep 17 '18 18:09 edwardjlam

I have no idea why this would be, any further investigation is welcome.

MikaAK avatar Sep 18 '18 00:09 MikaAK

@eddjlam upgrade your webpack-s3-plugin to 1.0.2, that did the trick for us.

gracefullee avatar Oct 05 '18 20:10 gracefullee

@gracefullee I'm unable to update to 1.0.2 as it has a dependency of webpack4. I've worked around this issue by getting the AWS credentials from the meta data endpoint and placing them in environment variables. the root cause seems to be the AWS STS endpoint

edwardjlam avatar Oct 05 '18 21:10 edwardjlam

Please make a new issue with more info @lasantha57

MikaAK avatar May 20 '19 21:05 MikaAK