Skip to content

Updates Lambda runtime to nodejs16.x #131

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
36 changes: 17 additions & 19 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ on:
jobs:
build:
runs-on: ubuntu-latest
container: public.ecr.aws/sam/build-nodejs14.x:latest
container: public.ecr.aws/sam/build-nodejs16.x:latest
steps:
- name: Install yarn
run: npm install --global [email protected].17
run: npm install --global [email protected].18

- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Cache
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: |
.yarn
Expand All @@ -30,7 +30,7 @@ jobs:
yarn workspace @millihq/tf-next-image-optimization build

- name: Artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: lambda
path: |
Expand All @@ -40,7 +40,7 @@ jobs:

test-integration:
runs-on: ubuntu-latest
container: public.ecr.aws/sam/build-nodejs14.x:latest
container: public.ecr.aws/sam/build-nodejs16.x:latest

services:
s3:
Expand All @@ -51,12 +51,12 @@ jobs:

steps:
- name: Install yarn
run: npm install --global [email protected].17
run: npm install --global [email protected].18

- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Cache
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: |
.yarn
Expand Down Expand Up @@ -93,15 +93,13 @@ jobs:
brew install aws-sam-cli
sam --version

- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Cache
uses: actions/cache@v2
- name: Setup node
uses: actions/setup-node@v3
with:
path: |
.yarn
**/node_modules
key: e2e-${{ hashFiles('yarn.lock') }}
node-version: '16'
cache: 'yarn'

- name: Install dependencies
run: yarn install --frozen-lockfile --check-files
Expand Down Expand Up @@ -131,16 +129,16 @@ jobs:
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*

- name: Setup node
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: '14'
node-version: '16'
cache: 'yarn'

- name: Install dependencies
run: yarn --frozen-lockfile

- name: Download build artifact
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: lambda
path: lib
Expand Down
14 changes: 6 additions & 8 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Cache
uses: actions/cache@v2
- name: Setup node
uses: actions/setup-node@v3
with:
path: |
.yarn
**/node_modules
key: ${{ runner.os }}-${{ hashFiles('yarn.lock') }}
node-version: '16'
cache: 'yarn'

- name: Install Dependencies
run: yarn --frozen-lockfile --cache-folder .yarn
Expand All @@ -37,7 +35,7 @@ jobs:
container: hashicorp/terraform
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Lint Terraform
run: terraform fmt -check -recursive -diff
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
steps:
# Do a full checkout (all branches)
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0

Expand Down
2 changes: 1 addition & 1 deletion buildimage.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Since it is intended to run on Amazon Linux we need to install binaries
# for the internally used sharp package that match this distribution

FROM amazon/aws-sam-cli-emulation-image-nodejs14.x
FROM amazon/aws-sam-cli-emulation-image-nodejs16.x

# Install yarn
RUN npm i -g yarn
Expand Down
2 changes: 1 addition & 1 deletion lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"@types/react": "^17.0.3",
"@types/react-dom": "^17.0.3",
"glob": "^7.1.6",
"typescript": "^4.1.3"
"typescript": "^4.6.4"
},
"files": [
"dist.zip",
Expand Down
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ module "image_optimizer" {
function_name = var.deployment_name
description = "Managed by Terraform Next.js image optimizer"
handler = "handler.handler"
runtime = "nodejs14.x"
runtime = "nodejs16.x"
memory_size = var.lambda_memory_size
timeout = var.lambda_timeout
publish = true
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
"release:ci": "release-it --no-increment --no-git.push --ci"
},
"devDependencies": {
"@millihq/sammy": "^2.0.1",
"@millihq/sammy": "^3.0.0",
"@ofhouse/keep-a-changelog": "2.3.0-no-increment-fix",
"@release-it/bumper": "^3.0.1",
"@tsconfig/node14": "^1.0.1",
"@tsconfig/node16": "^1.0.2",
"@types/jest": "^27.0.1",
"@types/mime-types": "^2.1.1",
"@types/node": "^14.0.0",
Expand All @@ -44,10 +44,10 @@
"release-it": "^14.12.3",
"release-it-yarn-workspaces": "^2.0.1",
"ts-jest": "^27.0.5",
"typescript": "^4.6.3"
"typescript": "^4.6.4"
},
"resolutions": {
"aws-sdk": "2.1001.0"
"aws-sdk": "2.1055.0"
},
"release-it": {
"git": {
Expand Down
2 changes: 1 addition & 1 deletion test/e2e.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { extension as extensionMimeType } from 'mime-types';
import { s3PublicDir } from './utils/s3-public-dir';
import { getLocalIpAddressFromHost } from './utils/host-ip-address';

const NODE_RUNTIME = 'nodejs14.x';
const NODE_RUNTIME = 'nodejs16.x';
// Environment variables that should be set in the Lambda environment
const ENVIRONMENT_VARIABLES = {
NODE_ENV: 'production',
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"extends": "@tsconfig/node14/tsconfig.json"
"extends": "@tsconfig/node16/tsconfig.json"
}
2 changes: 1 addition & 1 deletion versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 4.8"
version = ">= 4.15.0"
}
}
}
41 changes: 18 additions & 23 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -782,15 +782,15 @@
dependencies:
node-fetch "^2.0.0"

