

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

# 第 3 適用於 PHP 的 AWS SDK 版中的內建登入資料提供者
<a name="built-in-providers-in-the-sdk"></a>

開發套件提供數個內建登入資料提供者，您可以個別使用或合併在[自訂登入資料提供者鏈](chaining-providers.md)中。

當您在服務用戶端建立期間指定登入資料提供者時，開發套件會嘗試僅使用指定的登入資料提供者載入登入資料。它不使用[預設登入資料提供者鏈結](guide_credentials_default_chain.md)。如果您知道希望服務用戶端使用`instanceProfile`提供者，您可以透過在服務用戶端建構函數中指定`instanceProfile`提供者來使預設鏈結發生短路：

```
use Aws\Credentials\CredentialProvider;
use Aws\S3\S3Client;

$provider = CredentialProvider::instanceProfile();
// Be sure to memoize the credentials
$memoizedProvider = CredentialProvider::memoize($provider);

$client = new S3Client([
    'region'      => 'us-west-2',
    'credentials' => $memoizedProvider  // The default credential provider chain is not used.
]);
```

**重要**  
每次執行 API 操作時，都會叫用登入資料供應商。如果載入登入資料是昂貴的任務 (例如，從磁碟或網路資源載入)，或如果登入資料並未由您的供應商快取，請考慮將登入資料供應商封裝在 `Aws\Credentials\CredentialProvider::memoize` 函數中。開發套件使用的預設登入資料供應商會自動記憶。

**Topics**
+ [`login` 適用於 PHP 的 SDK 中的 提供者](login-provider.md)
+ [`assumeRole` 適用於 PHP 的 SDK 中的 提供者](assumerole-provider.md)
+ [`sso` 適用於 PHP 的 SDK 中的 提供者](sso-provider.md)
+ [`defaultProvider` 適用於 PHP 的 SDK 中的 提供者](defaultprovider-provider.md)
+ [`ecsCredentials` 適用於 PHP 的 SDK 中的 提供者](ecscredentials-provider.md)
+ [`env` 適用於 PHP 的 SDK 中的 提供者](env-provider.md)
+ [`assumeRoleWithWebIdentityCredentialProvider` 適用於 PHP 的 SDK 中的 提供者](assume-role-with-web-identity-provider.md)
+ [`ini` 適用於 PHP 的 SDK 中的 提供者](ini-provider.md)
+ [`process` 適用於 PHP 的 SDK 中的 提供者](process-provider.md)
+ [`instanceProfile` 適用於 PHP 的 SDK 中的 提供者](instanceprofile-provider.md)