Athena Federated Query with Amazon RDS

   Go back to the Task List

  « 4. Configure Amazon Athena Engine Version    6. Update Lambda Connector »

5. Configure RDS as Data Source

You configure PostgreSQL RDS instance as the data source for Amazon Athena so that you can query RDS data from the Athena Query Editor.

  1. Goto Athena Management console and click on Data sources link.

    Athena

  2. On the next screen, click on the Connect data source button.

    Athena

  3. On the next screen, select Query a data source option and then select PostgreSQL as the data source. Finally, click on the Next button.

    Athena

  4. On the next screen, click on the Configure new AWS Lambda Function link button.

    Athena

  5. 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.

    Athena

  6. 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.

    Athena

  7. 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.

    Athena

  8. The Lambda application deployment will start. Wait till you see Create complete status for the serverlessrepo-DojoAthenaJdbcConnector application.

    Athena

  9. 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.

    Athena

  10. Select dojolambdapostgresconnector Lambda function. Type in dojordscatalog for the catalog name. Finally, click on the Connect button.

    Athena

  11. The RDS PostgreSQL instance is now configured as the data source for the Amazon Athena service.

    Athena

  12. In the next step, you make some changes in the dojolambdapostgresconnector Lambda function before it is ready for the query purpose.