Turistforeningen / node-s3-uploader

Flexible and efficient resize, rename, and upload images to Amazon S3 disk storage. Uses the official AWS Node SDK for transfer, and ImageMagick for image processing. Support for multiple image versions targets.
https://www.npmjs.com/package/s3-uploader
MIT License
241 stars 54 forks source link

Configuire cloudFront for AWS-SDK #61

Closed damonYuan closed 8 years ago

damonYuan commented 8 years ago

how to Configuire cloudFront for AWS-SDK?

Starefossen commented 8 years ago

Hi Damon,

I have not tried to use s3-uploader with CloudFront. You can add your own custom AWS configurations and from aws/aws-sdk-js#669 it looks like you could do it like this:

var Upload = require('s3-uploader');

process.env. AWS_ACCESS_KEY_ID = '*****';
process.env. AWS_SECRET_ACCESS_KEY = '*****';

var client = new Upload('my_s3_bucket', {
  aws: {
    path: 'images/',
    endpoint: 'XXXXXXXX.cloudfront.net',
    s3BucketEndpoint: true,
    region: 'us-east-1',
  },
  versions: […]
});
damonYuan commented 8 years ago

let me try it and will let you know the result soon. Thanks for your reply

Starefossen commented 8 years ago

Did it work @damonYuan, if so, can you close this issue?

damonYuan commented 8 years ago

hi Starefossen, it works! Thanks!