Skip to content

Commit

Permalink
Set Java 11 as default and allow Java version via docker build arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
Jithendar12 committed Jan 9, 2025
1 parent a6902f2 commit 92758b0
Show file tree
Hide file tree
Showing 66 changed files with 291 additions and 379 deletions.
10 changes: 9 additions & 1 deletion athena-aws-cmdb/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
FROM public.ecr.aws/lambda/java:17
# Argument for Java version, defaulting to 11
ARG JAVA_VERSION=11
# Use the specified version of Java
FROM public.ecr.aws/lambda/java:${JAVA_VERSION}

# Argument for Java tool options, defaulting to an empty string
ARG JAVA_TOOL_OPTIONS=""
# Set the JAVA_TOOL_OPTIONS environment variable for Java 17
ENV JAVA_TOOL_OPTIONS=${JAVA_TOOL_OPTIONS}

# Copy function code and runtime dependencies from Maven layout
COPY target/athena-aws-cmdb-2022.47.1.jar ${LAMBDA_TASK_ROOT}
Expand Down
10 changes: 0 additions & 10 deletions athena-aws-cmdb/athena-aws-cmdb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,10 @@ Parameters:
Description: "(Optional) An IAM policy ARN to use as the PermissionsBoundary for the created Lambda function's execution role"
Default: ''
Type: String
JavaVersion:
Description: "(Optional) Specify the Java version for the Lambda function. Default is '17'; use '11' for Java 11 or '8' for Java 8."
Type: String
AllowedValues:
- "17"
- "11"
- "8"
Default: "17"
Conditions:
HasPermissionsBoundary: !Not [ !Equals [ !Ref PermissionsBoundaryARN, "" ] ]
IsRegionBAH: !Equals [!Ref "AWS::Region", "me-south-1"]
IsRegionHKG: !Equals [!Ref "AWS::Region", "ap-east-1"]
IsJava17: !Equals [!Ref JavaVersion, "17"]
Resources:
ConnectorConfig:
Type: 'AWS::Serverless::Function'
Expand All @@ -62,7 +53,6 @@ Resources:
disable_spill_encryption: !Ref DisableSpillEncryption
spill_bucket: !Ref SpillBucket
spill_prefix: !Ref SpillPrefix
JAVA_TOOL_OPTIONS: !If [IsJava17, "--add-opens=java.base/java.nio=ALL-UNNAMED", !Ref "AWS::NoValue"]
FunctionName: !Ref AthenaCatalogName
PackageType: "Image"
ImageUri: !Sub
Expand Down
10 changes: 9 additions & 1 deletion athena-clickhouse/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
FROM public.ecr.aws/lambda/java:17
# Argument for Java version, defaulting to 11
ARG JAVA_VERSION=11
# Use the specified version of Java
FROM public.ecr.aws/lambda/java:${JAVA_VERSION}

# Argument for Java tool options, defaulting to an empty string
ARG JAVA_TOOL_OPTIONS=""
# Set the JAVA_TOOL_OPTIONS environment variable for Java 17
ENV JAVA_TOOL_OPTIONS=${JAVA_TOOL_OPTIONS}

# Copy function code and runtime dependencies from Maven layout
COPY target/athena-clickhouse-2022.47.1.jar ${LAMBDA_TASK_ROOT}
Expand Down
10 changes: 0 additions & 10 deletions athena-clickhouse/athena-clickhouse.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,20 +56,11 @@ Parameters:
Description: "(Optional) An IAM policy ARN to use as the PermissionsBoundary for the created Lambda function's execution role"
Default: ''
Type: String
JavaVersion:
Description: "(Optional) Specify the Java version for the Lambda function. Default is '17'; use '11' for Java 11 or '8' for Java 8."
Type: String
AllowedValues:
- "17"
- "11"
- "8"
Default: "17"
Conditions:
HasPermissionsBoundary: !Not [ !Equals [ !Ref PermissionsBoundaryARN, "" ] ]
NotHasLambdaRole: !Equals [!Ref LambdaRoleARN, ""]
IsRegionBAH: !Equals [!Ref "AWS::Region", "me-south-1"]
IsRegionHKG: !Equals [!Ref "AWS::Region", "ap-east-1"]
IsJava17: !Equals [!Ref JavaVersion, "17"]
Resources:
JdbcConnectorConfig:
Type: 'AWS::Serverless::Function'
Expand All @@ -80,7 +71,6 @@ Resources:
spill_bucket: !Ref SpillBucket
spill_prefix: !Ref SpillPrefix
default: !Ref DefaultConnectionString
JAVA_TOOL_OPTIONS: !If [IsJava17, "--add-opens=java.base/java.nio=ALL-UNNAMED", !Ref "AWS::NoValue"]
FunctionName: !Ref LambdaFunctionName
PackageType: "Image"
ImageUri: !Sub
Expand Down
10 changes: 9 additions & 1 deletion athena-cloudera-hive/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
FROM public.ecr.aws/lambda/java:17
# Argument for Java version, defaulting to 11
ARG JAVA_VERSION=11
# Use the specified version of Java
FROM public.ecr.aws/lambda/java:${JAVA_VERSION}

