Skip to content

Commit

Permalink
Merge pull request #8 from wellcomecollection/rk/move-to-node-20
Browse files Browse the repository at this point in the history
Upgrade to node 20
  • Loading branch information
kenoir authored Feb 10, 2025
2 parents 4a28f73 + 672b8d1 commit 57027e5
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 6 deletions.
6 changes: 5 additions & 1 deletion .buildkite/scripts/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
set -euo pipefail

TERRAFORM_ROLE="arn:aws:iam::760097843905:role/platform-ci"
export AWS_PAGER=""

# Do this here rather than in Dockerfile so we don't install it on every build/test
apt install -y awscli zip
Expand All @@ -16,6 +17,7 @@ cd $ROOT

yarn package
aws s3 cp $ROOT/package.zip "s3://${S3_BUCKET}/${S3_KEY}"

VERSION_ID=$(aws s3api list-object-versions \
--bucket $S3_BUCKET \
--prefix $S3_KEY \
Expand All @@ -28,5 +30,7 @@ aws lambda update-function-code \
--s3-key $S3_KEY \
--s3-object-version $VERSION_ID

aws lambda wait function-updated --function-name $FUNCTION_NAME
aws lambda wait function-updated \
--function-name $FUNCTION_NAME

echo "Deployed function successfully!"
10 changes: 6 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
FROM public.ecr.aws/docker/library/node:18
FROM public.ecr.aws/docker/library/node:20

# Install Terraform (for formatting)
ARG TERRAFORM_VERSION=1.3.6
RUN wget -O /tmp/terraform.zip https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_amd64.zip && \
unzip -q -o /tmp/terraform.zip -d /usr/local/bin
ARG TERRAFORM_VERSION=1.9.8
ARG TERRAFORM_SHA256=186e0145f5e5f2eb97cbd785bc78f21bae4ef15119349f6ad4fa535b83b10df8
RUN curl -L https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_amd64.zip -o /tmp/terraform.zip \
&& echo "${TERRAFORM_SHA256} /tmp/terraform.zip" | sha256sum -c - \
&& unzip /tmp/terraform.zip -d /usr/local/bin

RUN apt update && apt install -y git

Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,8 @@
},
"lint-staged": {
"**/*": "prettier --write --ignore-unknown"
},
"engines": {
"node": ">=20"
}
}
2 changes: 2 additions & 0 deletions terraform/.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 terraform/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module "log_forwarder" {

timeout = 15 * 60 // 15 minutes
memory_size = 512
runtime = "nodejs18.x"
runtime = "nodejs20.x"
forward_logs_to_elastic = false // Prevent loops

vpc_config = {
Expand Down

0 comments on commit 57027e5

Please sign in to comment.