Skip to content

Commit

Permalink
Node 15.0.1, aws-sdk 2.778.0
Browse files Browse the repository at this point in the history
  • Loading branch information
janaz committed Oct 24, 2020
1 parent 23b5bcc commit 03ed582
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 31 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
FROM node:14.11.0-buster-slim@sha256:c253a1a9569e95414f30c6094bdb7f7561c17ad93447d2747405e367066a841a
FROM node:15.0.1-buster-slim@sha256:fc14218ae526b3568ba854732e8fbfe7e67d77769f5c3b17db997983fa571421

RUN apt-get update && apt-get install -y p7zip-full curl xz-utils && apt-get clean all
34 changes: 17 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# AWS Lambda NodeJS-14 Runtime
# AWS Lambda NodeJS-15 Runtime

AWS Lambda runtime API implemented in Node.js. The supported version is usually the latest LTS.

It's easy to use this project and build Node.js runtime that will target any version - just replace the version number in `auto/package` with your preferred one.

## Current versions

* Node.js - **14.13.0**
* aws-sdk - **2.766.0**
* Node.js - **15.0.1**
* aws-sdk - **2.778.0**

## Goals

Expand Down Expand Up @@ -39,8 +39,8 @@ Deploy the runtime layer using the following command:

```bash
aws lambda publish-layer-version \
--layer-name node-14-runtime \
--description "nodejs-14.13.0 aws-cli-2.766.0" \
--layer-name node-15-runtime \
--description "nodejs-15.0.1 aws-cli-2.778.0" \
--compatible-runtimes provided \
--license-info Apache-2.0 \
--zip-file fileb://stage/layer.zip
Expand All @@ -49,14 +49,14 @@ aws lambda publish-layer-version \
The output will look like this:
```json
{
"LayerVersionArn": "arn:aws:lambda:us-east-2:356111732087:layer:node-14-runtime:1",
"Description": "nodejs-14.13.0 aws-cli-2.766.0",
"LayerVersionArn": "arn:aws:lambda:us-east-2:356111732087:layer:node-15-runtime:1",
"Description": "nodejs-15.0.1 aws-cli-2.778.0",
"CreatedDate": "2018-12-02T22:32:00.572+0000",
"LayerArn": "arn:aws:lambda:us-east-2:356111732087:layer:node-14-runtime",
"LayerArn": "arn:aws:lambda:us-east-2:356111732087:layer:node-15-runtime",
"Content": {
"CodeSize": 18104889,
"CodeSha256": "VonrpX23FWJOmE4lvhpox+9PS9kuY4sng0o0wxNTROs=",
"Location": "https://awslambda-us-east-2-layers.s3.us-east-2.amazonaws.com/snapshots/356111732087/node-14-runtime-f3415c38-d865-46b6-ae42-009985092116?......"
"Location": "https://awslambda-us-east-2-layers.s3.us-east-2.amazonaws.com/snapshots/356111732087/node-15-runtime-f3415c38-d865-46b6-ae42-009985092116?......"
},
"Version": 1,
"CompatibleRuntimes": [
Expand All @@ -72,7 +72,7 @@ You can share the layer with other AWS accounts by executing the following comma

```bash
aws lambda add-layer-version-permission \
--layer-name node-14-runtime \
--layer-name node-15-runtime \
--version-number 1 \
--principal "*" \
--statement-id publish \
Expand All @@ -84,7 +84,7 @@ Response:
```json
{
"RevisionId": "8b5b2e27-5013-4983-ac1a-9008dff90bac",
"Statement": "{\"Sid\":\"publish\",\"Effect\":\"Allow\",\"Principal\":\"*\",\"Action\":\"lambda:GetLayerVersion\",\"Resource\":\"arn:aws:lambda:us-east-2:356111732087:layer:node-14-runtime:1\"}"
"Statement": "{\"Sid\":\"publish\",\"Effect\":\"Allow\",\"Principal\":\"*\",\"Action\":\"lambda:GetLayerVersion\",\"Resource\":\"arn:aws:lambda:us-east-2:356111732087:layer:node-15-runtime:1\"}"
}
```

Expand All @@ -103,11 +103,11 @@ Let's assume that your lambda function is packaged as `lambda.zip` file and the
```bash
aws lambda create-function \
--region us-east-2 \
--function-name node-14-runtime-example \
--function-name node-15-runtime-example \
--zip-file fileb://lambda.zip \
--handler hello.handler \
--runtime provided \
--layers "arn:aws:lambda:us-east-2:356111732087:layer:node-14-runtime:2" \
--layers "arn:aws:lambda:us-east-2:356111732087:layer:node-15-runtime:2" \
--role arn:aws:iam::356111732087:role/lambda-role
out.txt
```
Expand All @@ -119,10 +119,10 @@ Let's assume that your lambda function is packaged as `lambda.zip` file and the
"Layers": [
{
"CodeSize": 18104889,
"Arn": "arn:aws:lambda:us-east-2:356111732087:layer:node-14-runtime:1"
"Arn": "arn:aws:lambda:us-east-2:356111732087:layer:node-15-runtime:1"
}
],
"FunctionName": "node-14-runtime-example",
"FunctionName": "node-15-runtime-example",
"LastModified": "2018-12-02T22:59:10.408+0000",
"RevisionId": "32e7e8a1-b5ba-4388-b6be-596278e36126",
"MemorySize": 128,
Expand All @@ -136,7 +136,7 @@ Let's assume that your lambda function is packaged as `lambda.zip` file and the
"CodeSha256": "shSeSmJZHv8Z0WmOAcFcHeSUGbRYRR1cFdbEudkSJHo=",
"Description": "",
"CodeSize": 340,
"FunctionArn": "arn:aws:lambda:us-east-2:356111732087:function:node-14-runtime-example",
"FunctionArn": "arn:aws:lambda:us-east-2:356111732087:function:node-15-runtime-example",
"Handler": "hello.handler"
}
```
Expand All @@ -146,7 +146,7 @@ Let's assume that your lambda function is packaged as `lambda.zip` file and the
```bash
aws lambda invoke \
--region us-east-2 \
--function-name node-14-runtime-example \
--function-name node-15-runtime-example \
--payload '{"hello":"world"}' \
output.txt
Expand Down
4 changes: 2 additions & 2 deletions auto/package
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

set -ex

export NODE_VERSION=14.13.0
export SHA256=8dbf2869033b315de8369405bc3cd5a19fb11afc824fe616640e2743a9a84cc4
export NODE_VERSION=15.0.1
export SHA256=cc9c3eed21755b490e5333ccab208ce15b539c35f64a764eeeae77c58746a7ff

DIR="$( cd "$( dirname "$0" )" && pwd )"

Expand Down
2 changes: 1 addition & 1 deletion auto/package-cmd
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ tar -xJ -f "${tmp_dir}/${node_archive}" --strip 1 -C "${node_dir}"
#prepare staging dir
rm -rf "${stage_dir}"
mkdir -p "${stage_dir}"
cp -a tsconfig.json package.json package-lock.json src/bootstrap src/ "${node_dir}"/bin/node "${stage_dir}/"
cp -a tsconfig.json package.json package-lock.json src/bootstrap src/ "${node_dir}"/bin/node "${stage_dir}"

#compile typescript
cd "${stage_dir}"
Expand Down
4 changes: 2 additions & 2 deletions auto/publish
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ us-west-2
"

TMP="deployment-$(date +%s).txt"
LAYER_NAME=node-14-runtime
LAYER_NAME=node-15-runtime
for R in $REGIONS ; do
echo "Deploying in ${R}"
docker run -e AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY --rm \
Expand All @@ -41,7 +41,7 @@ for R in $REGIONS ; do
lambda publish-layer-version \
--region "${R}" \
--layer-name "${LAYER_NAME}" \
--description "nodejs-14.13.0 aws-cli-2.766.0" \
--description "nodejs-15.0.1 aws-cli-2.766.0" \
--compatible-runtimes provided \
--license-info Apache-2.0 \
--zip-file fileb://stage/layer.zip
Expand Down
12 changes: 6 additions & 6 deletions package-lock.json

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

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
"devDependencies": {
"body-parser": "^1.19.0",
"express": "^4.17.1",
"@types/node": "^14.11.2",
"@types/node": "^14.14.2",
"@types/express": "^4.17.8",
"ts-node": "^9.0.0",
"typescript": "^4.0.3"
},
"dependencies": {
"aws-sdk": "^2.766.0"
"aws-sdk": "^2.778.0"
}
}

0 comments on commit 03ed582

Please sign in to comment.