Connecting to cloud databases
In this recipe, we'll connect to a local Amazon AWS Athena database. Just like on-premises data connections, Tableau has made it as easy as possible to connect securely to cloud data sources. You'll find many connections for popular cloud providers including Microsoft, Google, and Amazon. Each data connection dialog has been customized to the technology you're attempting to connect to. This means you won't see irrelevant fields for the selected connection type, reducing the complexity of cloud connections.
Getting ready
In order to follow along with this recipe, you must have data stored and have access to that data in Amazon AWS Athena.
Tip
Getting set up on AWS Athena is beyond the scope of this book. However, if you wish to explore this option, the simplest way to get started is to create an account at https://aws.amazon.com/, then upload data to S3, and make it available to Athena by using AWS Glue. To use the same sample data as this recipe, download the Sample files 2.5 folder from the book's GitHub repository.
How to do it…
To get started, ensure you have Tableau Prep Builder open, then follow these steps:
- From the home screen, click the Connect to Data button, then search for Athena in the Connect pane. Select Amazon Athena to continue.
- In the Connection dialog, enter the details for your AWS Athena instance and click Sign In to continue:
a) The Server field for Athena needs to be populated with the region information. The format for this is athena.[region].amazonaws.com. For example, athena.us-east-1.amazonaws.com or athena.eu-west-1.amazonaws.com.
b) The staging directory is where your Athena results are stored in AWS S3 and follows the format s3://[s3 bucket]/[s3 folder]. For example, s3://company/orders.
c) Finally, you'll need your AWS access key information. For information on how to obtain this, see the AWS documentation at https://docs.aws.amazon.com/general/latest/gr/aws-sec-cred-types.html#access-keys-and-secret-access-keys.
d) You'll also need to install the Amazon Athena JDBC driver, which Tableau provides on its download page at https://www.tableau.com/support/drivers.
- Next, select the appropriate Catalogue from the dropdown. In Athena terminology, this is the data source:
- In the last step, select the database of your choice and drag the table you need onto the flow canvas. In our example, I've selected a database named opssalesdb and dragged a table named results onto the flow canvas:
By following the steps in this recipe, you are now able to connect Tableau Prep to cloud databases.
How it works…
Similar to on-premises data connections, Tableau Prep provides a simplified user interface on top of the database driver, so you can easily configure the connection. In this recipe, we've used the Athena JDBC driver in the background and configuring it is as easy as any other connections.
There's more…
The following screenshot shows the clear mapping between the Athena web interface and the Tableau Prep UI:
Let's move on to the next recipe!