# Argument for Java tool options, defaulting to an empty string
ARG JAVA_TOOL_OPTIONS=""
# Set the JAVA_TOOL_OPTIONS environment variable for Java 17
ENV JAVA_TOOL_OPTIONS=${JAVA_TOOL_OPTIONS}

# Copy function code and runtime dependencies from Maven layout
COPY target/athena-cloudera-hive-2022.47.1.jar ${LAMBDA_TASK_ROOT}
Expand Down
10 changes: 0 additions & 10 deletions athena-cloudera-hive/athena-cloudera-hive.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,19 +52,10 @@ Parameters:
Description: "(Optional) An IAM policy ARN to use as the PermissionsBoundary for the created Lambda function's execution role"
Default: ''
Type: String
JavaVersion:
Description: "(Optional) Specify the Java version for the Lambda function. Default is '17'; use '11' for Java 11 or '8' for Java 8."
Type: String
AllowedValues:
- "17"
- "11"
- "8"
Default: "17"
Conditions:
HasPermissionsBoundary: !Not [ !Equals [ !Ref PermissionsBoundaryARN, "" ] ]
IsRegionBAH: !Equals [!Ref "AWS::Region", "me-south-1"]
IsRegionHKG: !Equals [!Ref "AWS::Region", "ap-east-1"]
IsJava17: !Equals [!Ref JavaVersion, "17"]
Resources:
JdbcConnectorConfig:
Type: 'AWS::Serverless::Function'
Expand All @@ -75,7 +66,6 @@ Resources:
spill_bucket: !Ref SpillBucket
spill_prefix: !Ref SpillPrefix
default: !Ref DefaultConnectionString
JAVA_TOOL_OPTIONS: !If [IsJava17, "--add-opens=java.base/java.nio=ALL-UNNAMED", !Ref "AWS::NoValue"]
FunctionName: !Ref LambdaFunctionName
PackageType: "Image"
ImageUri: !Sub
Expand Down
10 changes: 9 additions & 1 deletion athena-cloudera-impala/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
FROM public.ecr.aws/lambda/java:17
# Argument for Java version, defaulting to 11
ARG JAVA_VERSION=11
# Use the specified version of Java
FROM public.ecr.aws/lambda/java:${JAVA_VERSION}

# Argument for Java tool options, defaulting to an empty string
ARG JAVA_TOOL_OPTIONS=""
# Set the JAVA_TOOL_OPTIONS environment variable for Java 17
ENV JAVA_TOOL_OPTIONS=${JAVA_TOOL_OPTIONS}

