TL;DR;
When using Secret Keys, do not specify "User / password", but instead always click on "default credentials" in Power Bi, to force it to use the Local AWS Configuration (e.g. C:/...$USER_HOME/.aws/credentials)
Summarized Guide for newbies:
Prerequisites:
AWSCli installed locally, on your laptop. If you don’t have this, just download the MSI installer from here:
https://docs.aws.amazon.com/cli/latest/userguide/install-windows.html
Note: this quick guide is just to configure the connection using AWS Access Keys, and not federating the credentials through any other Security layer.
- Configure locally your AWS credentials.
- From the Windows command prompt (cmd), execute: aws configure
- Enter your AWS Access Key ID, Secret Access Key and default region; for example "eu-west-1" for Ireland.
- You can get these Keys from the AWS console, IAM service, Users, select your user, Security, Create/Download Access Keys.
- You should never share these keys, and it’s highly recommended to rotate these, for example, every month.
Download Athena ODBC Driver:
- https://docs.aws.amazon.com/athena/latest/ug/connect-with-odbc.html
Important: If you have Power Bi 64 bits, download the same (32 or 64) for the ODBC.
- Install it on your laptop, where you have Power Bi.
- Open Windows ODBCs, add a User DSN and select Simba-Athena as the Driver.
- Use always "Default credentials" and not user/password, since it will use our local keys from Step 1.
- Configure an S3 bucket, for the temporary results. You can use something like: s3://aws-athena-query-results-eu-west-1-power-bi
On the Power Bi app, click on Get Data and Type ODBC.
- Choose Credentials "default", to use the local AWS keys (from step 1) and, optionally, enter a "select" query.
- Click on Load the data.
- Important concern: I’m afraid Power Bi will load all the results from the query into our local memory. So if, for example. we're bringing 3 months of data and that is equivalent to 3 GB, then we will consume this in our local laptop.
Another important concern:
- For security reasons, you'll need to implement a KMS Encryption keys. Otherwise, the data is being transmitted in clear text, instead of being encrypted.
Relevant reference (as listed above), where you can find the steps for this entire configuration process, but more in detail:
- https://s3.amazonaws.com/athena-downloads/drivers/ODBC/Simba+Athena+ODBC+Install+and+Configuration+Guide.pdf
Carlos.