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
질문됨 4년 전1972회 조회
1개 답변
0
수락된 답변

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
답변함 4년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