Skip to content
This repository was archived by the owner on Apr 2, 2020. It is now read-only.

Commit 86039f6

Browse files
authored
Merge pull request #8 from neilime/patch-1
Added condition to accept bucketName
2 parents 87df0f1 + abea823 commit 86039f6

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,9 @@ backend:
9090
runtime: nodejs10.x # The runtime for the lambda. Only nodejs10.x or nodejs8.10 are allowed
9191
memory: 128
9292
timeout: 10
93-
description: A function for the registry backend.
93+
description: A function for the registry backend.
94+
bucketName: myBucket # (Optional) The Bucket name where `src` files/folder will be upload.
95+
# If not provided, it will create random bucket name prefixed by `backend-`
9496
env:
9597
TABLE_NAME: my-table
9698

serverless.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ class Backend extends Component {
2525
async default(inputs = {}) {
2626
this.context.status('Deploying')
2727

28+
inputs.bucketName = inputs.bucketName || 'backend-' + this.context.resourceId()
2829
inputs.region = inputs.region || 'us-east-1'
2930

3031
// Default to current working directory
@@ -78,7 +79,7 @@ class Backend extends Component {
7879

7980
this.context.status('Deploying AWS S3 Bucket')
8081
const bucketOutputs = await bucket({
81-
name: 'backend-' + this.context.resourceId(),
82+
name: inputs.bucketName,
8283
region: inputs.region
8384
})
8485

0 commit comments

Comments
 (0)