# Copy function code and runtime dependencies from Maven layout
COPY target/athena-cloudera-impala-2022.47.1.jar ${LAMBDA_TASK_ROOT}
Expand Down
10 changes: 0 additions & 10 deletions athena-cloudera-impala/athena-cloudera-impala.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,6 @@ Parameters:
Description: "(Optional) An IAM policy ARN to use as the PermissionsBoundary for the created Lambda function's execution role"
Default: ''
Type: String
JavaVersion:
Description: "(Optional) Specify the Java version for the Lambda function. Default is '17'; use '11' for Java 11 or '8' for Java 8."
Type: String
AllowedValues:
- "17"
- "11"
- "8"
Default: "17"
LambdaEncryptionKmsKeyARN:
Description: "(Optional) The KMS Key ARN used for encrypting your Lambda environment variables."
Default: ""
Expand All @@ -69,7 +61,6 @@ Conditions:
HasLambdaEncryptionKmsKeyARN: !Not [ !Equals [ !Ref LambdaEncryptionKmsKeyARN, "" ] ]
IsRegionBAH: !Equals [!Ref "AWS::Region", "me-south-1"]
IsRegionHKG: !Equals [!Ref "AWS::Region", "ap-east-1"]
IsJava17: !Equals [!Ref JavaVersion, "17"]
Resources:
JdbcConnectorConfig:
Type: 'AWS::Serverless::Function'
Expand All @@ -80,7 +71,6 @@ Resources:
spill_bucket: !Ref SpillBucket
spill_prefix: !Ref SpillPrefix
default: !Ref DefaultConnectionString
JAVA_TOOL_OPTIONS: !If [IsJava17, "--add-opens=java.base/java.nio=ALL-UNNAMED", !Ref "AWS::NoValue"]
FunctionName: !Ref LambdaFunctionName
PackageType: "Image"
ImageUri: !Sub
Expand Down
10 changes: 9 additions & 1 deletion athena-cloudwatch-metrics/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
FROM public.ecr.aws/lambda/java:17
# Argument for Java version, defaulting to 11
ARG JAVA_VERSION=11
# Use the specified version of Java
FROM public.ecr.aws/lambda/java:${JAVA_VERSION}

# Argument for Java tool options, defaulting to an empty string
ARG JAVA_TOOL_OPTIONS=""
# Set the JAVA_TOOL_OPTIONS environment variable for Java 17
ENV JAVA_TOOL_OPTIONS=${JAVA_TOOL_OPTIONS}

# Copy function code and runtime dependencies from Maven layout
COPY target/athena-cloudwatch-metrics-2022.47.1.jar ${LAMBDA_TASK_ROOT}
Expand Down
10 changes: 0 additions & 10 deletions athena-cloudwatch-metrics/athena-cloudwatch-metrics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,10 @@ Parameters:
Description: "(Optional) An IAM policy ARN to use as the PermissionsBoundary for the created Lambda function's execution role"
Default: ''
Type: String
JavaVersion:
Description: "(Optional) Specify the Java version for the Lambda function. Default is '17'; use '11' for Java 11 or '8' for Java 8."
Type: String
AllowedValues:
- "17"
- "11"
- "8"
Default: "17"
Conditions:
HasPermissionsBoundary: !Not [ !Equals [ !Ref PermissionsBoundaryARN, "" ] ]
IsRegionBAH: !Equals [!Ref "AWS::Region", "me-south-1"]
IsRegionHKG: !Equals [!Ref "AWS::Region", "ap-east-1"]
IsJava17: !Equals [!Ref JavaVersion, "17"]
Resources:
ConnectorConfig:
Type: 'AWS::Serverless::Function'
Expand All @@ -62,7 +53,6 @@ Resources:
disable_spill_encryption: !Ref DisableSpillEncryption
spill_bucket: !Ref SpillBucket
spill_prefix: !Ref SpillPrefix
JAVA_TOOL_OPTIONS: !If [IsJava17, "--add-opens=java.base/java.nio=ALL-UNNAMED", !Ref "AWS::NoValue"]
FunctionName: !Ref AthenaCatalogName
PackageType: "Image"
ImageUri: !Sub
Expand Down
10 changes: 9 additions & 1 deletion athena-cloudwatch/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
FROM public.ecr.aws/lambda/java:17
# Argument for Java version, defaulting to 11
ARG JAVA_VERSION=11
# Use the specified version of Java
FROM public.ecr.aws/lambda/java:${JAVA_VERSION}

# Argument for Java tool options, defaulting to an empty string
ARG JAVA_TOOL_OPTIONS=""
# Set the JAVA_TOOL_OPTIONS environment variable for Java 17
ENV JAVA_TOOL_OPTIONS=${JAVA_TOOL_OPTIONS}

# Copy function code and runtime dependencies from Maven layout
COPY target/athena-cloudwatch-2022.47.1.jar ${LAMBDA_TASK_ROOT}
Expand Down
10 changes: 0 additions & 10 deletions athena-cloudwatch/athena-cloudwatch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,6 @@ Parameters:
Description: "(Optional) An IAM policy ARN to use as the PermissionsBoundary for the created Lambda function's execution role"
Default: ''
Type: String
JavaVersion:
Description: "(Optional) Specify the Java version for the Lambda function. Default is '17'; use '11' for Java 11 or '8' for Java 8."
Type: String
AllowedValues:
- "17"
- "11"
- "8"
Default: "17"

