Giter VIP home page Giter VIP logo

serverless-deployment-bucket's Introduction

serverless-deployment-bucket

NPM Downloads Build Status Coverage Status

Create and configure the custom Serverless deployment bucket.

Purpose

By default, Serverless creates a bucket with a generated name like <service name>-serverlessdeploymentbuck-1x6jug5lzfnl7 to store your service's stack state. This can lead to many old deployment buckets laying around in your AWS account and your service having more than one bucket created (only one bucket is actually used).

Serverless' AWS provider can be configured to customize aspects of the deployment bucket, such as specifying server-side encryption and a custom deployment bucket name. However, server-side encryption is only applied to the objects that Serverless puts into the bucket and is not applied on the bucket itself. Furthermore, if the bucket name you specify doesn't exist, you will encounter an error like:

Serverless Error ---------------------------------------

  Could not locate deployment bucket. Error: The specified bucket does not exist

This plugin will create your custom deployment bucket if it doesn't exist, and optionally configure the deployment bucket to apply server-side encryption by default on objects, regardless of whether the bucket was created by this plugin and as long as you configure the provider with serverSideEncryption: AES256.

This plugin also provides the optional ability to enable versioning of bucket objects, however this is not enabled by default since Serverless tends to keep its own copies and versions of state.

Install

npm install serverless-deployment-bucket --save-dev

Configuration

Add the plugin to your serverless.yml:

plugins:
  - serverless-deployment-bucket

Configure the AWS provider to use a custom deployment bucket:

provider:
  deploymentBucket:
    name: your-custom-deployment-bucket
    serverSideEncryption: AES256

Optionally add custom configuration properties:

custom:
  deploymentBucket:
    versioning: true
    accelerate: true
    blockPublicAccess: true
    tags:
      - Key: Environment
        Value: production
Property Required Type Default Description
versioning false boolean false Enable versioning on the deployment bucket
accelerate false boolean false Enable acceleration on the deployment bucket
enabled false boolean true Enable this plugin
policy false string Bucket policy as JSON
tags false array Bucket tags as an array of key:value objects
blockPublicAccess false boolean false Block all public access for the deployment bucket

Usage

Configuration of your serverless.yml is all you need.

There are no custom commands, just run: sls deploy

serverless-deployment-bucket's People

Contributors

mikesouza avatar jdrydn avatar dependabot[bot] avatar deslee avatar henriksvensson avatar onhate avatar

Watchers

 avatar

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.