Skip to content

Commit

Permalink
fix: Upgrade lambda runtime to node 14.x (philips-labs#1203)
Browse files Browse the repository at this point in the history
* Bump node from 12.x to 14.x for lambdas

Co-authored-by: Niek Palm <[email protected]>

* set node version in .nvmrc to 14

* upgrade terraform version as required by module

Co-authored-by: Niek Palm <[email protected]>
Co-authored-by: Niek Palm <[email protected]>
  • Loading branch information
3 people authored Oct 7, 2021
1 parent e2a4037 commit 570949a
Show file tree
Hide file tree
Showing 18 changed files with 55 additions and 30 deletions.
2 changes: 1 addition & 1 deletion .ci/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#syntax=docker/dockerfile:1.2
FROM node:12 as build
FROM node:14 as build
WORKDIR /lambda
RUN apt-get update \
&& apt-get install -y zip \
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lambda-runner-binaries-syncer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ on:
jobs:
build:
runs-on: ubuntu-latest
container: node:12
container: node:14
defaults:
run:
working-directory: ${{ env.lambda_path }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lambda-runners.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
jobs:
build:
runs-on: ubuntu-latest
container: node:12
container: node:14
defaults:
run:
working-directory: modules/runners/lambdas/runners
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lambda-webhook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
jobs:
build:
runs-on: ubuntu-latest
container: node:12
container: node:14
defaults:
run:
working-directory: modules/webhook/lambdas/webhook
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ jobs:
prepare:
name: Create dist
runs-on: ubuntu-latest
container: node:12
container: node:14
strategy:
matrix:
matrix:
lambda: ["modules/webhook/lambdas/webhook", "modules/runner-binaries-syncer/lambdas/runner-binaries-syncer", "modules/runners/lambdas/runners"]
steps:
- name: Extract lambda name
Expand Down Expand Up @@ -64,14 +64,14 @@ jobs:
appInstallationValue: ${{ github.repository }}

- name: Dry run release
if: github.event_name != 'pull_request'
if: github.event_name != 'pull_request'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Read only token
run: |
cp .release/* .
yarn
yarn release -d --repositoryUrl https://x-access-token:[email protected]/$GITHUB_REPOSITORY.git
- name: Release
if: github.event_name != 'pull_request' && contains('refs/heads/master', github.ref)
env:
Expand Down
27 changes: 14 additions & 13 deletions examples/default/.terraform.lock.hcl

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

2 changes: 1 addition & 1 deletion examples/default/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 3.20"
version = ">= 3.27"
}
local = {
source = "hashicorp/local"
Expand Down
2 changes: 1 addition & 1 deletion examples/permissions-boundary/providers.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
provider "aws" {
alias = "terraform_role"
region = local.aws_region
version = "3.20"
version = "3.60"
assume_role {
role_arn = data.terraform_remote_state.iam.outputs.role
}
Expand Down
2 changes: 1 addition & 1 deletion examples/ubuntu/providers.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
terraform {
required_providers {
aws = {
version = "3.20"
version = "3.27"
}
random = {
version = "3.1.0"
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v12.16.1
v14
2 changes: 1 addition & 1 deletion modules/runner-binaries-syncer/runner-binaries-syncer.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ resource "aws_lambda_function" "syncer" {
function_name = "${var.environment}-syncer"
role = aws_iam_role.syncer_lambda.arn
handler = "index.handler"
runtime = "nodejs12.x"
runtime = "nodejs14.x"
timeout = var.lambda_timeout
memory_size = 256

Expand Down
8 changes: 8 additions & 0 deletions modules/runner-binaries-syncer/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
terraform {
required_providers {
aws = {
source = "aws"
version = ">=3.27"
}
}
}
2 changes: 1 addition & 1 deletion modules/runners/scale-down.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ resource "aws_lambda_function" "scale_down" {
function_name = "${var.environment}-scale-down"
role = aws_iam_role.scale_down.arn
handler = "index.scaleDown"
runtime = "nodejs12.x"
runtime = "nodejs14.x"
timeout = var.lambda_timeout_scale_down
tags = local.tags

Expand Down
2 changes: 1 addition & 1 deletion modules/runners/scale-up.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ resource "aws_lambda_function" "scale_up" {
function_name = "${var.environment}-scale-up"
role = aws_iam_role.scale_up.arn
handler = "index.scaleUp"
runtime = "nodejs12.x"
runtime = "nodejs14.x"
timeout = var.lambda_timeout_scale_up
reserved_concurrent_executions = 1
tags = local.tags
Expand Down
8 changes: 8 additions & 0 deletions modules/runners/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
terraform {
required_providers {
aws = {
source = "aws"
version = ">=3.27"
}
}
}
2 changes: 1 addition & 1 deletion modules/webhook/lambdas/webhook/.nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v12.16.1
v14
8 changes: 8 additions & 0 deletions modules/webhook/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
terraform {
required_providers {
aws = {
source = "aws"
version = ">=3.27"
}
}
}
2 changes: 1 addition & 1 deletion modules/webhook/webhook.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ resource "aws_lambda_function" "webhook" {
function_name = "${var.environment}-webhook"
role = aws_iam_role.webhook_lambda.arn
handler = "index.githubWebhook"
runtime = "nodejs12.x"
runtime = "nodejs14.x"
timeout = var.lambda_timeout

environment {
Expand Down

0 comments on commit 570949a

Please sign in to comment.