"@millihq/sammy@^2.0.1":
version "2.0.1"
resolved "https://registry.yarnpkg.com/@millihq/sammy/-/sammy-2.0.1.tgz#3200fbdb58449fd50d5df394dd9f21741650af77"
integrity sha512-6j76MsB5cKWJrlRD4D2bGeI74N1IzeM5PJS4HJWHkZmnhVgkbMxuDOazyS+A0ps8+m8HQ+Wa3n8li5iVGcbjNQ==
"@millihq/sammy@^3.0.0":
version "3.0.0"
resolved "https://registry.yarnpkg.com/@millihq/sammy/-/sammy-3.0.0.tgz#23030fc8168b440781af82777fd3a982993a87cf"
integrity sha512-uYq80ADPvkritON12svv9lIFjaKMH59yyYcdAYIvdQNHjMuH8VY/aGAVKoq3eJrjyG6bm1Ngq+K10CIWLlMHbQ==
dependencies:
aws-sdk "^2.804.0"
aws-sdk "^2.1055.0"
change-case "^4.1.2"
get-port "^5.1.1"
node-fetch "^2.6.1"
node-fetch "^2.6.7"
tmp "^0.2.1"
unzipper "^0.10.11"
yaml "^1.10.0"
Expand Down Expand Up @@ -1048,10 +1048,10 @@
resolved "https://registry.yarnpkg.com/@tootallnate/once/-/once-1.1.2.tgz#ccb91445360179a04e7fe6aff78c00ffc1eeaf82"
integrity sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==

"@tsconfig/node14@^1.0.1":
version "1.0.1"
resolved "https://registry.yarnpkg.com/@tsconfig/node14/-/node14-1.0.1.tgz#95f2d167ffb9b8d2068b0b235302fafd4df711f2"
integrity sha512-509r2+yARFfHHE7T6Puu2jjkoycftovhXRqW328PDXTVGKihlb1P8Z9mMZH04ebyajfRY7dedfGynlrFHJUQCg==
"@tsconfig/node16@^1.0.2":
version "1.0.2"
resolved "https://registry.yarnpkg.com/@tsconfig/node16/-/node16-1.0.2.tgz#423c77877d0569db20e1fc80885ac4118314010e"
integrity sha512-eZxlbI8GZscaGS7kkc/trHTT5xgrjH3/1n2JDwusC9iahPKWMRvRjJSAN5mCXviuTGQ/lHnhvv8Q1YTpnfz9gA==

"@types/[email protected]":
version "8.10.56"
Expand Down Expand Up @@ -1594,10 +1594,10 @@ asynckit@^0.4.0:
resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79"
integrity sha1-x57Zf380y48robyXkLzDZkdLS3k=

aws-sdk@*, aws-sdk@2.1001.0, aws-sdk@^2.804.0:
version "2.1001.0"
resolved "https://registry.yarnpkg.com/aws-sdk/-/aws-sdk-2.1001.0.tgz#c4da256aa0058438ba611ae06fa850f4f7d63abc"
integrity sha512-DpmslPU8myCaaRUwMzB/SqAMtD2zQckxYwq3CguIv8BI+JHxDLeTdPCLfA5jffQ8k6dcvISOuiqdpwCZucU0BA==
aws-sdk@*, aws-sdk@2.1055.0, aws-sdk@^2.1055.0:
version "2.1055.0"
resolved "https://registry.yarnpkg.com/aws-sdk/-/aws-sdk-2.1055.0.tgz#07beb86650d5a313f7c899807c51b12b5e2f4117"
integrity sha512-99drH3mvXakw9we8Rs2cDQmi2pS7PVAC9pvTlB7lHPUwLYftMlko5cFMceZxvTHeyLkdvg98iNIHI3hbnzitoQ==
dependencies:
buffer "4.9.2"
events "1.1.1"
Expand Down Expand Up @@ -6301,15 +6301,10 @@ typedarray-to-buffer@^3.1.5:
dependencies:
is-typedarray "^1.0.0"

typescript@^4.1.3:
version "4.2.3"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.2.3.tgz#39062d8019912d43726298f09493d598048c1ce3"
integrity sha512-qOcYwxaByStAWrBf4x0fibwZvMRG+r4cQoTjbPtUlrWjBHbmCAww1i448U0GJ+3cNNEtebDteo/cHOR3xJ4wEw==

typescript@^4.6.3:
version "4.6.3"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.6.3.tgz#eefeafa6afdd31d725584c67a0eaba80f6fc6c6c"
integrity sha512-yNIatDa5iaofVozS/uQJEl3JRWLKKGJKh6Yaiv0GLGSuhpFJe7P3SbHZ8/yjAHRQwKRoA6YZqlfjXWmVzoVSMw==
typescript@^4.6.4:
version "4.6.4"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.6.4.tgz#caa78bbc3a59e6a5c510d35703f6a09877ce45e9"
integrity sha512-9ia/jWHIEbo49HfjrLGfKbZSuWo9iTMwXO+Ca3pRsSpbsMbc7/IU8NKdCZVRRBafVPGnoJeFL76ZOAA84I9fEg==

unbox-primitive@^1.0.0, unbox-primitive@^1.0.1:
version "1.0.1"
Expand Down