diff --git a/athena-snowflake/Dockerfile b/athena-snowflake/Dockerfile index 8be8478258..870c325667 100644 --- a/athena-snowflake/Dockerfile +++ b/athena-snowflake/Dockerfile @@ -1,9 +1,18 @@ -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} + # Unpack the jar RUN jar xf athena-snowflake.zip -# Set the CMD to your handler (could also be done as a parameter override outside of the Dockerfile) -CMD [ "com.amazonaws.athena.connectors.snowflake.SnowflakeMuxCompositeHandler" ] \ No newline at end of file +# Set the CMD to your handler +CMD [ "com.amazonaws.athena.connectors.snowflake.SnowflakeMuxCompositeHandler" ] diff --git a/athena-snowflake/athena-snowflake.yaml b/athena-snowflake/athena-snowflake.yaml index 657a339da7..0646c8a5e6 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/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 +