var AWS = require('aws-sdk');
var s3 = new AWS.S3();
// creds.fetch() just returns an object with the access key and secret key
AWS.config.update( creds.fetch() );
var s3Stream = require('s3-upload-stream')( s3 );
var up = s3Stream.upload({
Bucket: bucket,
Key: key,
ACL: 'public-read',
StorageClass: 'REDUCED_REDUNDANCY',
ContentType: 'application/javascript'
});
fs.createReadStream( './foo.json' ).pipe( up );
Yields:
ExpiredToken: The provided token has expired.
The creds are good and are tied to an IAM with full S3 access.
Getting a weird token expired error:
Yields:
The creds are good and are tied to an IAM with full S3 access.