diff --git a/athena-aws-cmdb/Dockerfile b/athena-aws-cmdb/Dockerfile index da890e3d1d..b4b997dca0 100644 --- a/athena-aws-cmdb/Dockerfile +++ b/athena-aws-cmdb/Dockerfile @@ -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} diff --git a/athena-aws-cmdb/athena-aws-cmdb.yaml b/athena-aws-cmdb/athena-aws-cmdb.yaml index 907e1e722e..8ead0e1db0 100644 --- a/athena-aws-cmdb/athena-aws-cmdb.yaml +++ b/athena-aws-cmdb/athena-aws-cmdb.yaml @@ -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' @@ -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 diff --git a/athena-clickhouse/Dockerfile b/athena-clickhouse/Dockerfile index e9b9bcda40..1edf216c50 100644 --- a/athena-clickhouse/Dockerfile +++ b/athena-clickhouse/Dockerfile @@ -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} diff --git a/athena-clickhouse/athena-clickhouse.yaml b/athena-clickhouse/athena-clickhouse.yaml index f3e9f0203e..8f65ef1018 100644 --- a/athena-clickhouse/athena-clickhouse.yaml +++ b/athena-clickhouse/athena-clickhouse.yaml @@ -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' @@ -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 diff --git a/athena-cloudera-hive/Dockerfile b/athena-cloudera-hive/Dockerfile index 1955a48d9d..35869fb6f0 100644 --- a/athena-cloudera-hive/Dockerfile +++ b/athena-cloudera-hive/Dockerfile @@ -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} diff --git a/athena-cloudera-hive/athena-cloudera-hive.yaml b/athena-cloudera-hive/athena-cloudera-hive.yaml index 4b2169d42a..2ec64cad7b 100644 --- a/athena-cloudera-hive/athena-cloudera-hive.yaml +++ b/athena-cloudera-hive/athena-cloudera-hive.yaml @@ -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' @@ -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 diff --git a/athena-cloudera-impala/Dockerfile b/athena-cloudera-impala/Dockerfile index 194f1b3687..6d1e216672 100644 --- a/athena-cloudera-impala/Dockerfile +++ b/athena-cloudera-impala/Dockerfile @@ -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} diff --git a/athena-cloudera-impala/athena-cloudera-impala.yaml b/athena-cloudera-impala/athena-cloudera-impala.yaml index 48e2c3dcbc..55e1d742d7 100644 --- a/athena-cloudera-impala/athena-cloudera-impala.yaml +++ b/athena-cloudera-impala/athena-cloudera-impala.yaml @@ -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: "" @@ -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' @@ -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 diff --git a/athena-cloudwatch-metrics/Dockerfile b/athena-cloudwatch-metrics/Dockerfile index 7ad3128758..97cb14caca 100644 --- a/athena-cloudwatch-metrics/Dockerfile +++ b/athena-cloudwatch-metrics/Dockerfile @@ -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} diff --git a/athena-cloudwatch-metrics/athena-cloudwatch-metrics.yaml b/athena-cloudwatch-metrics/athena-cloudwatch-metrics.yaml index adf89d2df6..5f4ce7585c 100644 --- a/athena-cloudwatch-metrics/athena-cloudwatch-metrics.yaml +++ b/athena-cloudwatch-metrics/athena-cloudwatch-metrics.yaml @@ -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' @@ -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 diff --git a/athena-cloudwatch/Dockerfile b/athena-cloudwatch/Dockerfile index dddd041a37..e5dd903628 100644 --- a/athena-cloudwatch/Dockerfile +++ b/athena-cloudwatch/Dockerfile @@ -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} diff --git a/athena-cloudwatch/athena-cloudwatch.yaml b/athena-cloudwatch/athena-cloudwatch.yaml index 4333f483a0..860dbf9c5d 100644 --- a/athena-cloudwatch/athena-cloudwatch.yaml +++ b/athena-cloudwatch/athena-cloudwatch.yaml @@ -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, ""]] @@ -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' @@ -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 diff --git a/athena-datalakegen2/Dockerfile b/athena-datalakegen2/Dockerfile index f7ea96117e..797813bd04 100644 --- a/athena-datalakegen2/Dockerfile +++ b/athena-datalakegen2/Dockerfile @@ -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} diff --git a/athena-datalakegen2/athena-datalakegen2.yaml b/athena-datalakegen2/athena-datalakegen2.yaml index c396c14431..1318145981 100644 --- a/athena-datalakegen2/athena-datalakegen2.yaml +++ b/athena-datalakegen2/athena-datalakegen2.yaml @@ -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' @@ -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 diff --git a/athena-db2-as400/Dockerfile b/athena-db2-as400/Dockerfile index a88320db4d..5d389d65df 100644 --- a/athena-db2-as400/Dockerfile +++ b/athena-db2-as400/Dockerfile @@ -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} diff --git a/athena-db2-as400/athena-db2-as400.yaml b/athena-db2-as400/athena-db2-as400.yaml index 2409581f63..ac6dca58a5 100644 --- a/athena-db2-as400/athena-db2-as400.yaml +++ b/athena-db2-as400/athena-db2-as400.yaml @@ -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' @@ -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 diff --git a/athena-db2/Dockerfile b/athena-db2/Dockerfile index b709eb0257..f21d4ec5b1 100644 --- a/athena-db2/Dockerfile +++ b/athena-db2/Dockerfile @@ -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} diff --git a/athena-db2/athena-db2.yaml b/athena-db2/athena-db2.yaml index f866199f65..711652357a 100644 --- a/athena-db2/athena-db2.yaml +++ b/athena-db2/athena-db2.yaml @@ -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' @@ -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 diff --git a/athena-docdb/Dockerfile b/athena-docdb/Dockerfile index 48fdec00d0..2c4d6a2a09 100644 --- a/athena-docdb/Dockerfile +++ b/athena-docdb/Dockerfile @@ -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} # Install necessary tools RUN yum update -y && yum install -y curl perl openssl diff --git a/athena-docdb/athena-docdb.yaml b/athena-docdb/athena-docdb.yaml index 19c7173bb7..5b8a91261a 100644 --- a/athena-docdb/athena-docdb.yaml +++ b/athena-docdb/athena-docdb.yaml @@ -53,19 +53,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' @@ -76,7 +67,6 @@ Resources: spill_bucket: !Ref SpillBucket spill_prefix: !Ref SpillPrefix default_docdb: !Ref DocDBConnectionString - JAVA_TOOL_OPTIONS: !If [IsJava17, "--add-opens=java.base/java.nio=ALL-UNNAMED", !Ref "AWS::NoValue"] FunctionName: !Ref AthenaCatalogName PackageType: "Image" ImageUri: !Sub diff --git a/athena-dynamodb/Dockerfile b/athena-dynamodb/Dockerfile index b94fa9910e..0e672f4891 100644 --- a/athena-dynamodb/Dockerfile +++ b/athena-dynamodb/Dockerfile @@ -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-dynamodb-2022.47.1.jar ${LAMBDA_TASK_ROOT} diff --git a/athena-dynamodb/athena-dynamodb.yaml b/athena-dynamodb/athena-dynamodb.yaml index 4ce7073967..366fcd85cd 100644 --- a/athena-dynamodb/athena-dynamodb.yaml +++ b/athena-dynamodb/athena-dynamodb.yaml @@ -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, ""]] @@ -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' @@ -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 diff --git a/athena-elasticsearch/Dockerfile b/athena-elasticsearch/Dockerfile index eb749b16b6..30f7179b3c 100644 --- a/athena-elasticsearch/Dockerfile +++ b/athena-elasticsearch/Dockerfile @@ -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-elasticsearch-2022.47.1.jar ${LAMBDA_TASK_ROOT} diff --git a/athena-elasticsearch/athena-elasticsearch.yaml b/athena-elasticsearch/athena-elasticsearch.yaml index d8af0a3820..f99f6800c1 100644 --- a/athena-elasticsearch/athena-elasticsearch.yaml +++ b/athena-elasticsearch/athena-elasticsearch.yaml @@ -82,21 +82,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: IsVPCAccessSelected: !Equals [!Ref IsVPCAccess, true] 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' @@ -111,7 +102,6 @@ Resources: query_timeout_cluster: !Ref QueryTimeoutCluster query_timeout_search: !Ref QueryTimeoutSearch query_scroll_timeout: !Ref QueryScrollTimeout - JAVA_TOOL_OPTIONS: !If [IsJava17, "--add-opens=java.base/java.nio=ALL-UNNAMED", !Ref "AWS::NoValue"] FunctionName: !Sub "${AthenaCatalogName}" PackageType: "Image" ImageUri: !Sub diff --git a/athena-example/athena-example.yaml b/athena-example/athena-example.yaml index ab8d28a9fd..19230b92a6 100644 --- a/athena-example/athena-example.yaml +++ b/athena-example/athena-example.yaml @@ -42,16 +42,6 @@ Parameters: Description: "WARNING: If set to 'true' encryption for spilled data is disabled." Default: "false" 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: - IsJava17: !Equals [!Ref JavaVersion, "17"] Resources: ConnectorConfig: Type: 'AWS::Serverless::Function' @@ -62,12 +52,11 @@ Resources: spill_bucket: !Ref SpillBucket spill_prefix: !Ref SpillPrefix data_bucket: !Ref DataBucket - JAVA_TOOL_OPTIONS: !If [IsJava17, "--add-opens=java.base/java.nio=ALL-UNNAMED", !Ref "AWS::NoValue"] FunctionName: !Sub "${AthenaCatalogName}" Handler: "com.amazonaws.athena.connectors.example.ExampleCompositeHandler" CodeUri: "./target/athena-example-2022.47.1.jar" Description: "A guided example for writing and deploying your own federated Amazon Athena connector for a custom source." - Runtime: java17 + Runtime: java11 Timeout: !Ref LambdaTimeout MemorySize: !Ref LambdaMemory Policies: diff --git a/athena-federation-sdk/athena-federation-sdk.yaml b/athena-federation-sdk/athena-federation-sdk.yaml index fead11a63e..559e6830bc 100644 --- a/athena-federation-sdk/athena-federation-sdk.yaml +++ b/athena-federation-sdk/athena-federation-sdk.yaml @@ -36,16 +36,6 @@ Parameters: Description: "WARNING: If set to 'true' encryption for spilled data is disabled." Default: 'false' 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: - IsJava17: !Equals [!Ref JavaVersion, "17"] Resources: ConnectorConfig: Type: 'AWS::Serverless::Function' @@ -55,12 +45,11 @@ 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 Handler: "com.amazonaws.athena.connector.lambda.examples.ExampleCompositeHandler" CodeUri: "./target/aws-athena-federation-sdk-2022.47.1-withdep.jar" Description: "This connector enables Amazon Athena to communicate with a randomly generated data source." - Runtime: java17 + Runtime: java11 Timeout: !Ref LambdaTimeout MemorySize: !Ref LambdaMemory Policies: diff --git a/athena-gcs/Dockerfile b/athena-gcs/Dockerfile index 59d9584664..d3f8615a2f 100644 --- a/athena-gcs/Dockerfile +++ b/athena-gcs/Dockerfile @@ -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-gcs.zip ${LAMBDA_TASK_ROOT} diff --git a/athena-gcs/athena-gcs.yaml b/athena-gcs/athena-gcs.yaml index 3d4ca5eba4..aabe3fa4e2 100644 --- a/athena-gcs/athena-gcs.yaml +++ b/athena-gcs/athena-gcs.yaml @@ -44,20 +44,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, "" ] ] IsRegionBAH: !Equals [!Ref "AWS::Region", "me-south-1"] IsRegionHKG: !Equals [!Ref "AWS::Region", "ap-east-1"] - IsJava17: !Equals [!Ref JavaVersion, "17"] Resources: AthenaGCSConnector: Type: 'AWS::Serverless::Function' @@ -68,7 +59,6 @@ Resources: spill_bucket: !Ref SpillBucket spill_prefix: !Ref SpillPrefix secret_manager_gcp_creds_name: !Ref GCSSecretName - JAVA_TOOL_OPTIONS: !If [IsJava17, "--add-opens=java.base/java.nio=ALL-UNNAMED", !Ref "AWS::NoValue"] FunctionName: !Ref LambdaFunctionName PackageType: "Image" ImageUri: !Sub diff --git a/athena-google-bigquery/Dockerfile b/athena-google-bigquery/Dockerfile index 268f44fd45..524ecab8bd 100644 --- a/athena-google-bigquery/Dockerfile +++ b/athena-google-bigquery/Dockerfile @@ -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-google-bigquery-2022.47.1.jar ${LAMBDA_TASK_ROOT} diff --git a/athena-google-bigquery/athena-google-bigquery.yaml b/athena-google-bigquery/athena-google-bigquery.yaml index 92c56bec10..b92e9d01ea 100644 --- a/athena-google-bigquery/athena-google-bigquery.yaml +++ b/athena-google-bigquery/athena-google-bigquery.yaml @@ -60,21 +60,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: AthenaBigQueryConnector: Type: 'AWS::Serverless::Function' @@ -88,7 +79,6 @@ Resources: gcp_project_id: !Ref GCPProjectID big_query_endpoint: !Ref BigQueryEndpoint GOOGLE_APPLICATION_CREDENTIALS: '/tmp/service-account.json' - JAVA_TOOL_OPTIONS: !If [IsJava17, "--add-opens=java.base/java.nio=ALL-UNNAMED", !Ref "AWS::NoValue"] FunctionName: !Ref LambdaFunctionName PackageType: "Image" ImageUri: !Sub diff --git a/athena-hbase/Dockerfile b/athena-hbase/Dockerfile index 69697f84ed..9f6be7f78e 100644 --- a/athena-hbase/Dockerfile +++ b/athena-hbase/Dockerfile @@ -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-hbase-2022.47.1.jar ${LAMBDA_TASK_ROOT} diff --git a/athena-hbase/athena-hbase.yaml b/athena-hbase/athena-hbase.yaml index 1d94f226d9..ba51dfd827 100644 --- a/athena-hbase/athena-hbase.yaml +++ b/athena-hbase/athena-hbase.yaml @@ -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" KerberosAuthEnabled: Description: 'Kerberos authentication enabled or not' Default: "false" @@ -80,7 +72,6 @@ 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' @@ -95,7 +86,6 @@ Resources: kerberos_config_files_s3_reference: !Ref KerberosConfigFilesS3Reference principal_name: !Ref PrincipalName hbase_rpc_protection: !Ref HbaseRpcProtection - JAVA_TOOL_OPTIONS: !If [IsJava17, "--add-opens=java.base/java.nio=ALL-UNNAMED", !Ref "AWS::NoValue"] FunctionName: !Ref AthenaCatalogName PackageType: "Image" ImageUri: !Sub diff --git a/athena-hortonworks-hive/Dockerfile b/athena-hortonworks-hive/Dockerfile index ba658c7a71..0e759dc437 100644 --- a/athena-hortonworks-hive/Dockerfile +++ b/athena-hortonworks-hive/Dockerfile @@ -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-hortonworks-hive-2022.47.1.jar ${LAMBDA_TASK_ROOT} diff --git a/athena-hortonworks-hive/athena-hortonworks-hive.yaml b/athena-hortonworks-hive/athena-hortonworks-hive.yaml index c44b137689..85f8dfc206 100644 --- a/athena-hortonworks-hive/athena-hortonworks-hive.yaml +++ b/athena-hortonworks-hive/athena-hortonworks-hive.yaml @@ -54,21 +54,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' @@ -79,7 +70,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 diff --git a/athena-kafka/Dockerfile b/athena-kafka/Dockerfile index 4e3f7545db..0d159a3529 100644 --- a/athena-kafka/Dockerfile +++ b/athena-kafka/Dockerfile @@ -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-kafka-2022.47.1.jar ${LAMBDA_TASK_ROOT} diff --git a/athena-kafka/athena-kafka.yaml b/athena-kafka/athena-kafka.yaml index 5501e28979..2479b64225 100644 --- a/athena-kafka/athena-kafka.yaml +++ b/athena-kafka/athena-kafka.yaml @@ -79,14 +79,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: NotHasLambdaRole: !Equals [!Ref LambdaRoleARN, ""] @@ -95,7 +87,6 @@ Conditions: 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: AthenaKafkaConnector: Type: 'AWS::Serverless::Function' @@ -110,7 +101,6 @@ Resources: kafka_endpoint: !Ref KafkaEndpoint schema_registry_url: !Ref SchemaRegistryUrl auth_type: !Ref AuthType - JAVA_TOOL_OPTIONS: !If [IsJava17, "--add-opens=java.base/java.nio=ALL-UNNAMED", !Ref "AWS::NoValue"] FunctionName: !Ref LambdaFunctionName PackageType: "Image" ImageUri: !Sub diff --git a/athena-msk/Dockerfile b/athena-msk/Dockerfile index b207e7008d..b017ff0668 100644 --- a/athena-msk/Dockerfile +++ b/athena-msk/Dockerfile @@ -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-msk-2022.47.1.jar ${LAMBDA_TASK_ROOT} diff --git a/athena-msk/athena-msk.yaml b/athena-msk/athena-msk.yaml index 7c0b71aa41..f04269c75f 100644 --- a/athena-msk/athena-msk.yaml +++ b/athena-msk/athena-msk.yaml @@ -75,14 +75,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: NotHasLambdaRole: !Equals [!Ref LambdaRoleARN, ""] @@ -91,7 +83,6 @@ Conditions: 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: AthenaMSKConnector: Type: 'AWS::Serverless::Function' @@ -105,7 +96,6 @@ Resources: certificates_s3_reference: !Ref CertificatesS3Reference kafka_endpoint: !Ref KafkaEndpoint auth_type: !Ref AuthType - JAVA_TOOL_OPTIONS: !If [IsJava17, "--add-opens=java.base/java.nio=ALL-UNNAMED", !Ref "AWS::NoValue"] FunctionName: !Ref LambdaFunctionName PackageType: "Image" ImageUri: !Sub diff --git a/athena-mysql/Dockerfile b/athena-mysql/Dockerfile index 874f625391..31f10335cf 100644 --- a/athena-mysql/Dockerfile +++ b/athena-mysql/Dockerfile @@ -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-mysql-2022.47.1.jar ${LAMBDA_TASK_ROOT} diff --git a/athena-mysql/athena-mysql.yaml b/athena-mysql/athena-mysql.yaml index b50398141e..c657e41e64 100644 --- a/athena-mysql/athena-mysql.yaml +++ b/athena-mysql/athena-mysql.yaml @@ -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' @@ -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 diff --git a/athena-neptune/Dockerfile b/athena-neptune/Dockerfile index 7e4ff25959..9cfc6a5cf6 100644 --- a/athena-neptune/Dockerfile +++ b/athena-neptune/Dockerfile @@ -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-neptune-2022.47.1.jar ${LAMBDA_TASK_ROOT} diff --git a/athena-neptune/athena-neptune.yaml b/athena-neptune/athena-neptune.yaml index 90a8353d85..ebf995f804 100644 --- a/athena-neptune/athena-neptune.yaml +++ b/athena-neptune/athena-neptune.yaml @@ -74,20 +74,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, "" ] ] 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' @@ -105,7 +96,6 @@ Resources: neptune_graphtype: !Ref NeptuneGraphType SERVICE_REGION: !Ref AWS::Region enable_caseinsensitivematch: !Ref EnableCaseInsensitiveMatch - JAVA_TOOL_OPTIONS: !If [IsJava17, "--add-opens=java.base/java.nio=ALL-UNNAMED", !Ref "AWS::NoValue"] FunctionName: !Ref AthenaCatalogName PackageType: "Image" ImageUri: !Sub diff --git a/athena-oracle/Dockerfile b/athena-oracle/Dockerfile index 1afc3a34e2..b36bec1185 100644 --- a/athena-oracle/Dockerfile +++ b/athena-oracle/Dockerfile @@ -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} # Install necessary tools RUN yum update -y && yum install -y curl perl openssl diff --git a/athena-oracle/athena-oracle.yaml b/athena-oracle/athena-oracle.yaml index 87a2093fab..6badf23d43 100644 --- a/athena-oracle/athena-oracle.yaml +++ b/athena-oracle/athena-oracle.yaml @@ -65,14 +65,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: HasPermissionsBoundary: !Not [ !Equals [ !Ref PermissionsBoundaryARN, "" ] ] NotHasLambdaRole: !Equals [!Ref LambdaRoleARN, ""] @@ -80,7 +72,6 @@ Conditions: 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' @@ -92,7 +83,6 @@ Resources: spill_prefix: !Ref SpillPrefix default: !Ref DefaultConnectionString is_FIPS_Enabled: !Ref IsFIPSEnabled - JAVA_TOOL_OPTIONS: !If [IsJava17, "--add-opens=java.base/java.nio=ALL-UNNAMED", !Ref "AWS::NoValue"] FunctionName: !Ref LambdaFunctionName PackageType: "Image" ImageUri: !Sub diff --git a/athena-postgresql/Dockerfile b/athena-postgresql/Dockerfile index 2b4138dff6..28c560390a 100644 --- a/athena-postgresql/Dockerfile +++ b/athena-postgresql/Dockerfile @@ -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-postgresql-2022.47.1.jar ${LAMBDA_TASK_ROOT} diff --git a/athena-postgresql/athena-postgresql.yaml b/athena-postgresql/athena-postgresql.yaml index 3b540a24bc..79d2013130 100644 --- a/athena-postgresql/athena-postgresql.yaml +++ b/athena-postgresql/athena-postgresql.yaml @@ -61,14 +61,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" DefaultScale: Description: "(Optional) Default value for scale of type Numeric, representing the decimal digits in the fractional part, to the right of the decimal point." Default: 0 @@ -79,7 +71,6 @@ Conditions: 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' @@ -91,7 +82,6 @@ Resources: spill_prefix: !Ref SpillPrefix default: !Ref DefaultConnectionString default_scale: !Ref DefaultScale - JAVA_TOOL_OPTIONS: !If [IsJava17, "--add-opens=java.base/java.nio=ALL-UNNAMED", !Ref "AWS::NoValue"] FunctionName: !Ref LambdaFunctionName PackageType: "Image" ImageUri: !Sub diff --git a/athena-redis/Dockerfile b/athena-redis/Dockerfile index 08b2e3b165..6565c66983 100644 --- a/athena-redis/Dockerfile +++ b/athena-redis/Dockerfile @@ -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-redis-2022.47.1.jar ${LAMBDA_TASK_ROOT} diff --git a/athena-redis/athena-redis.yaml b/athena-redis/athena-redis.yaml index ac2282be49..5d18c7ced1 100644 --- a/athena-redis/athena-redis.yaml +++ b/athena-redis/athena-redis.yaml @@ -49,14 +49,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" QPTConnectionEndpoint: Description: "(Optional) The hostname:port:password of the Redis server that contains data for this table optionally using SecretsManager (e.g. ${secret_name}). Used for Query Pass Through queries only." Default: '' @@ -77,7 +69,6 @@ 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' @@ -91,7 +82,6 @@ Resources: qpt_ssl: !Ref QPTConnectionSSL qpt_cluster: !Ref QPTConnectionCluster qpt_db_number: !Ref QPTConnectionDBNumber - JAVA_TOOL_OPTIONS: !If [IsJava17, "--add-opens=java.base/java.nio=ALL-UNNAMED", !Ref "AWS::NoValue"] FunctionName: !Ref AthenaCatalogName PackageType: "Image" ImageUri: !Sub diff --git a/athena-redshift/Dockerfile b/athena-redshift/Dockerfile index 802f99fdfb..afbe47ebd2 100644 --- a/athena-redshift/Dockerfile +++ b/athena-redshift/Dockerfile @@ -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-redshift-2022.47.1.jar ${LAMBDA_TASK_ROOT} diff --git a/athena-redshift/athena-redshift.yaml b/athena-redshift/athena-redshift.yaml index 8d06595d37..b395ce646f 100644 --- a/athena-redshift/athena-redshift.yaml +++ b/athena-redshift/athena-redshift.yaml @@ -60,14 +60,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, ""]] NotHasLambdaRole: !Equals [!Ref LambdaRole, ""] @@ -77,7 +69,6 @@ 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' @@ -89,7 +80,6 @@ Resources: spill_prefix: !Ref SpillPrefix default: !Ref DefaultConnectionString 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 LambdaFunctionName PackageType: "Image" ImageUri: !Sub diff --git a/athena-saphana/Dockerfile b/athena-saphana/Dockerfile index db3ee97069..73995eab6b 100644 --- a/athena-saphana/Dockerfile +++ b/athena-saphana/Dockerfile @@ -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-saphana.zip ${LAMBDA_TASK_ROOT} diff --git a/athena-saphana/athena-saphana.yaml b/athena-saphana/athena-saphana.yaml index 230c28e119..68ecafe0f2 100644 --- a/athena-saphana/athena-saphana.yaml +++ b/athena-saphana/athena-saphana.yaml @@ -54,21 +54,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' @@ -79,7 +70,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 diff --git a/athena-snowflake/Dockerfile b/athena-snowflake/Dockerfile index 82940ff28a..afffececef 100644 --- a/athena-snowflake/Dockerfile +++ b/athena-snowflake/Dockerfile @@ -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-snowflake.zip ${LAMBDA_TASK_ROOT} diff --git a/athena-snowflake/athena-snowflake.yaml b/athena-snowflake/athena-snowflake.yaml index 640d3404c7..7b86121621 100644 --- a/athena-snowflake/athena-snowflake.yaml +++ b/athena-snowflake/athena-snowflake.yaml @@ -54,21 +54,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' @@ -79,7 +70,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 diff --git a/athena-sqlserver/Dockerfile b/athena-sqlserver/Dockerfile index c16a6530ef..e50491da9e 100644 --- a/athena-sqlserver/Dockerfile +++ b/athena-sqlserver/Dockerfile @@ -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-sqlserver-2022.47.1.jar ${LAMBDA_TASK_ROOT} diff --git a/athena-sqlserver/athena-sqlserver.yaml b/athena-sqlserver/athena-sqlserver.yaml index cdbdfa2aad..4aa9804b16 100644 --- a/athena-sqlserver/athena-sqlserver.yaml +++ b/athena-sqlserver/athena-sqlserver.yaml @@ -60,14 +60,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: HasPermissionsBoundary: !Not [ !Equals [ !Ref PermissionsBoundaryARN, "" ] ] NotHasLambdaRole: !Equals [!Ref LambdaRoleARN, ""] @@ -75,7 +67,6 @@ Conditions: 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' @@ -86,7 +77,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 diff --git a/athena-synapse/Dockerfile b/athena-synapse/Dockerfile index 6e8aea0473..f7d633984f 100644 --- a/athena-synapse/Dockerfile +++ b/athena-synapse/Dockerfile @@ -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-synapse-2022.47.1.jar ${LAMBDA_TASK_ROOT} diff --git a/athena-synapse/athena-synapse.yaml b/athena-synapse/athena-synapse.yaml index 8f26ac9bed..1c524545f8 100644 --- a/athena-synapse/athena-synapse.yaml +++ b/athena-synapse/athena-synapse.yaml @@ -48,14 +48,6 @@ Parameters: Description: "(Optional) A custom Permission Boundary to be used by the Connector lambda" 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" DisableSpillEncryption: Description: 'If set to ''false'' data spilled to S3 is encrypted with AES GCM' Default: 'false' @@ -76,7 +68,6 @@ Conditions: 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' @@ -87,7 +78,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 diff --git a/athena-teradata/Dockerfile b/athena-teradata/Dockerfile index ccb31f259f..a0c5fcd727 100644 --- a/athena-teradata/Dockerfile +++ b/athena-teradata/Dockerfile @@ -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-teradata-2022.47.1.jar ${LAMBDA_TASK_ROOT} diff --git a/athena-teradata/athena-teradata.yaml b/athena-teradata/athena-teradata.yaml index 5bb2e3a937..987201837b 100644 --- a/athena-teradata/athena-teradata.yaml +++ b/athena-teradata/athena-teradata.yaml @@ -58,21 +58,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' @@ -84,7 +75,6 @@ Resources: spill_prefix: !Ref SpillPrefix default: !Ref DefaultConnectionString partitioncount: !Ref PartitionCount - JAVA_TOOL_OPTIONS: !If [IsJava17, "--add-opens=java.base/java.nio=ALL-UNNAMED", !Ref "AWS::NoValue"] FunctionName: !Ref LambdaFunctionName PackageType: "Image" ImageUri: !Sub diff --git a/athena-timestream/Dockerfile b/athena-timestream/Dockerfile index 65c0777226..5ff537f064 100644 --- a/athena-timestream/Dockerfile +++ b/athena-timestream/Dockerfile @@ -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-timestream-2022.47.1.jar ${LAMBDA_TASK_ROOT} diff --git a/athena-timestream/athena-timestream.yaml b/athena-timestream/athena-timestream.yaml index d2da77f603..3062d1f435 100644 --- a/athena-timestream/athena-timestream.yaml +++ b/athena-timestream/athena-timestream.yaml @@ -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' @@ -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 diff --git a/athena-tpcds/Dockerfile b/athena-tpcds/Dockerfile index 508ccea7f7..222e2ae71a 100644 --- a/athena-tpcds/Dockerfile +++ b/athena-tpcds/Dockerfile @@ -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-tpcds-2022.47.1.jar ${LAMBDA_TASK_ROOT} diff --git a/athena-tpcds/athena-tpcds.yaml b/athena-tpcds/athena-tpcds.yaml index 493a610d92..ed88425b11 100644 --- a/athena-tpcds/athena-tpcds.yaml +++ b/athena-tpcds/athena-tpcds.yaml @@ -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' @@ -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 diff --git a/athena-udfs/Dockerfile b/athena-udfs/Dockerfile index 42ce47cfcb..13bc2abb29 100644 --- a/athena-udfs/Dockerfile +++ b/athena-udfs/Dockerfile @@ -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-udfs-2022.47.1.jar ${LAMBDA_TASK_ROOT} diff --git a/athena-udfs/athena-udfs.yaml b/athena-udfs/athena-udfs.yaml index c0cc2ebf43..88a424dbe0 100644 --- a/athena-udfs/athena-udfs.yaml +++ b/athena-udfs/athena-udfs.yaml @@ -32,26 +32,14 @@ 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' Properties: - Environment: - Variables: - JAVA_TOOL_OPTIONS: !If [IsJava17, "--add-opens=java.base/java.nio=ALL-UNNAMED", !Ref "AWS::NoValue"] FunctionName: !Ref LambdaFunctionName PackageType: "Image" ImageUri: !Sub @@ -67,4 +55,4 @@ Resources: - secretsmanager:GetSecretValue Effect: Allow Resource: !Sub 'arn:${AWS::Partition}:secretsmanager:*:*:secret:${SecretName}' - Version: '2012-10-17' + Version: '2012-10-17' \ No newline at end of file diff --git a/athena-vertica/Dockerfile b/athena-vertica/Dockerfile index 2273303d1d..3ac1804c5e 100644 --- a/athena-vertica/Dockerfile +++ b/athena-vertica/Dockerfile @@ -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-vertica-2022.47.1.jar ${LAMBDA_TASK_ROOT} diff --git a/athena-vertica/athena-vertica.yaml b/athena-vertica/athena-vertica.yaml index 352e915773..472e70e253 100644 --- a/athena-vertica/athena-vertica.yaml +++ b/athena-vertica/athena-vertica.yaml @@ -60,20 +60,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, "" ] ] IsRegionBAH: !Equals [!Ref "AWS::Region", "me-south-1"] IsRegionHKG: !Equals [!Ref "AWS::Region", "ap-east-1"] - IsJava17: !Equals [!Ref JavaVersion, "17"] Resources: LambdaSecurityGroup: Type: 'AWS::EC2::SecurityGroup' @@ -90,7 +81,6 @@ Resources: spill_prefix: !Ref SpillPrefix export_bucket: !Ref VerticaExportBucket default: !Ref VerticaConnectionString - JAVA_TOOL_OPTIONS: !If [IsJava17, "--add-opens=java.base/java.nio=ALL-UNNAMED", !Ref "AWS::NoValue"] FunctionName: !Sub "${AthenaCatalogName}" PackageType: "Image" diff --git a/pom.xml b/pom.xml index fbb14673b4..01010db816 100644 --- a/pom.xml +++ b/pom.xml @@ -9,11 +9,7 @@ The Amazon Athena Query Federation SDK allows you to customize Amazon Athena with your own code. https://github.com/awslabs/aws-athena-query-federation - - - - - 17 + 11 3.13.0 2.29.29 @@ -387,11 +383,23 @@ + + java8 + + 1.8 + + + 8 + + java17 17 + + 17 +