Skip to content

Commit 0668028

Browse files
authored
Merge branch 'master' into add-unit-tests-sdk
2 parents 6e38068 + 9eeb272 commit 0668028

File tree

78 files changed

+259
-79
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+259
-79
lines changed

Dockerfile

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# Argument for Java version, defaulting to 11
2+
ARG JAVA_VERSION=11
3+
# Use the specified version of Java
4+
FROM public.ecr.aws/lambda/java:${JAVA_VERSION}
5+
6+
# Argument for Java tool options for ssl
7+
ARG JAVA_TOOL_OPTIONS="-Djavax.net.ssl.trustStore=/var/lang/lib/security/cacerts"
8+
# Set the JAVA_TOOL_OPTIONS environment variable for Java 17
9+
ENV JAVA_TOOL_OPTIONS=${JAVA_TOOL_OPTIONS}
10+
11+
# Install necessary tools
12+
RUN yum update -y
13+
RUN yum install -y curl perl openssl11
14+
15+
ENV truststore=/var/lang/lib/security/cacerts
16+
ENV storepassword=changeit
17+
18+
# Download and process the RDS certificate
19+
RUN curl -sS "https://truststore.pki.rds.amazonaws.com/global/global-bundle.pem" > ${LAMBDA_TASK_ROOT}/global-bundle.pem && \
20+
awk 'split_after == 1 {n++;split_after=0} /-----END CERTIFICATE-----/ {split_after=1}{print > "rds-ca-" n ".pem"}' < ${LAMBDA_TASK_ROOT}/global-bundle.pem
21+
22+
# Import certificates into the truststore
23+
RUN for CERT in rds-ca-*; do \
24+
alias=$(openssl11 x509 -noout -text -in $CERT | perl -ne 'next unless /Subject:/; s/.*(CN=|CN = )//; print') && \
25+
echo "Importing $alias" && \
26+
keytool -import -file ${CERT} -alias "${alias}" -storepass ${storepassword} -keystore ${truststore} -noprompt && \
27+
rm $CERT; \
28+
done
29+
30+
# Clean up
31+
RUN rm ${LAMBDA_TASK_ROOT}/global-bundle.pem
32+
33+
# Optional: List the content of the trust store (for verification)
34+
RUN echo "Trust store content is: " && \
35+
keytool -list -v -keystore "$truststore" -storepass ${storepassword} | grep Alias | cut -d " " -f3- | while read alias; do \
36+
expiry=$(keytool -list -v -keystore "$truststore" -storepass ${storepassword} -alias "${alias}" | grep Valid | perl -ne 'if(/until: (.*?)\n/) { print "$1\n"; }'); \
37+
echo " Certificate ${alias} expires in '$expiry'"; \
38+
done
39+
40+
# Set the connector version to use
41+
ARG VERSION=2022.47.1
42+
43+
# Copy all jar files from their respective target directories into the Lambda task root.
44+
# Notice how we substitute the version using ${VERSION}.
45+
COPY \
46+
athena-aws-cmdb/target/athena-aws-cmdb-${VERSION}.jar \
47+
athena-clickhouse/target/athena-clickhouse-${VERSION}.jar \
48+
athena-cloudera-hive/target/athena-cloudera-hive-${VERSION}.jar \
49+
athena-cloudera-impala/target/athena-cloudera-impala-${VERSION}.jar \
50+
athena-cloudwatch/target/athena-cloudwatch-${VERSION}.jar \
51+
athena-cloudwatch-metrics/target/athena-cloudwatch-metrics-${VERSION}.jar \
52+
athena-datalakegen2/target/athena-datalakegen2-${VERSION}.jar \
53+
athena-db2/target/athena-db2-${VERSION}.jar \
54+
athena-db2-as400/target/athena-db2-as400-${VERSION}.jar \
55+
athena-docdb/target/athena-docdb-${VERSION}.jar \
56+
athena-dynamodb/target/athena-dynamodb-${VERSION}.jar \
57+
athena-elasticsearch/target/athena-elasticsearch-${VERSION}.jar \
58+
athena-gcs/target/athena-gcs.zip \
59+
athena-google-bigquery/target/athena-google-bigquery-${VERSION}.jar \
60+
athena-hbase/target/athena-hbase-${VERSION}.jar \
61+
athena-hortonworks-hive/target/athena-hortonworks-hive-${VERSION}.jar \
62+
athena-kafka/target/athena-kafka-${VERSION}.jar \
63+
athena-msk/target/athena-msk-${VERSION}.jar \
64+
athena-mysql/target/athena-mysql-${VERSION}.jar \
65+
athena-neptune/target/athena-neptune-${VERSION}.jar \
66+
athena-oracle/target/athena-oracle-${VERSION}.jar \
67+
athena-postgresql/target/athena-postgresql-${VERSION}.jar \
68+
athena-redis/target/athena-redis-${VERSION}.jar \
69+
athena-redshift/target/athena-redshift-${VERSION}.jar \
70+
athena-saphana/target/athena-saphana.zip \
71+
athena-snowflake/target/athena-snowflake.zip \
72+
athena-sqlserver/target/athena-sqlserver-${VERSION}.jar \
73+
athena-synapse/target/athena-synapse-${VERSION}.jar \
74+
athena-teradata/target/athena-teradata-${VERSION}.jar \
75+
athena-timestream/target/athena-timestream-${VERSION}.jar \
76+
athena-tpcds/target/athena-tpcds-${VERSION}.jar \
77+
athena-udfs/target/athena-udfs-${VERSION}.jar \
78+
athena-vertica/target/athena-vertica-${VERSION}.jar \
79+
${LAMBDA_TASK_ROOT}/
80+
81+
# Run a shell loop to iterate over all jar/zip files and extract each one.
82+
RUN for file in ${LAMBDA_TASK_ROOT}/*.jar ${LAMBDA_TASK_ROOT}/*.zip; do \
83+
jar xf "$file" && rm -f "$file"; \
84+
done

athena-aws-cmdb/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ COPY target/athena-aws-cmdb-2022.47.1.jar ${LAMBDA_TASK_ROOT}
1414
RUN jar xf athena-aws-cmdb-2022.47.1.jar
1515

1616
# Set the CMD to your handler (could also be done as a parameter override outside of the Dockerfile)
17-
CMD [ "com.amazonaws.athena.connectors.aws.cmdb.AwsCmdbCompositeHandler" ]
17+
# No need to specify here (already defined in .yaml file)

athena-aws-cmdb/athena-aws-cmdb-connection.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ Resources:
5151
ImageUri: !Sub
5252
- '${Account}.dkr.ecr.${AWS::Region}.amazonaws.com/athena-federation-repository-aws-cmdb:2022.47.1'
5353
- Account: !If [IsRegionBAH, 084828588479, !If [IsRegionHKG, 183295418215, 292517598671]]
54+
ImageConfig:
55+
Command: [ "com.amazonaws.athena.connectors.aws.cmdb.AwsCmdbCompositeHandler" ]
5456
Description: "Enables Amazon Athena to communicate with various AWS Services, making your resource inventories accessible via SQL."
5557
Timeout: 900
5658
MemorySize: 3008

athena-aws-cmdb/athena-aws-cmdb.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ Resources:
5858
ImageUri: !Sub
5959
- '${Account}.dkr.ecr.${AWS::Region}.amazonaws.com/athena-federation-repository-aws-cmdb:2022.47.1'
6060
- Account: !If [IsRegionBAH, 084828588479, !If [IsRegionHKG, 183295418215, 292517598671]]
61+
ImageConfig:
62+
Command: [ "com.amazonaws.athena.connectors.aws.cmdb.AwsCmdbCompositeHandler" ]
6163
Description: "Enables Amazon Athena to communicate with various AWS Services, making your resource inventories accessible via SQL."
6264
Timeout: !Ref LambdaTimeout
6365
MemorySize: !Ref LambdaMemory

athena-clickhouse/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ COPY target/athena-clickhouse-2022.47.1.jar ${LAMBDA_TASK_ROOT}
1414
RUN jar xf athena-clickhouse-2022.47.1.jar
1515

1616
# Set the CMD to your handler (could also be done as a parameter override outside of the Dockerfile)
17-
CMD [ "com.amazonaws.athena.connectors.clickhouse.ClickHouseMuxCompositeHandler" ]
17+
# No need to specify here (already defined in .yaml file because legacy and connections use different)

athena-clickhouse/athena-clickhouse.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ Resources:
7676
ImageUri: !Sub
7777
- '${Account}.dkr.ecr.${AWS::Region}.amazonaws.com/athena-federation-repository-clickhouse:2022.47.1'
7878
- Account: !If [IsRegionBAH, 084828588479, !If [IsRegionHKG, 183295418215, 292517598671]]
79+
ImageConfig:
80+
Command: [ "com.amazonaws.athena.connectors.clickhouse.ClickHouseMuxCompositeHandler" ]
7981
Description: "Enables Amazon Athena to communicate with ClickHouse using JDBC"
8082
Timeout: !Ref LambdaTimeout
8183
MemorySize: !Ref LambdaMemory

athena-clickhouse/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<dependency>
2323
<groupId>com.clickhouse</groupId>
2424
<artifactId>clickhouse-jdbc</artifactId>
25-
<version>0.8.2</version>
25+
<version>0.8.3</version>
2626
<classifier>all</classifier>
2727
</dependency>
2828
<dependency>

athena-cloudera-hive/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@
116116
<plugin>
117117
<groupId>org.jacoco</groupId>
118118
<artifactId>jacoco-maven-plugin</artifactId>
119-
<version>0.8.12</version>
119+
<version>0.8.13</version>
120120
<executions>
121121
<execution>
122122
<goals>

athena-cloudera-impala/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@
117117
<plugin>
118118
<groupId>org.jacoco</groupId>
119119
<artifactId>jacoco-maven-plugin</artifactId>
120-
<version>0.8.12</version>
120+
<version>0.8.13</version>
121121
<executions>
122122
<execution>
123123
<goals>

athena-cloudwatch-metrics/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ COPY target/athena-cloudwatch-metrics-2022.47.1.jar ${LAMBDA_TASK_ROOT}
1414
RUN jar xf athena-cloudwatch-metrics-2022.47.1.jar
1515

1616
# Set the CMD to your handler (could also be done as a parameter override outside of the Dockerfile)
17-
CMD [ "com.amazonaws.athena.connectors.cloudwatch.metrics.MetricsCompositeHandler" ]
17+
# No need to specify here (already defined in .yaml file)

0 commit comments

Comments
 (0)