Accessing Amazon Athena over JDBC with an IAM role


I have an analytics application running on EC2. The application uses the Athena JDBC connector to connect to Athena and run queries. Can I use an IAM role attached to the EC2 instance to authorize the Athena connection, rather than embedding credentials in the JDBC connection string?

asked 2 years ago489 views
1 Answer
Accepted Answer

It is indeed a best practice to use an IAM role rather than embedding credentials in the JDBC connection string. Attach the AWSQuicksightAthenaAccess Managed Policy to the IAM role used in the EC2 instance profile. Then specify the DefaultAWSCredentialsProviderChain in the JDBC connection string. The JDBC connection string would look like this:


Read more here on Using Athena with the JDBC Driver.

answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions