# serverless-deployment-bucket

> Create and configure the Serverless deployment bucket.

Latest version **1.6.0** (published 2022-04-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install serverless-deployment-bucket
pnpm add serverless-deployment-bucket
yarn add serverless-deployment-bucket
bun add serverless-deployment-bucket
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.6.0 |
| Published | 2022-04-23 |
| First published | 2019-02-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 47.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 48 |
| Author | Mike Souza |
| Maintainers | mikesouza |
| Keywords | serverless, serverless framework, serverless plugin, serverless plugins, amazon web services, aws, aws s3, s3, s3 bucket, deployment bucket, serverless bucket, bucket |

## Links

- npm: https://www.npmjs.com/package/serverless-deployment-bucket
- Repository: https://github.com/MikeSouza/serverless-deployment-bucket
- Homepage: https://github.com/MikeSouza/serverless-deployment-bucket#readme
- Issues: https://github.com/MikeSouza/serverless-deployment-bucket/issues
- npm.io page: https://npm.io/package/serverless-deployment-bucket

## Dependencies (1)

- [chalk](https://npm.io/package/chalk.md) ^2.4.2

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 1.6.0 (latest) — 2022-04-23
- 1.5.2 — 2022-02-06
- 1.5.1 — 2021-05-11
- 1.5.0 — 2021-05-11
- 1.4.3 — 2021-04-06
- 1.4.2 — 2021-04-06
- 1.4.1 — 2021-03-29
- 1.4.0 — 2021-03-07
- 1.3.0 — 2020-11-15
- 1.2.0 — 2020-10-20
- 1.1.2 — 2020-04-17
- 1.1.1 — 2020-02-19
- 1.1.0 — 2019-04-26
- 1.0.2 — 2019-04-18
- 1.0.1 — 2019-02-19
- … 1 more at https://npm.io/package/serverless-deployment-bucket/versions

## README

# serverless-deployment-bucket

[![NPM Downloads](https://img.shields.io/npm/dt/serverless-deployment-bucket)](https://www.npmjs.com/package/serverless-deployment-bucket) [![Build Status](https://img.shields.io/github/workflow/status/MikeSouza/serverless-deployment-bucket/Release)](https://github.com/MikeSouza/serverless-deployment-bucket)
[![Coverage Status](https://coveralls.io/repos/github/MikeSouza/serverless-deployment-bucket/badge.svg?branch=master)](https://coveralls.io/github/MikeSouza/serverless-deployment-bucket?branch=master)

Create and configure the custom Serverless deployment bucket.

## Purpose

By default, [Serverless](https://serverless.com) 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](https://serverless.com/framework/docs/providers/aws/guide/serverless.yml), 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:

```text
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. To support the [AWS S3 API](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketEncryption.html) for encryption you can configure this plugin with the following:

For `AES256` server side encryption support:

```yaml
  deploymentBucket:
    name: your-custom-deployment-bucket
    serverSideEncryption: AES256
```

For `aws:kms` server side encryption support:

```yaml
  deploymentBucket:
    name: your-custom-deployment-bucket
    serverSideEncryption: aws:kms
    kmsKeyID: your-kms-key-id
    
For bucket access logging support:

```yaml
  deploymentBucket:
    name: your-custom-deployment-bucket
    accessLog:
      bucket: "the-already-existing-bucket"
      prefix: "prefix-to-use-for-these-logs"
```

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`:

```yaml
plugins:
  - serverless-deployment-bucket
```

Configure the AWS provider to use a custom deployment bucket:

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

Optionally add custom configuration properties:

```yaml
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`

---
_Source: https://npm.io/package/serverless-deployment-bucket · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
