From 31a735f67a3addf2195a95d0fd229d45692d5c0a Mon Sep 17 00:00:00 2001 From: Jerome Van Der Linden Date: Fri, 2 Aug 2024 14:06:57 +0200 Subject: [PATCH 1/2] java 1.8 AL1 is deprecated --- .../amazon/lambda/powertools/testutils/Infrastructure.java | 2 +- .../amazon/lambda/powertools/testutils/JavaRuntime.java | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/powertools-e2e-tests/src/test/java/software/amazon/lambda/powertools/testutils/Infrastructure.java b/powertools-e2e-tests/src/test/java/software/amazon/lambda/powertools/testutils/Infrastructure.java index 28a0f2bb4..b7d3354e1 100644 --- a/powertools-e2e-tests/src/test/java/software/amazon/lambda/powertools/testutils/Infrastructure.java +++ b/powertools-e2e-tests/src/test/java/software/amazon/lambda/powertools/testutils/Infrastructure.java @@ -513,7 +513,7 @@ private Builder() { private JavaRuntime mapRuntimeVersion(String environmentVariableName) { String javaVersion = System.getenv(environmentVariableName); // must be set in GitHub actions - JavaRuntime ret = null; + JavaRuntime ret; if (javaVersion == null) { throw new IllegalArgumentException(environmentVariableName + " is not set"); } diff --git a/powertools-e2e-tests/src/test/java/software/amazon/lambda/powertools/testutils/JavaRuntime.java b/powertools-e2e-tests/src/test/java/software/amazon/lambda/powertools/testutils/JavaRuntime.java index c75682949..9f04831c0 100644 --- a/powertools-e2e-tests/src/test/java/software/amazon/lambda/powertools/testutils/JavaRuntime.java +++ b/powertools-e2e-tests/src/test/java/software/amazon/lambda/powertools/testutils/JavaRuntime.java @@ -17,7 +17,6 @@ import software.amazon.awscdk.services.lambda.Runtime; public enum JavaRuntime { - JAVA8("java8", Runtime.JAVA_8, "1.8"), JAVA8AL2("java8.al2", Runtime.JAVA_8_CORRETTO, "1.8"), JAVA11("java11", Runtime.JAVA_11, "11"), JAVA17("java17", Runtime.JAVA_17, "17"), From d9a165c440fc4b7e71332b67647d0bf8b22c315e Mon Sep 17 00:00:00 2001 From: Jerome Van Der Linden Date: Fri, 2 Aug 2024 15:05:45 +0200 Subject: [PATCH 2/2] remove java8 from sam examples --- docs/core/logging.md | 4 ++-- docs/core/metrics.md | 2 +- docs/core/tracing.md | 4 ++-- examples/powertools-examples-core/gradle/template.yaml | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/core/logging.md b/docs/core/logging.md index 70781b1b2..30ae20a76 100644 --- a/docs/core/logging.md +++ b/docs/core/logging.md @@ -187,7 +187,7 @@ You can also override log level by setting **`POWERTOOLS_LOG_LEVEL`** env var. H Type: AWS::Serverless::Function Properties: ... - Runtime: java8 + Runtime: java11 Environment: Variables: POWERTOOLS_LOG_LEVEL: DEBUG @@ -590,7 +590,7 @@ via `samplingRate` attribute on annotation. Type: AWS::Serverless::Function Properties: ... - Runtime: java8 + Runtime: java11 Environment: Variables: POWERTOOLS_LOGGER_SAMPLE_RATE: 0.5 diff --git a/docs/core/metrics.md b/docs/core/metrics.md index e06ab6d10..5d43e53c0 100644 --- a/docs/core/metrics.md +++ b/docs/core/metrics.md @@ -179,7 +179,7 @@ Setting | Description | Environment variable | Constructor parameter Type: AWS::Serverless::Function Properties: ... - Runtime: java8 + Runtime: java11 Environment: Variables: POWERTOOLS_SERVICE_NAME: payment diff --git a/docs/core/tracing.md b/docs/core/tracing.md index f0c752fba..8e3abe89a 100644 --- a/docs/core/tracing.md +++ b/docs/core/tracing.md @@ -164,7 +164,7 @@ Before your use this utility, your AWS Lambda function [must have permissions](h Type: AWS::Serverless::Function Properties: ... - Runtime: java8 + Runtime: java11 Tracing: Active Environment: @@ -250,7 +250,7 @@ different supported `captureMode` to record response, exception or both. Type: AWS::Serverless::Function Properties: ... - Runtime: java8 + Runtime: java11 Tracing: Active Environment: diff --git a/examples/powertools-examples-core/gradle/template.yaml b/examples/powertools-examples-core/gradle/template.yaml index a717c2998..122c05fcc 100644 --- a/examples/powertools-examples-core/gradle/template.yaml +++ b/examples/powertools-examples-core/gradle/template.yaml @@ -26,7 +26,7 @@ Resources: Properties: CodeUri: . Handler: helloworld.App::handleRequest - Runtime: java8 + Runtime: java8.al2 MemorySize: 512 Environment: # More info about Env Vars: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#environment-object Variables: @@ -43,7 +43,7 @@ Resources: Properties: CodeUri: . Handler: helloworld.AppStream::handleRequest - Runtime: java8 + Runtime: java8.al2 MemorySize: 512 Tracing: Active Environment: