Coder Social home page Coder Social logo

serverless-s3bucket-sync's Introduction

⚡️ Serverless Plugin for S3 Sync

npm CircleCI license Coveralls

With this plugin for serverless, you can sync local folders to S3 buckets after your service is deployed.

Usage

Add the NPM package to your project:

# Via yarn
$ yarn add serverless-s3bucket-sync

# Via npm
$ npm install serverless-s3bucket-sync

Add the plugin to your serverless.yml:

plugins:
  - serverless-s3bucket-sync

Configuration

Configure S3 Bucket syncing Auto Scaling in serverless.yml with references to your local folder and the name of the S3 bucket.

custom:
  s3-sync:
    - folder: relative/folder
      bucket: bucket-name

That's it! With the next deployment, serverless will sync your local folder relative/folder with the S3 bucket named bucket-name.

Sync

You can use sls sync to synchornize all buckets without deploying your serverless stack.

License

Feel free to use the code, it's released using the MIT license.

Contribution

You are welcome to contribute to this project! 😘

To make sure you have a pleasant experience, please read the code of conduct. It outlines core values and beliefs and will make working together a happier experience.

serverless-s3bucket-sync's People

Contributors

k1low avatar kevinsperrine avatar sbstjn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

serverless-s3bucket-sync's Issues

[help] configure s3 to serve under method

Hi,
sorry if this is not the appropriate place or question to ask.

I'm using serverless-s3bucket-sync to push my static front-end data to s3, that's working as a charm - thank you.
Now I'm asking myself if it's possible to configure serverless to configure a specific path (say /static) to serve files under that bucket that was just uploaded.

Any info would be helpful there as I'm a bit lost on this subject. This seems to be a trivial request but I'm not finding any obvious solution.
Thanks

sls sync deletes the folder in bucket

serverless.yml
...
plugins:

  • serverless-webpack
  • serverless-offline
  • serverless-s3bucket-sync
    custom:
    webpack:
    webpackConfig: 'webpack.config.js'
    includeModules: false
    packager: 'npm'
    s3-sync:
    • folder: blacklist/
      bucket: ${self:service}-${self:provider.stage}-blacklistbucket
      ...

sls sync fails, if there is no folder "blacklist"in bucket
if i create the folder
Serverless: Syncing folder "blacklist/" to S3 bucket "xxx-blacklistbucket"
Serverless: - Done!
but nothing was uploaded , instead previously created folder "blacklist" was deleted

sync wont work

@sbstjn

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=<>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.