Conditions:
HasKMSKeyId: !Not [!Equals [!Ref KMSKeyId, ""]]
Expand All @@ -64,7 +56,6 @@ Conditions:
CreateKMSPolicy: !And [ !Condition HasKMSKeyId, !Condition NotHasLambdaRole ]
IsRegionBAH: !Equals [!Ref "AWS::Region", "me-south-1"]
IsRegionHKG: !Equals [!Ref "AWS::Region", "ap-east-1"]
IsJava17: !Equals [!Ref JavaVersion, "17"]
Resources:
ConnectorConfig:
Type: 'AWS::Serverless::Function'
Expand All @@ -75,7 +66,6 @@ Resources:
spill_bucket: !Ref SpillBucket
spill_prefix: !Ref SpillPrefix
kms_key_id: !If [HasKMSKeyId, !Ref KMSKeyId, !Ref "AWS::NoValue"]
JAVA_TOOL_OPTIONS: !If [IsJava17, "--add-opens=java.base/java.nio=ALL-UNNAMED", !Ref "AWS::NoValue"]
FunctionName: !Ref AthenaCatalogName
PackageType: "Image"
ImageUri: !Sub
Expand Down
10 changes: 9 additions & 1 deletion athena-datalakegen2/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
FROM public.ecr.aws/lambda/java:17
# Argument for Java version, defaulting to 11
ARG JAVA_VERSION=11
# Use the specified version of Java
FROM public.ecr.aws/lambda/java:${JAVA_VERSION}

# Argument for Java tool options, defaulting to an empty string
ARG JAVA_TOOL_OPTIONS=""
# Set the JAVA_TOOL_OPTIONS environment variable for Java 17
ENV JAVA_TOOL_OPTIONS=${JAVA_TOOL_OPTIONS}

# Copy function code and runtime dependencies from Maven layout
COPY target/athena-datalakegen2-2022.47.1.jar ${LAMBDA_TASK_ROOT}
Expand Down
10 changes: 0 additions & 10 deletions athena-datalakegen2/athena-datalakegen2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,21 +56,12 @@ Parameters:
Description: "(Optional) An IAM policy ARN to use as the PermissionsBoundary for the created Lambda function's execution role"
Default: ''
Type: String
JavaVersion:
Description: "(Optional) Specify the Java version for the Lambda function. Default is '17'; use '11' for Java 11 or '8' for Java 8."
Type: String
AllowedValues:
- "17"
- "11"
- "8"
Default: "17"
Conditions:
HasPermissionsBoundary: !Not [ !Equals [ !Ref PermissionsBoundaryARN, "" ] ]
HasSecurityGroups: !Not [ !Equals [ !Join ["", !Ref SecurityGroupIds], "" ] ]
HasSubnets: !Not [ !Equals [ !Join ["", !Ref SubnetIds], "" ] ]
IsRegionBAH: !Equals [!Ref "AWS::Region", "me-south-1"]
IsRegionHKG: !Equals [!Ref "AWS::Region", "ap-east-1"]
IsJava17: !Equals [!Ref JavaVersion, "17"]
Resources:
JdbcConnectorConfig:
Type: 'AWS::Serverless::Function'
Expand All @@ -81,7 +72,6 @@ Resources:
spill_bucket: !Ref SpillBucket
spill_prefix: !Ref SpillPrefix
default: !Ref DefaultConnectionString
JAVA_TOOL_OPTIONS: !If [IsJava17, "--add-opens=java.base/java.nio=ALL-UNNAMED", !Ref "AWS::NoValue"]
FunctionName: !Ref LambdaFunctionName
PackageType: "Image"
ImageUri: !Sub
Expand Down
10 changes: 9 additions & 1 deletion athena-db2-as400/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
FROM public.ecr.aws/lambda/java:17
# Argument for Java version, defaulting to 11
ARG JAVA_VERSION=11
# Use the specified version of Java
FROM public.ecr.aws/lambda/java:${JAVA_VERSION}

# Argument for Java tool options, defaulting to an empty string
ARG JAVA_TOOL_OPTIONS=""
# Set the JAVA_TOOL_OPTIONS environment variable for Java 17
ENV JAVA_TOOL_OPTIONS=${JAVA_TOOL_OPTIONS}

