From 5d991cc49aafc5227e1416804987a53e0292fbea Mon Sep 17 00:00:00 2001 From: Roberto Tyley Date: Fri, 24 May 2024 15:55:22 +0100 Subject: [PATCH] Update Lambda runtime and CI to Java 21 As suggested in https://github.com/guardian/anghammarad/pull/209#discussion_r1613508588, we want the Lambda runtime to match the Java version used by developers. I've also updated CI to use Java 21. Ideally, we wouldn't have to do this separately anymore, as setup-java has added partial support for asdf's .tool-versions file with https://github.com/actions/setup-java/pull/606, but unfortunately https://github.com/actions/setup-java/issues/615 means that it won't work with Corretto version numbers. --- .github/workflows/ci.yml | 6 +++--- cloudformation/cfn.yaml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bfa2c05..bb82b15 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,10 +24,10 @@ jobs: # Configuring caching is also recommended. # See https://github.com/actions/setup-java - - name: Setup Java 11 - uses: actions/setup-java@v3 + - name: Setup Java + uses: actions/setup-java@v4 with: - java-version: '11' + java-version: '21' distribution: 'corretto' cache: 'sbt' diff --git a/cloudformation/cfn.yaml b/cloudformation/cfn.yaml index 3c11348..04bdecf 100644 --- a/cloudformation/cfn.yaml +++ b/cloudformation/cfn.yaml @@ -61,7 +61,7 @@ Resources: - s3:GetObject Resource: !Sub arn:aws:s3:::${ConfigBucket}/* Handler: com.gu.anghammarad.Lambda::handleRequest - Runtime: java11 + Runtime: java21 MemorySize: 512 Timeout: 30 CodeUri: