In this post, you'll learn how to query tables located in DynamoDB databases using SQL syntax in superQuery
With DynamoDB connected, you'll be able to:
Perform table joins — even across regions.
Run aggregations without any ETL.
Export all results — not just one page at a time.
Get faster Scan results with parallel execution.
...and much more!
Let's get started!
Under "Resources", click on the "+" sign next to the Connections tab.
Next, under "Available Integrations" click on the "Connect" button that appears next to "DynamoDB".
A modal will appear for you to enter your AWS Athena credentials:
First, give your connection any name you'd like. Then, select which region(s) you want to connect to.
There are two ways to connect DynamoDB to superQuery
Using Account Access Keys
Connecting via your IAM Role ARN
Method #1: Use your Account Access Keys
In this first method, you'll just need to enter your Access key and Secret Access key from AWS.
In order to get your Access Key ID and Secret Access Key follow these steps:
Open the IAM console.
From the navigation menu, click Users.
Select your IAM user name.
Click User Actions, and then click Manage Access Keys.
Click Create Access Key.
Your keys will look something like this:
Access key ID example: AKIAIOSFODNN7EXAMPLE
Secret access key example: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Finally, click Download Credentials, and store the keys in a secure location.
An IAM role is an IAM identity that you can create in your account that has specific permissions.
Amazon Resource Name (ARN) formatting is used to uniquely identify AWS resources — in this case, your IAM role.
Example formatting: arn:aws:iam::account-id:role/role-name
Creating an IAM Role
In this second method, you will need to create an IAM role with sufficient permissions in AWS through which superQuery will access DynamoDB.
Open IAM, and under "Access Management" click on "Roles"
Click on "Create role" and select "Another AWS account"
Enter 717898102007 in the "Account ID" text box. This is superQuery's account ID.
Click "Next" and add the policy "AmazonDynamoDBFullAccess"
Give your new role a name and click "Create role"
Once you've completed these steps, you'll have the information needed to provide the IAM Role ARN in superQuery, using the formatting mentioned above.
Your DynamoDB data is stored and categorized in three levels of hierarchy.
Once you've successfully authenticated and a query result location has been set, your DynamoDB connection will appear in superQuery as one of your main folders as "dynamo-AKIAXXXXXXXXXXXX".
Under that, you will see the next level of information appear with the names of the region(s) you selected. Finally, you'll find your tables under the region you select.