# Copy function code and runtime dependencies from Maven layout
COPY target/athena-db2-as400-2022.47.1.jar ${LAMBDA_TASK_ROOT}
Expand Down
10 changes: 0 additions & 10 deletions athena-db2-as400/athena-db2-as400.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,21 +57,12 @@ Parameters:
Description: "(Optional) An IAM policy ARN to use as the PermissionsBoundary for the created Lambda function's execution role"
Default: ''
Type: String
JavaVersion:
Description: "(Optional) Specify the Java version for the Lambda function. Default is '17'; use '11' for Java 11 or '8' for Java 8."
Type: String
AllowedValues:
- "17"
- "11"
- "8"
Default: "17"
Conditions:
HasPermissionsBoundary: !Not [ !Equals [ !Ref PermissionsBoundaryARN, "" ] ]
HasSecurityGroups: !Not [ !Equals [ !Join ["", !Ref SecurityGroupIds], "" ] ]
HasSubnets: !Not [ !Equals [ !Join ["", !Ref SubnetIds], "" ] ]
IsRegionBAH: !Equals [!Ref "AWS::Region", "me-south-1"]
IsRegionHKG: !Equals [!Ref "AWS::Region", "ap-east-1"]
IsJava17: !Equals [!Ref JavaVersion, "17"]
Resources:
JdbcConnectorConfig:
Type: 'AWS::Serverless::Function'
Expand All @@ -82,7 +73,6 @@ Resources:
spill_bucket: !Ref SpillBucket
spill_prefix: !Ref SpillPrefix
default: !Ref DefaultConnectionString
JAVA_TOOL_OPTIONS: !If [IsJava17, "--add-opens=java.base/java.nio=ALL-UNNAMED", !Ref "AWS::NoValue"]
FunctionName: !Ref LambdaFunctionName
PackageType: "Image"
ImageUri: !Sub
Expand Down
10 changes: 9 additions & 1 deletion athena-db2/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
FROM public.ecr.aws/lambda/java:17
# Argument for Java version, defaulting to 11
ARG JAVA_VERSION=11
# Use the specified version of Java
FROM public.ecr.aws/lambda/java:${JAVA_VERSION}

# Argument for Java tool options, defaulting to an empty string
ARG JAVA_TOOL_OPTIONS=""
# Set the JAVA_TOOL_OPTIONS environment variable for Java 17
ENV JAVA_TOOL_OPTIONS=${JAVA_TOOL_OPTIONS}

# Copy function code and runtime dependencies from Maven layout
COPY target/athena-db2-2022.47.1.jar ${LAMBDA_TASK_ROOT}
Expand Down
10 changes: 0 additions & 10 deletions athena-db2/athena-db2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,21 +57,12 @@ Parameters:
Description: "(Optional) An IAM policy ARN to use as the PermissionsBoundary for the created Lambda function's execution role"
Default: ''
Type: String
JavaVersion:
Description: "(Optional) Specify the Java version for the Lambda function. Default is '17'; use '11' for Java 11 or '8' for Java 8."
Type: String
AllowedValues:
- "17"
- "11"
- "8"
Default: "17"
Conditions:
HasPermissionsBoundary: !Not [ !Equals [ !Ref PermissionsBoundaryARN, "" ] ]
HasSecurityGroups: !Not [ !Equals [ !Join ["", !Ref SecurityGroupIds], "" ] ]
HasSubnets: !Not [ !Equals [ !Join ["", !Ref SubnetIds], "" ] ]
IsRegionBAH: !Equals [!Ref "AWS::Region", "me-south-1"]
IsRegionHKG: !Equals [!Ref "AWS::Region", "ap-east-1"]
IsJava17: !Equals [!Ref JavaVersion, "17"]
Resources:
JdbcConnectorConfig:
Type: 'AWS::Serverless::Function'
Expand All @@ -82,7 +73,6 @@ Resources:
spill_bucket: !Ref SpillBucket
spill_prefix: !Ref SpillPrefix
default: !Ref DefaultConnectionString
JAVA_TOOL_OPTIONS: !If [IsJava17, "--add-opens=java.base/java.nio=ALL-UNNAMED", !Ref "AWS::NoValue"]
FunctionName: !Ref LambdaFunctionName
PackageType: "Image"
ImageUri: !Sub
Expand Down
Loading

0 comments on commit 92758b0

Please sign in to comment.