diff --git a/lib/plugins/aws/invokeLocal/index.js b/lib/plugins/aws/invokeLocal/index.js index 7cff69b9502..42d5e8ab6e4 100644 --- a/lib/plugins/aws/invokeLocal/index.js +++ b/lib/plugins/aws/invokeLocal/index.js @@ -53,7 +53,7 @@ class AwsInvokeLocal { loadEnvVars() { const lambdaName = this.options.functionObj.name; - const MemorySize = Number(this.options.functionObj.memorySize) + const memorySize = Number(this.options.functionObj.memorySize) || Number(this.serverless.service.provider.memorySize) || 1024; @@ -68,7 +68,7 @@ class AwsInvokeLocal { AWS_LAMBDA_LOG_GROUP_NAME: this.provider.naming.getLogGroupName(lambdaName), AWS_LAMBDA_LOG_STREAM_NAME: '2016/12/02/[$LATEST]f77ff5e4026c45bda9a9ebcec6bc9cad', AWS_LAMBDA_FUNCTION_NAME: lambdaName, - AWS_LAMBDA_FUNCTION_MEMORY_SIZE: MemorySize, + AWS_LAMBDA_FUNCTION_MEMORY_SIZE: memorySize, AWS_LAMBDA_FUNCTION_VERSION: '$LATEST', NODE_PATH: '/var/runtime:/var/task:/var/runtime/node_modules', };