Skip to content

add BUCKET_MARKER_LOCAL config #215

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ custom:
see [LocalStack repo](https://github.com/localstack/localstack)
* `LAMBDA_REMOTE_DOCKER`: Whether to assume that we're running Lambda containers against
a remote Docker daemon (default `false`) - see [LocalStack repo](https://github.com/localstack/localstack)
* `BUCKET_MARKER_LOCAL`: Magic S3 bucket name for Lambda mount and [Hot Reloading](https://docs.localstack.cloud/user-guide/tools/lambda-tools/hot-reloading/).

### Only enable serverless-localstack for the listed stages
* ```serverless deploy --stage local``` would deploy to LocalStack.
Expand Down Expand Up @@ -205,6 +206,7 @@ custom:

## Change Log

* 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/).
* v1.0.5: Fix S3 Bucket LocationConstraint issue when the provider region is `us-east-1`
* v1.0.4: Fix IPv4 fallback check to prevent IPv6 connection issue with `localhost` on macOS
* v1.0.3: Set S3 Path addressing for internal Serverless Custom Resources - allow configuring S3 Events Notification for functions
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "serverless-localstack",
"version": "1.0.5",
"version": "1.0.6",
"description": "Connect Serverless to LocalStack!",
"main": "src/index.js",
"scripts": {
Expand Down
3 changes: 2 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,8 @@ class LocalstackPlugin {
Object.keys(resources).forEach(id => {
const res = resources[id];
if (res.Type === 'AWS::Lambda::Function') {
res.Properties.Code.S3Bucket = '__local__';
// TODO: change the default BUCKET_MARKER_LOCAL to 'hot-reload'
res.Properties.Code.S3Bucket = process.env.BUCKET_MARKER_LOCAL || '__local__'; // for now, the default is still __local__
res.Properties.Code.S3Key = process.cwd();
const mountCode = this.config.lambda.mountCode;
if (typeof mountCode === 'string' && mountCode.toLowerCase() !== 'true') {
Expand Down