Skip to content

Commit 75fa6af

Browse files
committed
Cleanup
1 parent 0071249 commit 75fa6af

8 files changed

+10
-20
lines changed

Dockerfile_corretto19

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ FROM --platform=linux/amd64 amazonlinux:2
44
RUN rpm --import https://yum.corretto.aws/corretto.key
55
RUN curl -L -o /etc/yum.repos.d/corretto.repo https://yum.corretto.aws/corretto.repo
66

7-
# Update the packages and install Amazon Corretto 18, Maven and Zip
7+
# Update the packages and install Amazon Corretto 19, Maven and Zip
88
RUN yum -y update
99
RUN yum install -y java-19-amazon-corretto-devel maven zip
1010

11-
# Set Java 18 as the default
11+
# Set Java 19 as the default
1212
RUN update-alternatives --set java "/usr/lib/jvm/java-19-amazon-corretto/bin/java"
1313
RUN update-alternatives --set javac "/usr/lib/jvm/java-19-amazon-corretto/bin/javac"
1414

@@ -24,7 +24,7 @@ RUN jdeps -q \
2424
--print-module-deps \
2525
target/lambda-app.jar > jre-deps.info
2626

27-
# Create a slim Java 18 JRE which only contains the required modules to run the function
27+
# Create a slim Java 19 JRE which only contains the required modules to run the function
2828
RUN jlink --verbose \
2929
--compress 2 \
3030
--strip-java-debug-attributes \
@@ -34,7 +34,7 @@ RUN jlink --verbose \
3434
--add-modules $(cat jre-deps.info)
3535

3636
# Use Javas Application Class Data Sharing feature
37-
# It creates the file /jre18-slim/lib/server/classes.jsa
37+
# It creates the file /jre18-custom/lib/server/classes.jsa
3838
RUN /jre-custom/bin/java -Xshare:dump
3939

4040
# Package everything together into a custom runtime archive

Dockerfile_graalvm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ RUN jdeps -q \
4444
--print-module-deps \
4545
target/lambda-app.jar > jre-deps.info
4646

47-
# Create a slim Java 18 JRE which only contains the required modules to run the function
47+
# Create a slim Java 17 GraalVM JRE which only contains the required modules to run the function
4848
RUN jlink --verbose \
4949
--compress 2 \
5050
--strip-java-debug-attributes \
@@ -54,7 +54,7 @@ RUN jlink --verbose \
5454
--add-modules $(cat jre-deps.info)
5555

5656
# Use Javas Application Class Data Sharing feature
57-
# It creates the file /jre18-slim/lib/server/classes.jsa
57+
# It creates the file /jre-custom/lib/server/classes.jsa
5858
RUN /jre-custom/bin/java -Xshare:dump
5959

6060
# Package everything together into a custom runtime archive

build-java17-graalvm.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
#!/bin/sh
22

3+
# Remove a previously created application
34
file1="lambda-app-graalvm.zip"
45
if [ -f "$file1" ] ; then
56
rm "$file1"
67
fi
78

9+
# Remove a previously created custom layer
810
file2="graalvm-layer.zip"
911
if [ -f "$file2" ] ; then
1012
rm "$file2"

build-java19-custom.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
#!/bin/sh
22

3-
# Remove a previously created custom runtime
3+
# Remove a previously created application
44
file1="lambda-app.zip"
55
if [ -f "$file1" ] ; then
66
rm "$file1"
77
fi
88

9+
# Remove a previously created custom layer
910
file2="layer.zip"
1011
if [ -f "$file2" ] ; then
1112
rm "$file2"

lambda-app/src/main/java/com/home/amazon/serverless/DynamoDbWriteHandler.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,6 @@
77
import software.amazon.awssdk.enhanced.dynamodb.DynamoDbEnhancedClient;
88
import software.amazon.awssdk.enhanced.dynamodb.DynamoDbTable;
99
import software.amazon.awssdk.enhanced.dynamodb.TableSchema;
10-
11-
/**
12-
* Lambda function entry point. You can change to use other pojo type or implement
13-
* a different RequestHandler.
14-
*
15-
* @see <a href=https://docs.aws.amazon.com/lambda/latest/dg/java-handler.html>Lambda Java Handler</a> for more information
16-
*/
1710
public class DynamoDbWriteHandler implements RequestHandler<APIGatewayProxyRequestEvent, APIGatewayProxyResponseEvent> {
1811

1912
private final DynamoDbEnhancedClient dynamoDbEnhancedClient = DependencyFactory.dynamoDbEnhancedClient();

template-java11-runtime.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
AWSTemplateFormatVersion: '2010-09-09'
22
Transform: AWS::Serverless-2016-10-31
33
Resources:
4-
# See https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-function.html
5-
# for more info to see how to tune the lambda function configs based on your use case.
64

75
ItemTable:
86
Type: AWS::Serverless::SimpleTable

template-java17-graalvm-runtime.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
AWSTemplateFormatVersion: '2010-09-09'
22
Transform: AWS::Serverless-2016-10-31
33
Resources:
4-
# See https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-function.html
5-
# for more info to see how to tune the lambda function configs based on your use case.
64

75
ItemTable:
86
Type: AWS::Serverless::SimpleTable

template-java19-custom-runtime.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
AWSTemplateFormatVersion: '2010-09-09'
22
Transform: AWS::Serverless-2016-10-31
33
Resources:
4-
# See https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-function.html
5-
# for more info to see how to tune the lambda function configs based on your use case.
64

75
ItemTable:
86
Type: AWS::Serverless::SimpleTable

0 commit comments

Comments
 (0)