You configure PostgreSQL RDS instance as the data source for Amazon Athena so that you can query RDS data from the Athena Query Editor.
-
Goto Athena Management console and click on Data sources link.
-
On the next screen, click on the Connect data source button.
-
On the next screen, select Query a data source option and then select PostgreSQL as the data source. Finally, click on the Next button.
-
On the next screen, click on the Configure new AWS Lambda Function link button.
-
It will open Lambda JDBC Connector configuration on a new browser tab or window. In the configuration, type in DojoAthenaJdbcConnector for the application name. Type in none for the SecretNamePrefix because the application is not using secret in the AWS Secrets Manager. Type in dojo-spill-bkt for the spill bucket. If you created S3 spill bucket with a different name, use that name here.
-
On the same screen, type in postgres://jdbc:postgresql://{RDS-ENDPOINT}:5432/dojodatabase?user=postgres&password=Password1! for the default connection string. Replace {RDS-ENDPOINT} with the RDS Endpoint you made note of in the previous steps.
-
On the same screen, type in dojolambdapostgresconnector as the function name. Type in security group id of the RDS instance you noted in the previous steps. Type in one of the subnet id of the RDS instance you noted in the previous steps. Select the achnowledgement checkbox. Keep rest of the configuration to the default and click on the Deploy button.
-
The Lambda application deployment will start. Wait till you see Create complete status for the serverlessrepo-DojoAthenaJdbcConnector application.
-
The Lambda connector is ready. Go back to the Athena Window and click on the refresh icon to get latest list of the Lambda functions.
-
Select dojolambdapostgresconnector Lambda function. Type in dojordscatalog for the catalog name. Finally, click on the Connect button.
-
The RDS PostgreSQL instance is now configured as the data source for the Amazon Athena service.
-
In the next step, you make some changes in the dojolambdapostgresconnector Lambda function before it is ready for the query purpose.