Accessing Amazon Athena over JDBC with an IAM role

0

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?

AWS
demandé il y a 4 ans1972 vues
1 réponse
0
Réponse acceptée

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:

jdbc:awsathena://AwsRegion=<aws-region>;S3OutputLocation=s3://<s3_bucket>/;AwsCredentialsProviderClass=com.simba.athena.amazonaws.auth.DefaultAWSCredentialsProviderChain

Read more here on Using Athena with the JDBC Driver.

AWS
Kunal_G
répondu il y a 4 ans

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions