clineamb / gulp-s3-upload

A gulp task to upload/update assets to an S3 account.
62 stars 37 forks source link

Is there a way to pass in AWS SDK config into gulp-s3-upload? #9

Closed chrisyeung1121 closed 9 years ago

chrisyeung1121 commented 9 years ago

?

clineamb commented 9 years ago

I think you need to elaborate a little bit.

As per the docs, everything in the AWS Config Constructor are available when you initialize gulp-s3-upload like so:

var s3 = require('gulp-s3-upload')({
        accessKeyId:        "YOUR DEV ID",
        secretAccessKey:    "YOUR SECRET"
    });

You can pass options like region, httpOptions, etc. in this constructor.

If you want to pass a config file through (like a json file), you can do the following:

var s3config = require('./s3config.js');
var s3 = require('gulp-s3-upload')(s3config);

where s3config.js looks something like this...

module.exports = {
    'accessKeyId': "YOUR DEV ID",
    'secretAccessKey': "YOUR SECRET",
    // etc...
};

Or, if you want to use a module like config (where your config settings are in something like a .yaml file):

var s3config = require('config').AWS;
var s3 = require('gulp-s3-upload')(s3config);

I can help you better if you explain further, but this is what is currently available.