serverless-s3-sync
serverless-s3-sync copied to clipboard
sync wont work
sls s3sync command does not seem to work for me..Help appreciated!!
sls version 1.26.1 python 3.6 "serverless-s3-sync": "^1.4.0"
Config : custom: pythonRequirements: dockerizePip: true defaultStage: dev currentStage: ${opt:stage, self:custom.defaultStage} s3Sync: - bucketName: ${file(configs/config.${self:custom.currentStage}.json):syncBucketName} localDir: required-artifacts/${self:custom.currentStage} # required sse: AES256
Error: $ sls s3sync S3 Sync: Syncing directories and S3 prefixes... ~/node_modules/aws-sdk/lib/request.js:31 throw err; ^
Error: connect ECONNREFUSED 52.216.226.48:443
I am operating behind a corp proxy and have the proxy settings exported in env variables also have
HTTPS_PROXY=<> HTTP_PROXY=<> NPM_CONFIG_PROXY=<>
I would actually label this as "Help wanted" because it not a bug. This should help you: https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/node-configuring-proxies.html.
@alexandrusavin Thank you!
@alexandrusavin @k1LoW You suggesting to edit the module to include this.If so where? I thought it should pick it from env vavriables. Also i am using a serverless python project. I believe its a bug
@gitgoose you are right, this is a bug. The problem is that serverless-s3-sync
plugin is not using the aws sdk provided by serverless api. Ex:
this.provider = this.serverless.getProvider('aws')
const s3 = new this.provider.sdk.S3({
region: this.options.region
})
This will then make sure to consider the HTTP_PROXY
env variable (see here: https://github.com/serverless/serverless/blob/master/lib/plugins/aws/provider/awsProvider.js#L132).
@k1LoW I would change the lable of this issue back to bug
Also, see this as a reference for implementation
this.provider = this.serverless.getProvider('aws')
const s3 = new this.provider.sdk.S3({
region: this.options.region
})
only works with the default profile, it doesn't use region/key/secret from the profile associated in the YML.
@GuidoS @k1LoW I’m preparing a PR. Should be ready in a couple of hours.
Here it is actually https://github.com/k1LoW/serverless-s3-sync/pull/12
I think I found another issue that makes it look like it's not working in #13
@alexandrusavin @GuidoS It still does not seem to work for me beind proxy node_modules/@monolambda/s3/node_modules/aws-sdk/lib/request.js:31 throw err; ^
Error: connect ETIMEDOUT 52.216.161.147:443 at Object._errnoException (util.js:1022:11) at _exceptionWithHostPort (util.js:1044:20) at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1198:14)
@gitgoose can you share the configuration? It should work if you set HTTPS_PROXY.
@k1LoW can you please check this PR https://github.com/k1LoW/serverless-s3-sync/pull/16? It might be related to @gitgoose 's problem.
@alexandrusavin Thank you for your mention !!