Skip to main content
 print this page

Connect to Playground through JDBC connection

With Amorphic, you can connect to a playground from numerous different programs. Examples of these programs include SQL Workbench, DbVisualizer, and Quicksight.

Credentials

To initiate a jdbc connection to playground, you would need the following credentials:

  • api_gateway_url Click on documentation icon on top right corner of home page and navigate to API docs to find the base url.
    Eg: 1234567890.execute-api.us-west-2.amazonaws.com/dev
  • personal_access_token Click on user profile icon on top right corner of home page and navigate to profile & settings -> Click on Access tokens and click create new token on the top right corner. This role should have fullaccess to run queries on playground. (runquery.fullaccess)
    Eg: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6Ikpva
    G4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
  • role_id Click on Manage button of home screen -> Navigate to Administration and click on the Role Management and select the role used in the previous step and make a note of role id from url.
    Eg: admin-role-123456-81cf-4dd2-b876-1234567890

Amorphic custom credentials jar

Along with the above mentioned credentials you will need to download Amazon Athena JDBC Driver and Amorphic custom credentials jar

Connecting to Playground from SQL Workbench

  1. In SQL Workbench, Open File -> Manage Drivers. Choose the Athena driver and add two libraries, Athena JDBC driver and the custom credentials provider by specifying the location where you downloaded them. Drivers
  2. To enable running queries in Playground through SQL Workbench, configure a playground connection with the below URL: jdbc:awsathena://AwsRegion=region_code Connection_Details
  3. Choose Extended Properties and enter the properties as follows:
       "AWSCredentialsProviderClass"="com.amazonaws.custom.athena.jdbc.AmorphicCustomCredentialsProvider"
"AWSCredentialsProviderArguments"="{api_gateway_url},{personal_access_token},{role_id}"
"S3OutputLocation"="s3://{bucket_where_query_results_are_stored}"
"LogPath"="{local_path_where_logs_are_stored}"
"LogLevel"="{Log_Level_from_0_to_6}"
"Workgroup"="{primary}/AmazonAthenaEngineV3>"

S3OutputLocation - The s3 location format should be s3://<project_name>-<region>-<account_id>-<env_name>-athena/<user_id> Playground now supports Workgroups concept with the latest version of Athena JDBC driver 4. Choose Test to verify that you can successfully connect to playground. Extended_Properties 5. Run a query in SQL Workbench to verify that credentials are correctly applied. Sql_Query

limits

Number of datasets depends on the character limit of IAM policy so users can add Dataset level access (DLA) domains to access all the datasets created under that domain which avoids the datasets limit.