Athena =========================
Knowi enables seamless data discovery, querying, visualization, and automated reporting from Amazon Athena. You can set up and connect to Athena using IAM credentials, instance roles, or assume role capabilities.

Add Amazon Athena Datasource

Connect and extract data from your Athena instance through one of the following methods:

IAM User: Use an AWS IAM user with access to Athena and S3. Instance Role: Attach permissions to an Amazon instance or pod. Assume Role: Access Athena in another AWS account using role delegation.

Option 1: Connecting via IAM User

  1. Create or Use an IAM User:
    • Set up a new IAM user or use an existing one.
    • Assign the following permissions:
      a. AthenaFullAccess or AthenaReadAccess.
      b. S3FullAccess or S3ReadWriteAccess for query result storage.

image alt text

  1. Generate Access Keys:
    • Go to the Security Credentials page for the IAM user.
    • Create or use an existing Access Key and Secret Key. Note these credentials.

image alt text

  1. Set Up S3 Query Results Folder:
    • Create a folder in S3 to store Athena query results.
    • Take note of the S3 path.

image alt text

  1. Configure the Datasource in Knowi:
    • Navigate to Queries and click New Datasource+.
    • Select Amazon Athena.
    • Enter the following details:
      a. Datasource Name: Provide a name for your datasource.
      b. Access Key ID and Secret Key: Use the IAM user's keys.
      c. S3 Query Results Folder Path: Provide the S3 path.

image alt text

  1. Test the Connection:
    • Click Test Connection to validate the setup.
    • If successful, you can create and run queries in Knowi.

image alt text

Option 2: Connecting via Instance Role

  1. Create or Edit an IAM Role:
    • Set up a new role or edit an existing one in AWS IAM.
    • Assign the following permissions:
      a. AthenaFullAccess or AthenaReadAccess.
      b. S3FullAccess or S3ReadWriteAccess.

image alt text

  1. Launch Amazon Instance or Pod:
    • Attach the role to an EC2 instance or Kubernetes pod.

image alt text

  1. Configure the Datasource in Knowi:
    • Navigate to Queries and click New Datasource+.
    • Select Amazon Athena.
    • Leave the Access Key ID and Secret Key fields empty.

image alt text

  1. Test and Run Queries:
    • Click Test Connection to verify the connection.
    • Once verified, you can create and run Athena queries.

image alt text

Connecting via Assume Role

  1. Enable Role Delegation:
    • Configure your IAM role to assume roles in other AWS accounts.
    • Refer to the AWS documentation on the AssumeRole API.

image alt text

  1. Obtain Role ARN and External ID:
    • Get the Role ARN and, if needed, the External ID from the target AWS account.

image alt text

  1. Configure the Datasource in Knowi:

    • Navigate to New Datasource+ and select Amazon Athena.
    • Enter the Assume Role ARN and External ID.
  2. Test the Connection:

    • Click Test Connection to validate the setup.
    • Once successful, you can start querying data across accounts.