https://github.com/architect/plugin-storage-private
Architect serverless framework macro that defines any number of arbitrary private S3 buckets
https://github.com/architect/plugin-storage-private
Last synced: about 1 year ago
JSON representation
Architect serverless framework macro that defines any number of arbitrary private S3 buckets
- Host: GitHub
- URL: https://github.com/architect/plugin-storage-private
- Owner: architect
- License: apache-2.0
- Created: 2019-07-25T03:37:10.000Z (almost 7 years ago)
- Default Branch: main
- Last Pushed: 2022-02-16T04:31:55.000Z (over 4 years ago)
- Last Synced: 2025-04-15T12:08:29.527Z (about 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 31.3 KB
- Stars: 4
- Watchers: 3
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- Changelog: changelog.md
- Contributing: .github/contributing.md
- License: LICENSE
- Code of conduct: .github/code_of_conduct.md
Awesome Lists containing this project
README
[
](https://www.npmjs.com/package/@architect/architect)
## [`@architect/plugin-storage-private`](https://www.npmjs.com/package/@architect/plugin-storage-private)
> Architect serverless framework plugin that defines any number of arbitrary **private** S3 buckets for your application
[`@architect/plugin-storage-private`](https://www.npmjs.com/package/@architect/plugin-storage-private) provisions **private** S3 buckets for your application. If you need to provision **public** S3 buckets, check out [`@architect/plugin-storage-public`](https://www.npmjs.com/package/@architect/plugin-storage-public).
## Installation
1. Run: `npm i @architect/plugin-storage-private`
2. Then add the following line to the `@plugins` pragma in your Architect project manifest (usually `.arc`):
> Note, no `@` in the plugin name!
```
@plugins
architect/plugin-storage-private
```
3. Add a new `@storage-private` pragma
Define any number of S3 bucket names within `@storage-private`; the following characters are allowed: `[a-zA-Z0-9_-]`
```
@storage-private
sensitive-data
secureinfo
```
## Accessing your bucket names
- CloudFormation provisions these buckets, and by default your bucket name will be reformatted and provided a GUID by AWS
- Thus, to deterministically access your bucket name, your Lambdas will be assigned a `ARC_STORAGE_PRIVATE_` env var (with any dashes converted to underscores)
- Example: your app is named `myapp`, and your bucket is named `sensitive-data` in your `app.arc` file
- Your Lambda(s) would read the `ARC_STORAGE_PRIVATE_SENSITIVE_DATA` env var (which would be assigned a value similar to `myappstaging-sensitivedatabucket-1f8394rh4qtvb`)