Skip to content

Commit a77d91d

Browse files
authored
add BUCKET_MARKER_LOCAL config (#215)
1 parent 360add9 commit a77d91d

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ custom:
150150
see [LocalStack repo](https://github.com/localstack/localstack)
151151
* `LAMBDA_REMOTE_DOCKER`: Whether to assume that we're running Lambda containers against
152152
a remote Docker daemon (default `false`) - see [LocalStack repo](https://github.com/localstack/localstack)
153+
* `BUCKET_MARKER_LOCAL`: Magic S3 bucket name for Lambda mount and [Hot Reloading](https://docs.localstack.cloud/user-guide/tools/lambda-tools/hot-reloading/).
153154

154155
### Only enable serverless-localstack for the listed stages
155156
* ```serverless deploy --stage local``` would deploy to LocalStack.
@@ -205,6 +206,7 @@ custom:
205206
206207
## Change Log
207208
209+
* v1.0.6: Add `BUCKET_MARKER_LOCAL` configuration for customizing S3 bucket for lambda mount and [Hot Reloading](https://docs.localstack.cloud/user-guide/tools/lambda-tools/hot-reloading/).
208210
* v1.0.5: Fix S3 Bucket LocationConstraint issue when the provider region is `us-east-1`
209211
* v1.0.4: Fix IPv4 fallback check to prevent IPv6 connection issue with `localhost` on macOS
210212
* v1.0.3: Set S3 Path addressing for internal Serverless Custom Resources - allow configuring S3 Events Notification for functions

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "serverless-localstack",
3-
"version": "1.0.5",
3+
"version": "1.0.6",
44
"description": "Connect Serverless to LocalStack!",
55
"main": "src/index.js",
66
"scripts": {

src/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,8 @@ class LocalstackPlugin {
196196
Object.keys(resources).forEach(id => {
197197
const res = resources[id];
198198
if (res.Type === 'AWS::Lambda::Function') {
199-
res.Properties.Code.S3Bucket = '__local__';
199+
// TODO: change the default BUCKET_MARKER_LOCAL to 'hot-reload'
200+
res.Properties.Code.S3Bucket = process.env.BUCKET_MARKER_LOCAL || '__local__'; // for now, the default is still __local__
200201
res.Properties.Code.S3Key = process.cwd();
201202
const mountCode = this.config.lambda.mountCode;
202203
if (typeof mountCode === 'string' && mountCode.toLowerCase() !== 'true') {

0 commit comments

Comments
 (0)