

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

# AWS 組態設定檔登入資料
<a name="jdbc-v3-driver-aws-configuration-profile-credentials"></a>

您可以透過設定下列連線參數來使用儲存在 AWS 組態設定檔中的登入資料。 AWS 組態設定檔通常存放在 `~/.aws`目錄中的檔案中）。如需 AWS 組態設定檔的相關資訊，請參閱**《適用於 Java 的 AWS SDK 開發人員指南》中的[使用設定檔](https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/credentials-profiles.html)。

## 憑證提供者
<a name="jdbc-v3-driver-aws-configuration-profile-credentials-provider"></a>

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



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

## Profile name (設定檔名稱)
<a name="jdbc-v3-driver-profile-name"></a>

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



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

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

## 使用 IAM Identity Center 設定檔進行驗證
<a name="jdbc-v3-driver-identity-center-profile-example"></a>

搭配`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;
```