npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

serverless-s3-replication-plugin

v1.1.0

Published

A plugin to setup replication across AWS S3 buckets

Downloads

154

Readme

Serverless S3 replication plugin

serverless Coverage Status

This is a serverless plugin to easily setup replications between AWS S3 buckets. The plugin allows you to set up single direction and/or bidirectional replication.

The plugin will wait until all buckets from the configuration exist. If they all succeed, the plugin will modify the configured S3 buckets and add replication to them. Also, the required IAM roles will automatically be created for you. The IAM role follows the best practice to only have the permissions to resources it really needs. There will be a unique IAM role in each region.

Install

npm install --save-dev serverless-s3-replication-plugin

Usage

  1. Configure the plugin in your serverless.yml
plugins:
- serverless-s3-replication-plugin
  1. Add the configuration for the plugin

2.1. Single direction replication example

custom:
  s3ReplicationPlugin:
    singleDirectionReplication:
      - sourceBucket:
          eu-west-1: my-bucket-jlsadjklsd-eu-west-1
        targetBuckets:
          - eu-west-2: my-bucket-jlsadjklsd-eu-west-2
          - eu-west-1: my-bucket-jlsadjklsd-sec-eu-west-1
      - sourceBucket:
          eu-central-1: my-bucket-jlsadjklsd-eu-central-1
        targetBuckets:
          - eu-west-1: my-bucket-jlsadjklsd-eu-west-1

2.2. Bidirectional replication example

custom:
  s3ReplicationPlugin:
    bidirectionalReplicationBuckets:
      - eu-west-1: my-bucket-jlsadjklsd-eu-west-1
      - eu-central-1: my-bucket-jlsadjklsd-eu-central-1
      - us-east-1: my-bucket-jlsadjklsd-us-east-1

2.3. Hybrid architecture with bidirectional and single direction replication

custom:
  s3ReplicationPlugin:
    singleDirectionReplication:
      - sourceBucket: 
          eu-west-1: my-bucket-jlsadjklsd-eu-west-1
        targetBuckets: 
          - eu-west-2: my-bucket-jlsadjklsd-eu-west-2
          - eu-west-1: my-bucket-jlsadjklsd-sec-eu-west-1
      - sourceBucket: 
          eu-central-1: my-bucket-jlsadjklsd-eu-central-1
        targetBuckets: 
          - eu-west-1: my-bucket-jlsadjklsd-eu-west-1
    bidirectionalReplicationBuckets:
      - eu-west-1: my-bucket-jlsadjklsd-eu-west-1
      - eu-central-1: my-bucket-jlsadjklsd-eu-central-1
      - us-east-1: my-bucket-jlsadjklsd-us-east-1

Overriding the S3 Replication Role name

The default value of the Replication Role is: ${serviceName}-${sourceRegion}-${sourceBucket}-s3-rep-role. In most cases this default value will work without issue. But if your serviceName or sourceBucket are long, the cloudformation stack will fail with an error similar to:

Error:
ValidationError: 1 validation error detected: Value 'your-long-service-name-eu-west-1-your-long-s3-bucket-name-s3-rep-role' at 'roleName' failed to satisfy constraint: Member must have length less than or equal to 64

To resolve this issue, you can use the replicationRolePrefixOverride configuration to set a default prefix value, which will use the following format: ${replicationRolePrefixOverride}-${sourceRegion}-s3-rep-role.

custom:
  s3ReplicationPlugin:
    singleDirectionReplication:
      - sourceBucket:
          eu-west-1: my-bucket-jlsadjklsd-eu-west-1
        targetBuckets:
          - eu-west-2: my-bucket-jlsadjklsd-eu-west-2
          - eu-west-1: my-bucket-jlsadjklsd-sec-eu-west-1
    replicationRolePrefixOverride: "my-prefix"

This will result in the following replication role names:

  • my-prefix-eu-west-1-s3-rep-role
  • my-prefix-eu-west-2-s3-rep-role