0.3.0 • Published 4 years ago

serverless-sync-s3 v0.3.0

Weekly downloads
8
License
MIT
Repository
github
Last release
4 years ago

Serverless Sync S3 npm

A plugin to sync local directories and S3 prefixes for Serverless Framework. Based on the great plugin serverless-sync-s3 however, it is using aws-sdk to put the objects into s3 instead of @auth/s3 package.

Use Case

  • Static Website ( serverless-sync-s3 ) & Contact form backend ( serverless ) .
  • SPA ( serverless ) & assets ( serverless-sync-s3 ) .

Install

Run npm install in your Serverless project.

$ npm install --save serverless-sync-s3

Add the plugin to your serverless.yml file

plugins:
  - serverless-sync-s3

Setup

custom:
  syncS3:
    - bucketName: my-static-site-assets
      localDir: dist/assets
    - bucketName: my-other-site
      localDir: path/to/other-site

resources:
  Resources:
    AssetsBucket:
      Type: AWS::S3::Bucket
      Properties:
        BucketName: my-static-site-assets
    OtherSiteBucket:
      Type: AWS::S3::Bucket
      Properties:
        BucketName: my-other-site
        AccessControl: PublicRead
        WebsiteConfiguration:
          IndexDocument: index.html
          ErrorDocument: error.html

Usage

Run sls deploy, local directories and S3 prefixes are synced.

Run sls remove, S3 objects in S3 prefixes are removed.

sls syncS3

Sync local directories and S3 prefixes.

0.3.0

4 years ago

0.2.0

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago