JSPM

  • Created
  • Published
  • Downloads 28483
  • Score
    100M100P100Q151347F
  • License MIT

A plugin to sync local directories and S3 prefixes for Serverless Framework.

Package Exports

  • serverless-s3-sync

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (serverless-s3-sync) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Serverless S3 Sync

A plugin to sync local directories and S3 prefixes for Serverless Framework.

Install

Run npm install in your Serverless project.

$ npm install --save serverless-s3-sync

Add the plugin to your serverless.yml file

plugins:
  - serverless-s3-sync

Setup

custom:
  s3Sync:
    - bucketName: my-static-site-assets # required
      bucketPrefix: assets/ # optional
      localDir: dist/assets # required
    - 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

Usage

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

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