View a markdown version of this page

AWS 組態設定檔登入資料 - Amazon Athena

本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。

AWS 組態設定檔登入資料

您可以透過設定下列連線參數來使用儲存在 AWS 組態設定檔中的登入資料。 AWS 組態設定檔通常存放在 ~/.aws目錄中的檔案中)。如需 AWS 組態設定檔的相關資訊,請參閱《適用於 Java 的 AWS SDK 開發人員指南》中的使用設定檔。

憑證提供者

將用來驗證對 AWS的請求的憑證提供者。將此參數的值設為 ProfileCredentials。

參數名稱 Alias (別名) 參數類型 預設值 將使用的值
CredentialsProvider AWSCredentialsProviderClass (已廢除) 必要 無 ProfileCredentials

Profile name (設定檔名稱)

AWS 組態設定檔的名稱,其登入資料應該用來驗證對 Athena 的請求。

參數名稱 Alias (別名) 參數類型 預設值
ProfileName 無 必要 無
注意

設定檔名稱也可以指定為 CredentialsProviderArguments 參數的值,雖然此用法已廢除。

使用 IAM Identity Center 設定檔進行驗證

搭配ProfileCredentials提供者使用 IAM Identity Center 設定檔來驗證請求 AWS。此方法使用 SSO 受管憑證,而非長期存取金鑰。下列範例顯示 ~/.aws/config 檔案中的必要項目。

[profile athena-idc] sso_session = athena-idc-session sso_account_id = 111122223333 sso_role_name = AthenaQueryRole region = us-east-1 [sso-session athena-idc-session] sso_start_url = https://example.awsapps.com/start sso_region = us-east-1 sso_registration_scopes = sso:account:access

開啟 JDBC 連線之前,請登入設定檔。例如,使用 aws sso login --profile athena-idc。然後使用下列參數設定 JDBC 連線。

CredentialsProvider=ProfileCredentials; ProfileName=athena-idc;