Skip to content

Commit

Permalink
refactor: move _HANDLER to aws env vars
Browse files Browse the repository at this point in the history
  • Loading branch information
dnalborczyk committed Jul 23, 2022
1 parent 76a60d7 commit 3c92cd4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/lambda/LambdaFunction.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,9 @@ export default class LambdaFunction {

// based on:
// https://github.com/serverless/serverless/blob/v1.50.0/lib/plugins/aws/invokeLocal/index.js#L108
#getAwsEnvVars() {
#getAwsEnvVars(handler) {
return {
_HANDLER: handler,
AWS_DEFAULT_REGION: this.#region,
AWS_LAMBDA_FUNCTION_MEMORY_SIZE: this.#memorySize,
AWS_LAMBDA_FUNCTION_NAME: this.#functionName,
Expand All @@ -196,10 +197,9 @@ export default class LambdaFunction {

#getEnv(providerEnv, functionDefinitionEnv, handler) {
return {
...this.#getAwsEnvVars(),
...this.#getAwsEnvVars(handler),
...providerEnv,
...functionDefinitionEnv,
_HANDLER: handler,
IS_OFFLINE: 'true',
}
}
Expand Down

0 comments on commit 3c92cd4

Please sign in to comment.