Skip to content

Commit

Permalink
change layer code to use nodejs18 code instead of 16 when running on …
Browse files Browse the repository at this point in the history
…lambdas with nodejs20
  • Loading branch information
guyrenny committed Aug 25, 2024
1 parent f5afcd4 commit b045849
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
3 changes: 3 additions & 0 deletions src/lambda-secretLayer/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## lambda-secretLayer

### 0.0.3 / 25.8.2024
* [update] Allow the layer to run in nodejs20 applications.

### 0.0.2 / 1.10.2023
* [Change] Change SSM option in the integration to SM - Secret Manager.

Expand Down
4 changes: 2 additions & 2 deletions src/lambda-secretLayer/template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ Metadata:
- lambda
- extension
HomePageUrl: https://coralogix.com
SemanticVersion: 1.0.2
SemanticVersion: 1.0.3
SourceCodeUrl: https://github.com/coralogix/coralogix-aws-serverless
Parameters:
CompatibleRuntimes:
Type: CommaDelimitedList
Description: Lambda Layer Version compatible runtimes
Default: nodejs16.x, nodejs18.x, nodejs14.x
Default: nodejs16.x, nodejs18.x, nodejs14.x, nodejs20.x
RetentionPolicy:
Type: String
Description: Lambda Layer Version retention policy
Expand Down
6 changes: 3 additions & 3 deletions src/lambda-secretLayer/wrapper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

node_version=$(node -e "console.log(process.version)")

if [[ $node_version == v18.* ]]; then
node /opt/wrapper18.js
if [[ $node_version == v16.* || $node_version == v14.* ]]; then
node /opt/wrapper16.js
#cat /tmp/envVars

source /tmp/envVars
else
node /opt/wrapper16.js
node /opt/wrapper18.js
#cat /tmp/envVars

source /tmp/envVars
Expand Down
Binary file modified src/lambda-secretLayer/wrapper.zip
Binary file not shown.

0 comments on commit b045849

Please sign in to comment.