From dd99b7a70f89a624116a91d38367fe848eed3599 Mon Sep 17 00:00:00 2001 From: Jithendar Trianz Date: Wed, 23 Oct 2024 13:04:39 +0530 Subject: [PATCH] Upgrade to Java 17 --- athena-aws-cmdb/Dockerfile | 2 +- athena-aws-cmdb/athena-aws-cmdb.yaml | 10 +++++ athena-clickhouse/Dockerfile | 2 +- athena-clickhouse/athena-clickhouse.yaml | 10 +++++ athena-cloudera-hive/Dockerfile | 2 +- .../athena-cloudera-hive.yaml | 10 +++++ athena-cloudera-impala/Dockerfile | 2 +- .../athena-cloudera-impala.yaml | 10 +++++ athena-cloudwatch-metrics/Dockerfile | 2 +- .../athena-cloudwatch-metrics.yaml | 10 +++++ athena-cloudwatch/Dockerfile | 2 +- athena-cloudwatch/athena-cloudwatch.yaml | 10 +++++ athena-datalakegen2/Dockerfile | 2 +- athena-datalakegen2/athena-datalakegen2.yaml | 10 +++++ athena-db2-as400/Dockerfile | 2 +- athena-db2-as400/athena-db2-as400.yaml | 10 +++++ athena-db2/Dockerfile | 2 +- athena-db2/athena-db2.yaml | 10 +++++ athena-docdb/Dockerfile | 2 +- athena-docdb/athena-docdb.yaml | 10 +++++ athena-dynamodb/Dockerfile | 2 +- athena-dynamodb/athena-dynamodb.yaml | 10 +++++ athena-elasticsearch/Dockerfile | 2 +- .../athena-elasticsearch.yaml | 10 +++++ athena-example/athena-example.yaml | 13 ++++++- .../integ/stacks/ConnectorStack.java | 2 +- .../athena-federation-sdk.yaml | 13 ++++++- athena-federation-sdk/pom.xml | 22 +++++++++++ athena-gcs/Dockerfile | 2 +- athena-gcs/athena-gcs.yaml | 10 +++++ athena-google-bigquery/Dockerfile | 2 +- .../athena-google-bigquery.yaml | 10 +++++ athena-hbase/Dockerfile | 2 +- athena-hbase/athena-hbase.yaml | 10 +++++ athena-hbase/pom.xml | 23 +++++++++++ athena-hortonworks-hive/Dockerfile | 2 +- .../athena-hortonworks-hive.yaml | 10 +++++ athena-kafka/Dockerfile | 2 +- athena-kafka/athena-kafka.yaml | 10 +++++ athena-msk/Dockerfile | 2 +- athena-msk/athena-msk.yaml | 10 +++++ athena-mysql/Dockerfile | 2 +- athena-mysql/athena-mysql.yaml | 10 +++++ athena-neptune/Dockerfile | 2 +- athena-neptune/athena-neptune.yaml | 10 +++++ athena-neptune/pom.xml | 22 +++++++++++ athena-oracle/Dockerfile | 2 +- athena-oracle/athena-oracle.yaml | 10 +++++ athena-postgresql/Dockerfile | 2 +- athena-postgresql/athena-postgresql.yaml | 10 +++++ athena-redis/Dockerfile | 2 +- athena-redis/athena-redis.yaml | 10 +++++ athena-redshift/Dockerfile | 2 +- athena-redshift/athena-redshift.yaml | 10 +++++ athena-saphana/Dockerfile | 2 +- athena-saphana/athena-saphana.yaml | 10 +++++ athena-snowflake/Dockerfile | 2 +- athena-snowflake/athena-snowflake.yaml | 10 +++++ athena-sqlserver/Dockerfile | 2 +- athena-sqlserver/athena-sqlserver.yaml | 10 +++++ athena-synapse/Dockerfile | 2 +- athena-synapse/athena-synapse.yaml | 10 +++++ athena-teradata/Dockerfile | 2 +- athena-teradata/athena-teradata.yaml | 10 +++++ athena-timestream/Dockerfile | 2 +- athena-timestream/athena-timestream.yaml | 10 +++++ athena-timestream/pom.xml | 22 +++++++++++ athena-tpcds/Dockerfile | 2 +- athena-tpcds/athena-tpcds.yaml | 10 +++++ athena-udfs/Dockerfile | 2 +- athena-udfs/athena-udfs.yaml | 12 ++++++ athena-vertica/Dockerfile | 2 +- athena-vertica/athena-vertica.yaml | 10 +++++ athena-vertica/pom.xml | 22 +++++++++++ pom.xml | 38 ++++++++++++++++++- 75 files changed, 538 insertions(+), 37 deletions(-) diff --git a/athena-aws-cmdb/Dockerfile b/athena-aws-cmdb/Dockerfile index a599a28963..da890e3d1d 100644 --- a/athena-aws-cmdb/Dockerfile +++ b/athena-aws-cmdb/Dockerfile @@ -1,4 +1,4 @@ -FROM public.ecr.aws/lambda/java:11 +FROM public.ecr.aws/lambda/java:17 # 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 8ead0e1db0..907e1e722e 100644 --- a/athena-aws-cmdb/athena-aws-cmdb.yaml +++ b/athena-aws-cmdb/athena-aws-cmdb.yaml @@ -40,10 +40,19 @@ 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' @@ -53,6 +62,7 @@ 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 a092ba28cb..e9b9bcda40 100644 --- a/athena-clickhouse/Dockerfile +++ b/athena-clickhouse/Dockerfile @@ -1,4 +1,4 @@ -FROM public.ecr.aws/lambda/java:11 +FROM public.ecr.aws/lambda/java:17 # 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 8f65ef1018..f3e9f0203e 100644 --- a/athena-clickhouse/athena-clickhouse.yaml +++ b/athena-clickhouse/athena-clickhouse.yaml @@ -56,11 +56,20 @@ 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' @@ -71,6 +80,7 @@ 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 266ff4b120..1955a48d9d 100644 --- a/athena-cloudera-hive/Dockerfile +++ b/athena-cloudera-hive/Dockerfile @@ -1,4 +1,4 @@ -FROM public.ecr.aws/lambda/java:11 +FROM public.ecr.aws/lambda/java:17 # 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 2ec64cad7b..4b2169d42a 100644 --- a/athena-cloudera-hive/athena-cloudera-hive.yaml +++ b/athena-cloudera-hive/athena-cloudera-hive.yaml @@ -52,10 +52,19 @@ 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' @@ -66,6 +75,7 @@ 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 67742679e0..194f1b3687 100644 --- a/athena-cloudera-impala/Dockerfile +++ b/athena-cloudera-impala/Dockerfile @@ -1,4 +1,4 @@ -FROM public.ecr.aws/lambda/java:11 +FROM public.ecr.aws/lambda/java:17 # 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 55e1d742d7..48e2c3dcbc 100644 --- a/athena-cloudera-impala/athena-cloudera-impala.yaml +++ b/athena-cloudera-impala/athena-cloudera-impala.yaml @@ -52,6 +52,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" LambdaEncryptionKmsKeyARN: Description: "(Optional) The KMS Key ARN used for encrypting your Lambda environment variables." Default: "" @@ -61,6 +69,7 @@ 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' @@ -71,6 +80,7 @@ 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 b3eafc1e38..7ad3128758 100644 --- a/athena-cloudwatch-metrics/Dockerfile +++ b/athena-cloudwatch-metrics/Dockerfile @@ -1,4 +1,4 @@ -FROM public.ecr.aws/lambda/java:11 +FROM public.ecr.aws/lambda/java:17 # 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 5f4ce7585c..adf89d2df6 100644 --- a/athena-cloudwatch-metrics/athena-cloudwatch-metrics.yaml +++ b/athena-cloudwatch-metrics/athena-cloudwatch-metrics.yaml @@ -40,10 +40,19 @@ 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' @@ -53,6 +62,7 @@ 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 9859ff8b4c..dddd041a37 100644 --- a/athena-cloudwatch/Dockerfile +++ b/athena-cloudwatch/Dockerfile @@ -1,4 +1,4 @@ -FROM public.ecr.aws/lambda/java:11 +FROM public.ecr.aws/lambda/java:17 # 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 860dbf9c5d..4333f483a0 100644 --- a/athena-cloudwatch/athena-cloudwatch.yaml +++ b/athena-cloudwatch/athena-cloudwatch.yaml @@ -48,6 +48,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: HasKMSKeyId: !Not [!Equals [!Ref KMSKeyId, ""]] @@ -56,6 +64,7 @@ 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' @@ -66,6 +75,7 @@ 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 d6667524ad..f7ea96117e 100644 --- a/athena-datalakegen2/Dockerfile +++ b/athena-datalakegen2/Dockerfile @@ -1,4 +1,4 @@ -FROM public.ecr.aws/lambda/java:11 +FROM public.ecr.aws/lambda/java:17 # 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 1318145981..c396c14431 100644 --- a/athena-datalakegen2/athena-datalakegen2.yaml +++ b/athena-datalakegen2/athena-datalakegen2.yaml @@ -56,12 +56,21 @@ 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' @@ -72,6 +81,7 @@ 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 cac4944c1a..a88320db4d 100644 --- a/athena-db2-as400/Dockerfile +++ b/athena-db2-as400/Dockerfile @@ -1,4 +1,4 @@ -FROM public.ecr.aws/lambda/java:11 +FROM public.ecr.aws/lambda/java:17 # 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 ac6dca58a5..2409581f63 100644 --- a/athena-db2-as400/athena-db2-as400.yaml +++ b/athena-db2-as400/athena-db2-as400.yaml @@ -57,12 +57,21 @@ 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' @@ -73,6 +82,7 @@ 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 26e4d3746a..b709eb0257 100644 --- a/athena-db2/Dockerfile +++ b/athena-db2/Dockerfile @@ -1,4 +1,4 @@ -FROM public.ecr.aws/lambda/java:11 +FROM public.ecr.aws/lambda/java:17 # 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 711652357a..f866199f65 100644 --- a/athena-db2/athena-db2.yaml +++ b/athena-db2/athena-db2.yaml @@ -57,12 +57,21 @@ 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' @@ -73,6 +82,7 @@ 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 0c3cb8a82c..48fdec00d0 100644 --- a/athena-docdb/Dockerfile +++ b/athena-docdb/Dockerfile @@ -1,4 +1,4 @@ -FROM public.ecr.aws/lambda/java:11 +FROM public.ecr.aws/lambda/java:17 # 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 5b8a91261a..19c7173bb7 100644 --- a/athena-docdb/athena-docdb.yaml +++ b/athena-docdb/athena-docdb.yaml @@ -53,10 +53,19 @@ 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' @@ -67,6 +76,7 @@ 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 868346d735..b94fa9910e 100644 --- a/athena-dynamodb/Dockerfile +++ b/athena-dynamodb/Dockerfile @@ -1,4 +1,4 @@ -FROM public.ecr.aws/lambda/java:11 +FROM public.ecr.aws/lambda/java:17 # 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 366fcd85cd..4ce7073967 100644 --- a/athena-dynamodb/athena-dynamodb.yaml +++ b/athena-dynamodb/athena-dynamodb.yaml @@ -48,6 +48,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: HasKMSKeyId: !Not [!Equals [!Ref KMSKeyId, ""]] @@ -56,6 +64,7 @@ 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' @@ -66,6 +75,7 @@ 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 d153e67a95..eb749b16b6 100644 --- a/athena-elasticsearch/Dockerfile +++ b/athena-elasticsearch/Dockerfile @@ -1,4 +1,4 @@ -FROM public.ecr.aws/lambda/java:11 +FROM public.ecr.aws/lambda/java:17 # 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 f99f6800c1..d8af0a3820 100644 --- a/athena-elasticsearch/athena-elasticsearch.yaml +++ b/athena-elasticsearch/athena-elasticsearch.yaml @@ -82,12 +82,21 @@ 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' @@ -102,6 +111,7 @@ 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 19230b92a6..ab8d28a9fd 100644 --- a/athena-example/athena-example.yaml +++ b/athena-example/athena-example.yaml @@ -42,6 +42,16 @@ 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' @@ -52,11 +62,12 @@ 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: java11 + Runtime: java17 Timeout: !Ref LambdaTimeout MemorySize: !Ref LambdaMemory Policies: diff --git a/athena-federation-integ-test/src/main/java/com/amazonaws/athena/connector/integ/stacks/ConnectorStack.java b/athena-federation-integ-test/src/main/java/com/amazonaws/athena/connector/integ/stacks/ConnectorStack.java index e4af87d869..3cacd0d640 100644 --- a/athena-federation-integ-test/src/main/java/com/amazonaws/athena/connector/integ/stacks/ConnectorStack.java +++ b/athena-federation-integ-test/src/main/java/com/amazonaws/athena/connector/integ/stacks/ConnectorStack.java @@ -112,7 +112,7 @@ protected Function.Builder lambdaFunctionBuilder() .build()) .build())) .handler(functionHandler) - .runtime(new Runtime("java11")) + .runtime(new Runtime("java17")) .memorySize(Integer.valueOf(3008)) .timeout(Duration.seconds(Integer.valueOf(900))) .environment(environmentVariables); diff --git a/athena-federation-sdk/athena-federation-sdk.yaml b/athena-federation-sdk/athena-federation-sdk.yaml index 559e6830bc..fead11a63e 100644 --- a/athena-federation-sdk/athena-federation-sdk.yaml +++ b/athena-federation-sdk/athena-federation-sdk.yaml @@ -36,6 +36,16 @@ 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' @@ -45,11 +55,12 @@ 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: java11 + Runtime: java17 Timeout: !Ref LambdaTimeout MemorySize: !Ref LambdaMemory Policies: diff --git a/athena-federation-sdk/pom.xml b/athena-federation-sdk/pom.xml index 9d1d5af124..b97d03585a 100644 --- a/athena-federation-sdk/pom.xml +++ b/athena-federation-sdk/pom.xml @@ -441,4 +441,26 @@ + + + java17 + + 17 + + + + + maven-surefire-plugin + ${surefire.failsafe.version} + + --add-opens=java.base/java.nio=ALL-UNNAMED + slow + + + + + + + + diff --git a/athena-gcs/Dockerfile b/athena-gcs/Dockerfile index 04614fe43b..59d9584664 100644 --- a/athena-gcs/Dockerfile +++ b/athena-gcs/Dockerfile @@ -1,4 +1,4 @@ -FROM public.ecr.aws/lambda/java:11 +FROM public.ecr.aws/lambda/java:17 # 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 aabe3fa4e2..3d4ca5eba4 100644 --- a/athena-gcs/athena-gcs.yaml +++ b/athena-gcs/athena-gcs.yaml @@ -44,11 +44,20 @@ 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' @@ -59,6 +68,7 @@ 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 b1dbf5ef11..268f44fd45 100644 --- a/athena-google-bigquery/Dockerfile +++ b/athena-google-bigquery/Dockerfile @@ -1,4 +1,4 @@ -FROM public.ecr.aws/lambda/java:11 +FROM public.ecr.aws/lambda/java:17 # 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 b92e9d01ea..92c56bec10 100644 --- a/athena-google-bigquery/athena-google-bigquery.yaml +++ b/athena-google-bigquery/athena-google-bigquery.yaml @@ -60,12 +60,21 @@ 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' @@ -79,6 +88,7 @@ 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 6772c2c793..69697f84ed 100644 --- a/athena-hbase/Dockerfile +++ b/athena-hbase/Dockerfile @@ -1,4 +1,4 @@ -FROM public.ecr.aws/lambda/java:11 +FROM public.ecr.aws/lambda/java:17 # 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 ba51dfd827..1d94f226d9 100644 --- a/athena-hbase/athena-hbase.yaml +++ b/athena-hbase/athena-hbase.yaml @@ -52,6 +52,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" KerberosAuthEnabled: Description: 'Kerberos authentication enabled or not' Default: "false" @@ -72,6 +80,7 @@ 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' @@ -86,6 +95,7 @@ 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-hbase/pom.xml b/athena-hbase/pom.xml index cda70c9c2f..538ebb83ac 100644 --- a/athena-hbase/pom.xml +++ b/athena-hbase/pom.xml @@ -147,4 +147,27 @@ + + + java17 + + 17 + + + + + org.apache.maven.plugins + maven-surefire-plugin + ${surefire.failsafe.version} + + -Xmx4g --add-opens=java.base/java.nio=ALL-UNNAMED + + *IntegTest + + + + + + + diff --git a/athena-hortonworks-hive/Dockerfile b/athena-hortonworks-hive/Dockerfile index d0c666fb70..ba658c7a71 100644 --- a/athena-hortonworks-hive/Dockerfile +++ b/athena-hortonworks-hive/Dockerfile @@ -1,4 +1,4 @@ -FROM public.ecr.aws/lambda/java:11 +FROM public.ecr.aws/lambda/java:17 # 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 85f8dfc206..c44b137689 100644 --- a/athena-hortonworks-hive/athena-hortonworks-hive.yaml +++ b/athena-hortonworks-hive/athena-hortonworks-hive.yaml @@ -54,12 +54,21 @@ 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' @@ -70,6 +79,7 @@ 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 fbab927e79..4e3f7545db 100644 --- a/athena-kafka/Dockerfile +++ b/athena-kafka/Dockerfile @@ -1,4 +1,4 @@ -FROM public.ecr.aws/lambda/java:11 +FROM public.ecr.aws/lambda/java:17 # 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 2479b64225..5501e28979 100644 --- a/athena-kafka/athena-kafka.yaml +++ b/athena-kafka/athena-kafka.yaml @@ -79,6 +79,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: NotHasLambdaRole: !Equals [!Ref LambdaRoleARN, ""] @@ -87,6 +95,7 @@ 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' @@ -101,6 +110,7 @@ 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 b9cc2149da..b207e7008d 100644 --- a/athena-msk/Dockerfile +++ b/athena-msk/Dockerfile @@ -1,4 +1,4 @@ -FROM public.ecr.aws/lambda/java:11 +FROM public.ecr.aws/lambda/java:17 # 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 f04269c75f..7c0b71aa41 100644 --- a/athena-msk/athena-msk.yaml +++ b/athena-msk/athena-msk.yaml @@ -75,6 +75,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: NotHasLambdaRole: !Equals [!Ref LambdaRoleARN, ""] @@ -83,6 +91,7 @@ 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' @@ -96,6 +105,7 @@ 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 64e7a2115a..874f625391 100644 --- a/athena-mysql/Dockerfile +++ b/athena-mysql/Dockerfile @@ -1,4 +1,4 @@ -FROM public.ecr.aws/lambda/java:11 +FROM public.ecr.aws/lambda/java:17 # 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 c657e41e64..b50398141e 100644 --- a/athena-mysql/athena-mysql.yaml +++ b/athena-mysql/athena-mysql.yaml @@ -56,11 +56,20 @@ 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' @@ -71,6 +80,7 @@ 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 c8573d87c1..7e4ff25959 100644 --- a/athena-neptune/Dockerfile +++ b/athena-neptune/Dockerfile @@ -1,4 +1,4 @@ -FROM public.ecr.aws/lambda/java:11 +FROM public.ecr.aws/lambda/java:17 # 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 ebf995f804..90a8353d85 100644 --- a/athena-neptune/athena-neptune.yaml +++ b/athena-neptune/athena-neptune.yaml @@ -74,11 +74,20 @@ 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' @@ -96,6 +105,7 @@ 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-neptune/pom.xml b/athena-neptune/pom.xml index a004ca3795..cab72b008c 100644 --- a/athena-neptune/pom.xml +++ b/athena-neptune/pom.xml @@ -212,4 +212,26 @@ + + + java17 + + 17 + + + + + org.apache.maven.plugins + maven-surefire-plugin + + --add-opens=java.base/java.nio=ALL-UNNAMED + + ${publishing} + + + + + + + diff --git a/athena-oracle/Dockerfile b/athena-oracle/Dockerfile index cb5216c202..1afc3a34e2 100644 --- a/athena-oracle/Dockerfile +++ b/athena-oracle/Dockerfile @@ -1,4 +1,4 @@ -FROM public.ecr.aws/lambda/java:11 +FROM public.ecr.aws/lambda/java:17 # 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 6badf23d43..87a2093fab 100644 --- a/athena-oracle/athena-oracle.yaml +++ b/athena-oracle/athena-oracle.yaml @@ -65,6 +65,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, "" ] ] NotHasLambdaRole: !Equals [!Ref LambdaRoleARN, ""] @@ -72,6 +80,7 @@ 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' @@ -83,6 +92,7 @@ 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 3376a994dc..2b4138dff6 100644 --- a/athena-postgresql/Dockerfile +++ b/athena-postgresql/Dockerfile @@ -1,4 +1,4 @@ -FROM public.ecr.aws/lambda/java:11 +FROM public.ecr.aws/lambda/java:17 # 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 79d2013130..3b540a24bc 100644 --- a/athena-postgresql/athena-postgresql.yaml +++ b/athena-postgresql/athena-postgresql.yaml @@ -61,6 +61,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" 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 @@ -71,6 +79,7 @@ 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' @@ -82,6 +91,7 @@ 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 3e9e9888f7..08b2e3b165 100644 --- a/athena-redis/Dockerfile +++ b/athena-redis/Dockerfile @@ -1,4 +1,4 @@ -FROM public.ecr.aws/lambda/java:11 +FROM public.ecr.aws/lambda/java:17 # 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 5d18c7ced1..ac2282be49 100644 --- a/athena-redis/athena-redis.yaml +++ b/athena-redis/athena-redis.yaml @@ -49,6 +49,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" 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: '' @@ -69,6 +77,7 @@ 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' @@ -82,6 +91,7 @@ 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 20a2afdef3..802f99fdfb 100644 --- a/athena-redshift/Dockerfile +++ b/athena-redshift/Dockerfile @@ -1,4 +1,4 @@ -FROM public.ecr.aws/lambda/java:11 +FROM public.ecr.aws/lambda/java:17 # 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 b395ce646f..8d06595d37 100644 --- a/athena-redshift/athena-redshift.yaml +++ b/athena-redshift/athena-redshift.yaml @@ -60,6 +60,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: HasKMSKeyId: !Not [!Equals [!Ref KMSKeyId, ""]] NotHasLambdaRole: !Equals [!Ref LambdaRole, ""] @@ -69,6 +77,7 @@ 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' @@ -80,6 +89,7 @@ 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 827a67e65c..db3ee97069 100644 --- a/athena-saphana/Dockerfile +++ b/athena-saphana/Dockerfile @@ -1,4 +1,4 @@ -FROM public.ecr.aws/lambda/java:11 +FROM public.ecr.aws/lambda/java:17 # 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 68ecafe0f2..230c28e119 100644 --- a/athena-saphana/athena-saphana.yaml +++ b/athena-saphana/athena-saphana.yaml @@ -54,12 +54,21 @@ 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' @@ -70,6 +79,7 @@ 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 c14408ec23..82940ff28a 100644 --- a/athena-snowflake/Dockerfile +++ b/athena-snowflake/Dockerfile @@ -1,4 +1,4 @@ -FROM public.ecr.aws/lambda/java:11 +FROM public.ecr.aws/lambda/java:17 # 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 7b86121621..640d3404c7 100644 --- a/athena-snowflake/athena-snowflake.yaml +++ b/athena-snowflake/athena-snowflake.yaml @@ -54,12 +54,21 @@ 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' @@ -70,6 +79,7 @@ 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 2456d9e94b..c16a6530ef 100644 --- a/athena-sqlserver/Dockerfile +++ b/athena-sqlserver/Dockerfile @@ -1,4 +1,4 @@ -FROM public.ecr.aws/lambda/java:11 +FROM public.ecr.aws/lambda/java:17 # 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 4aa9804b16..cdbdfa2aad 100644 --- a/athena-sqlserver/athena-sqlserver.yaml +++ b/athena-sqlserver/athena-sqlserver.yaml @@ -60,6 +60,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, "" ] ] NotHasLambdaRole: !Equals [!Ref LambdaRoleARN, ""] @@ -67,6 +75,7 @@ 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' @@ -77,6 +86,7 @@ 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 ce59270ed0..6e8aea0473 100644 --- a/athena-synapse/Dockerfile +++ b/athena-synapse/Dockerfile @@ -1,4 +1,4 @@ -FROM public.ecr.aws/lambda/java:11 +FROM public.ecr.aws/lambda/java:17 # 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 1c524545f8..8f26ac9bed 100644 --- a/athena-synapse/athena-synapse.yaml +++ b/athena-synapse/athena-synapse.yaml @@ -48,6 +48,14 @@ 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' @@ -68,6 +76,7 @@ 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' @@ -78,6 +87,7 @@ 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 996da2013f..ccb31f259f 100644 --- a/athena-teradata/Dockerfile +++ b/athena-teradata/Dockerfile @@ -1,4 +1,4 @@ -FROM public.ecr.aws/lambda/java:11 +FROM public.ecr.aws/lambda/java:17 # 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 987201837b..5bb2e3a937 100644 --- a/athena-teradata/athena-teradata.yaml +++ b/athena-teradata/athena-teradata.yaml @@ -58,12 +58,21 @@ 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' @@ -75,6 +84,7 @@ 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 8a0be2c8f9..65c0777226 100644 --- a/athena-timestream/Dockerfile +++ b/athena-timestream/Dockerfile @@ -1,4 +1,4 @@ -FROM public.ecr.aws/lambda/java:11 +FROM public.ecr.aws/lambda/java:17 # 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 3062d1f435..d2da77f603 100644 --- a/athena-timestream/athena-timestream.yaml +++ b/athena-timestream/athena-timestream.yaml @@ -40,10 +40,19 @@ 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' @@ -53,6 +62,7 @@ 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-timestream/pom.xml b/athena-timestream/pom.xml index f00279ec9d..30bbf19ae0 100644 --- a/athena-timestream/pom.xml +++ b/athena-timestream/pom.xml @@ -143,4 +143,26 @@ + + + java17 + + 17 + + + + + org.apache.maven.plugins + maven-surefire-plugin + + --add-opens=java.base/java.nio=ALL-UNNAMED + + ${publishing} + + + + + + + diff --git a/athena-tpcds/Dockerfile b/athena-tpcds/Dockerfile index 7c4d31ffa1..508ccea7f7 100644 --- a/athena-tpcds/Dockerfile +++ b/athena-tpcds/Dockerfile @@ -1,4 +1,4 @@ -FROM public.ecr.aws/lambda/java:11 +FROM public.ecr.aws/lambda/java:17 # 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 ed88425b11..493a610d92 100644 --- a/athena-tpcds/athena-tpcds.yaml +++ b/athena-tpcds/athena-tpcds.yaml @@ -40,10 +40,19 @@ 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' @@ -53,6 +62,7 @@ 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 d18b85ae78..42ce47cfcb 100644 --- a/athena-udfs/Dockerfile +++ b/athena-udfs/Dockerfile @@ -1,4 +1,4 @@ -FROM public.ecr.aws/lambda/java:11 +FROM public.ecr.aws/lambda/java:17 # 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 8a36679838..c0cc2ebf43 100644 --- a/athena-udfs/athena-udfs.yaml +++ b/athena-udfs/athena-udfs.yaml @@ -32,14 +32,26 @@ 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 diff --git a/athena-vertica/Dockerfile b/athena-vertica/Dockerfile index c06ed8b9c2..2273303d1d 100644 --- a/athena-vertica/Dockerfile +++ b/athena-vertica/Dockerfile @@ -1,4 +1,4 @@ -FROM public.ecr.aws/lambda/java:11 +FROM public.ecr.aws/lambda/java:17 # 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 472e70e253..352e915773 100644 --- a/athena-vertica/athena-vertica.yaml +++ b/athena-vertica/athena-vertica.yaml @@ -60,11 +60,20 @@ 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' @@ -81,6 +90,7 @@ 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/athena-vertica/pom.xml b/athena-vertica/pom.xml index 1b319fa6a2..cdcb533c06 100644 --- a/athena-vertica/pom.xml +++ b/athena-vertica/pom.xml @@ -141,4 +141,26 @@ + + + java17 + + 17 + + + + + org.apache.maven.plugins + maven-surefire-plugin + + --add-opens=java.base/java.nio=ALL-UNNAMED + + ${publishing} + + + + + + + diff --git a/pom.xml b/pom.xml index 363e67d55f..fbb14673b4 100644 --- a/pom.xml +++ b/pom.xml @@ -11,7 +11,9 @@ - 11 + + + 17 3.13.0 2.29.29 @@ -385,6 +387,40 @@ + + java17 + + 17 + + + + + org.apache.maven.plugins + maven-surefire-plugin + ${surefire.failsafe.version} + + --add-opens=java.base/java.nio=ALL-UNNAMED + + *IntegTest + + + + + org.apache.maven.plugins + maven-failsafe-plugin + ${surefire.failsafe.version} + + --add-opens=java.base/java.nio=ALL-UNNAMED + 3C + false + + *IntegTest + + + + + + release