

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

# 配額
<a name="limits"></a>

為了讓所有使用者都能 AWS KMS 回應和執行， AWS KMS 套用兩種類型的配額、資源配額和請求配額。每一種配額都會針對每個 AWS 帳戶的每個區域獨立計算。

所有 AWS KMS 配額都是可調整的，[隨需輪換資源配額](resource-limits.md#on-demand-rotation-resource-quota)和[AWS CloudHSM 金鑰存放區請求配額](requests-per-second.md#rps-key-stores)除外。若要請求提高配額，請參閱[《Service Quotas 使用者指南》](https://docs.aws.amazon.com/servicequotas/latest/userguide/request-increase.html)中的*請求提高配額*。若要請求減少配額、變更 Service Quotas 中未列出的配額，或在 AWS KMS 無法使用 AWS 區域 Service Quotas 的 中變更配額，請造訪 [AWS 支援 中心](https://console.aws.amazon.com/support/home)並建立案例。

**Topics**
+ [資源配額](resource-limits.md)
+ [請求配額](requests-per-second.md)
+ [調節 AWS KMS 請求](throttling.md)

# 資源配額
<a name="resource-limits"></a>

AWS KMS 建立資源配額，以確保它可以為所有客戶提供快速且彈性的服務。有些資源配額僅適用於您建立的資源，但不適用於 AWS 服務為您建立的資源。您使用但並非位於您 AWS 帳戶中的資源 (例如 [AWS 擁有的金鑰](concepts.md#aws-owned-key)) 不會計入這些配額中。

如果您已超出資源限制，請求建立該類型的其他資源會產生 `LimitExceededException` 錯誤訊息。

所有 AWS KMS 資源配額都是可調整的，[隨需輪換資源配額](#on-demand-rotation-resource-quota)除外。若要請求提高配額，請參閱[《Service Quotas 使用者指南》](https://docs.aws.amazon.com/servicequotas/latest/userguide/request-increase.html)中的*請求提高配額*。若要請求減少配額、變更 Service Quotas 中未列出的配額，或在 AWS KMS 無法使用 AWS 區域 Service Quotas 的 中變更配額，請造訪 [AWS 支援 中心](https://console.aws.amazon.com/support/home)並建立案例。

下表列出並說明每個 AWS 帳戶 和 區域中 AWS KMS 的資源配額。


| 配額名稱 | 預設值 | 適用對象 | 可調整 | 
| --- | --- | --- | --- | 
| [AWS KMS keys](#kms-keys-limit) | 100,000 | 客戶自管金鑰 | 是 | 
| [每個 KMS 金鑰的別名](#aliases-per-key) | 50 | 客戶建立的別名 | 是 | 
| [每個 KMS 金鑰的授予](#grants-per-key) | 50,000 | 客戶自管金鑰 | 是 | 
| [自訂金鑰存放區資源配額](#cks-resource-quota) | 10 | AWS 帳戶 和 區域 | 是 | 
| [隨需輪換](#on-demand-rotation-resource-quota) | 25 | 客戶自管金鑰 | 否 | 

除了資源配額之外， AWS KMS 還會使用請求配額來確保服務的回應能力。如需詳細資訊，請參閱[請求配額](requests-per-second.md)。

## AWS KMS keys：100,000 個
<a name="kms-keys-limit"></a>

在您 AWS 帳戶的每個區域，您最多可有 100,000 個[客戶受管金鑰](concepts.md#customer-mgn-key)。此配額適用於所有 AWS 區域 中所有的客戶受管金鑰，與其[金鑰規格](create-keys.md#key-spec)或[金鑰狀態](key-state.md)無關。每個 KMS 金鑰都會被視為一個資源。[AWS 受管金鑰](concepts.md#aws-managed-key) 和 [AWS 擁有的金鑰](concepts.md#aws-owned-key) 不會計入此配額。

## 每個 KMS 金鑰的別名：50
<a name="aliases-per-key"></a>

您最多可以將 50 個[別名](kms-alias.md)與每個[客戶受管金鑰](concepts.md#customer-mgn-key)關聯。與 AWS 關聯的別名[AWS 受管金鑰](concepts.md#aws-managed-key)不會計入此配額。[建立](alias-create.md)或[更新](alias-update.md)別名時，您可能會遇到此配額。

**注意**  
僅當 KMS 金鑰符合此配額時，[kms:ResourceAliases](conditions-kms.md#conditions-kms-resource-aliases) 條件才會有效。如果 KMS 金鑰超過此配額，則會拒絕透過 `kms:ResourceAliases` 條件授權使用 KMS 金鑰的委託人存取 KMS 金鑰。如需詳細資訊，請參閱[因別名配額而拒絕存取](troubleshooting-tags-aliases.md#access-denied-alias-quota)。

每個 KMS 金鑰配額的別名會取代每個區域配額的別名，限制 an. AWS KMS has 每個區域配額的別名總數 AWS 帳戶。

## 每個 KMS 金鑰的授予：50,000
<a name="grants-per-key"></a>

每個[客戶受管金鑰](concepts.md#customer-mgn-key)最多可有 50,000 個[授予](grants.md)，包括[與 AWS KMS整合的AWS 服務](https://aws.amazon.com/kms/features/#AWS_Service_Integration)所建立的授予。此配額不適用於 [AWS 受管金鑰](concepts.md#aws-managed-key) 或 [AWS 擁有的金鑰](concepts.md#aws-owned-key)。

此配額的其中一個效果是，您無法同時執行超過 50,000 個使用相同 KMS 金鑰的授予授權操作。達到配額後，只有在作用中的授予已淘汰或撤銷時，您才能在 KMS 金鑰上建立新的授予。

例如，當您將 Amazon Elastic Block Store (Amazon EBS) 磁碟區連接到 Amazon Elastic Compute Cloud (Amazon EC2) 執行個體時，磁碟區便會解密，讓您可以讀取。為了取得解密資料的許可，Amazon EBS 會為每個磁碟區建立授予。因此，如果您所有的 Amazon EBS 磁碟區都使用相同的 KMS 金鑰，您無法一次連接超過 50,000 個磁碟區。

## 自訂金鑰存放區資源配額：10
<a name="cks-resource-quota"></a>

您可以在每個 AWS 帳戶 和區域中建立最多 10 個[自訂金鑰存放](key-store-overview.md#custom-key-store-overview)區。如果您嘗試建立更多，則 [CreateCustomKeyStore](https://docs.aws.amazon.com/kms/latest/APIReference/API_CreateCustomKeyStore.html) 操作會失敗。

此配額適用於每個帳戶和區域中自訂金鑰存放區的總數，包括 [AWS CloudHSM 金鑰存放區](keystore-cloudhsm.md)和[外部金鑰存放區](keystore-external.md)，無論其連接狀態為何。

## 隨需輪換：25
<a name="on-demand-rotation-resource-quota"></a>

您可以執行[隨需金鑰輪換](rotating-keys-on-demand.md)，每個 KMS 金鑰最多 25 次。如果您嘗試執行更多隨需輪換，則 [RotateKeyOnDemand](https://docs.aws.amazon.com/kms/latest/APIReference/API_RotateKeyOnDemand.html) 操作會失敗。

此配額不可調整。您無法透過使用 Service Quotas 或在其中建立案例來增加配額 AWS 支援。為了防止達到隨需輪換配額，我們建議您盡可能使用[自動金鑰輪換](rotating-keys-enable.md)。

# 請求配額
<a name="requests-per-second"></a>

AWS KMS 會為每秒請求的 API 操作數量建立配額。請求配額會因 API 操作、 AWS 區域和其他因素而有所不同，例如 KMS 金鑰類型。當您超過 API 請求配額時， AWS KMS [會調節請求](throttling.md)。

所有 AWS KMS 請求配額都是可調整的，但[AWS CloudHSM 金鑰存放區請求配額](#rps-key-stores)除外。若要請求提高配額，請參閱[《Service Quotas 使用者指南》](https://docs.aws.amazon.com/servicequotas/latest/userguide/request-increase.html)中的*請求提高配額*。若要請求減少配額、變更 Service Quotas 中未列出的配額，或在 AWS KMS 無法使用 AWS 區域 Service Quotas 的 中變更配額，請造訪 [AWS 支援 中心](https://console.aws.amazon.com/support/home)並建立案例。

如果正在超出 [GenerateDataKey](https://docs.aws.amazon.com/kms/latest/APIReference/API_GenerateDataKey.html) 操作的請求配額，請考慮使用 AWS Encryption SDK的[資料金鑰快取](https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/data-key-caching.html)功能。重複使用資料金鑰可能會降低請求的頻率 AWS KMS。

除了請求配額之外， AWS KMS 還會使用資源配額來確保所有使用者的容量。如需詳細資訊，請參閱[資源配額](resource-limits.md)。

若要檢視請求率的趨勢，請使用 [Service Quotas 主控台](https://console.aws.amazon.com/servicequotas)。您也可以建立 [Amazon CloudWatch](https://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/) 警示，在您的請求率達到配額值的特定百分比時發出提醒。如需詳細資訊，請參閱 *AWS 安全部落格*中的[使用 Service Quotas 和 Amazon CloudWatch 管理您的 AWS KMS API 請求率](https://aws.amazon.com/blogs/security/manage-your-aws-kms-api-request-rates-using-service-quotas-and-amazon-cloudwatch/)。

**Topics**
+ [請求每個 AWS KMS API 操作的配額](#rps-table)
+ [套用請求配額](#about-rate-limits)
+ [密碼編譯操作的共用配額](#rps-shared-limit)
+ [代表您進行的 API 請求](#rps-from-service)
+ [跨帳戶請求](#rps-cross-account)
+ [自訂金鑰存放區請求配額](#rps-key-stores)

## 請求每個 AWS KMS API 操作的配額
<a name="rps-table"></a>

此資料表列出 [Service Quotas](https://docs.aws.amazon.com/servicequotas/latest/userguide/) 配額代碼，以及每個 AWS KMS 請求配額的預設值。所有 AWS KMS 請求配額都是可調整的，但[AWS CloudHSM 金鑰存放區請求配額](#rps-key-stores)除外。

**注意**  
您可能需要水平或垂直捲動，才能查看此資料表中的所有資料。


| 配額名稱 | 預設值 (每秒請求數) | 
| --- | --- | 
|  `Cryptographic operations (symmetric) request rate` 適用對象： [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/kms/latest/developerguide/requests-per-second.html)  |  這些共用配額會隨 AWS 區域 和請求中使用的 KMS 金鑰類型而有所不同。每個配額會分別計算。 [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/kms/latest/developerguide/requests-per-second.html)  | 
| `Cryptographic operations (RSA) request rate` 適用對象：[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/kms/latest/developerguide/requests-per-second.html) |  RSA KMS 金鑰 1，000 （共用）  | 
| `Cryptographic operations (ML-DSA) request rate` 適用對象： [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/kms/latest/developerguide/requests-per-second.html) | ML-DSA KMS 金鑰 1，000 （共用） | 
| `Cryptographic operations (ECC and SM2) request rate` 適用對象：[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/kms/latest/developerguide/requests-per-second.html) |  1，000 （共用） 代表橢圓曲線 (ECC) 和 SM2 （僅限中國區域） KMS 金鑰  | 
|  `Custom key store request quotas` 適用對象： [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/kms/latest/developerguide/requests-per-second.html)  | 會針對每個自訂金鑰存放區分別計算[自訂金鑰存放區請求配額](#rps-key-stores)[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/kms/latest/developerguide/requests-per-second.html) | 
| `CancelKeyDeletion request rate` | 5 | 
| `ConnectCustomKeyStore request rate` | 5 | 
| `CreateAlias request rate` | 5 | 
| `CreateCustomKeyStore request rate` | 5 | 
| `CreateGrant request rate` | 50 | 
| `CreateKey request rate` | 5 | 
| `DeleteAlias request rate` | 15 | 
| `DeleteCustomKeyStore request rate` | 5 | 
| `DeleteImportedKeyMaterial request rate` | 15 | 
| `DescribeCustomKeyStores request rate` | 5 | 
| `DescribeKey request rate` | 2000 | 
| `DisableKey request rate` | 5 | 
| `DisableKeyRotation request rate` | 5 | 
| `DisconnectCustomKeyStore request rate` | 5 | 
| `EnableKey request rate` | 5 | 
| `EnableKeyRotation request rate` | 15 | 
|  `GenerateDataKeyPair (ECC_NIST_P256) request rate` 適用對象： [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/kms/latest/developerguide/requests-per-second.html)  |  100  | 
|  `GenerateDataKeyPair (ECC_NIST_P384) request rate` 適用對象： [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/kms/latest/developerguide/requests-per-second.html)  |  100  | 
|  `GenerateDataKeyPair (ECC_NIST_P521) request rate` 適用對象： [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/kms/latest/developerguide/requests-per-second.html)  |  100  | 
|  `GenerateDataKeyPair (ECC_SECG_P256K1) request rate` 適用對象： [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/kms/latest/developerguide/requests-per-second.html)  |  100  | 
|  `GenerateDataKeyPair (ECC_NIST_EDWARDS25519) request rate` 適用對象： [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/kms/latest/developerguide/requests-per-second.html)  |  100  | 
|  `GenerateDataKeyPair (RSA_2048) request rate` 適用對象： [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/kms/latest/developerguide/requests-per-second.html)  |  20  | 
|  `GenerateDataKeyPair (RSA_3072) request rate` 適用對象： [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/kms/latest/developerguide/requests-per-second.html)  |  4  | 
|  `GenerateDataKeyPair (RSA_4096) request rate` 適用對象： [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/kms/latest/developerguide/requests-per-second.html)  |  1  | 
|  `GenerateDataKeyPair (SM2 — China Regions only) request rate` 適用對象： [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/kms/latest/developerguide/requests-per-second.html)  |  25  | 
| `GetKeyPolicy request rate` | 1000 | 
| `GetKeyRotationStatus request rate` | 1000 | 
| `GetParametersForImport request rate` | 1 | 
| `GetPublicKey request rate` | 2000 | 
| `ImportKeyMaterial request rate` | 15 | 
| `ListAliases request rate` | 500 | 
| `ListGrants request rate` | 100 | 
| `ListKeyPolicies request rate` | 100 | 
| `ListKeys request rate` | 500 | 
| `ListKeyRotations request rate` | 100 | 
| `ListResourceTags request rate` | 2000 | 
| `ListRetirableGrants request rate` | 100 | 
| `PutKeyPolicy request rate` | 15 | 
| ReplicateKey request rate `ReplicateKey` 操作在主要金鑰的區域中計為一個 `ReplicateKey` 請求，在複本區域中計為兩個 `CreateKey` 請求。其中一個 `CreateKey` 請求是試執行，以在建立金鑰之前偵測潛在的問題。 | 5 | 
| `RetireGrant request rate` | 50 | 
| `RevokeGrant request rate` | 50 | 
| `RotateKeyOnDemand request rate` | 5 | 
| `ScheduleKeyDeletion request rate` | 15 | 
| `TagResource request rate` | 10 | 
| `UntagResource request rate` | 5 | 
| `UpdateAlias request rate` | 5 | 
| `UpdateCustomKeyStore request rate` | 5 | 
| `UpdateKeyDescription request rate` | 5 | 
| `UpdatePrimaryRegion request rate` `UpdatePrimaryRegion` 操作會計為兩個 `UpdatePrimaryRegion` 請求；每兩個受影響的區域中一個請求。  | 5 | 

## 套用請求配額
<a name="about-rate-limits"></a>

檢閱請求配額時，請注意以下資訊。
+ 請求配額同時適用於[客戶受管金鑰](concepts.md#customer-mgn-key)和 [AWS 受管金鑰](concepts.md#aws-managed-key)。使用 [AWS 擁有的金鑰](concepts.md#aws-owned-key) 不會計入您 的請求配額 AWS 帳戶，即使它們用於保護您帳戶中的資源。
+ 請求配額適用於傳送至 FIPS 端點和非 FIPS 端點的請求。如需 AWS KMS 服務端點的清單，請參閱 中的[AWS Key Management Service 端點和配額](https://docs.aws.amazon.com/general/latest/gr/kms.html) AWS 一般參考。
+ 調節是以區域中所有類型 KMS 金鑰的所有請求為基礎。此總計包含來自 中所有主體的請求 AWS 帳戶，包括代表您來自 AWS 服務的請求。
+ 每個請求配額都是獨立計算的。例如，[CreateKey](https://docs.aws.amazon.com/kms/latest/APIReference/API_CreateKey.html) 操作的請求不會對 [CreateAlias](https://docs.aws.amazon.com/kms/latest/APIReference/API_CreateAlias.html) 操作的請求配額產生任何影響。如果您的 `CreateAlias` 請求遭到調節，您的 `CreateKey` 請求仍然可以成功完成。
+ 雖然密碼編譯操作會共用配額，但是共用的配額會獨立於其他操作配額之外進行計算。例如，對 [Encrypt](https://docs.aws.amazon.com/kms/latest/APIReference/API_Encrypt.html) 和 [Decrypt](https://docs.aws.amazon.com/kms/latest/APIReference/API_Decrypt.html) 操作的呼叫會共用請求配額，但是該配額是獨立於管理操作 (例如 [EnableKey](https://docs.aws.amazon.com/kms/latest/APIReference/API_EnableKey.html)) 的配額之外。例如，在歐洲 (倫敦) 區域，您可以在對稱 KMS 金鑰上執行 10,000 次密碼編譯操作，*加上*每秒 5 次 `EnableKey` 操作，而仍不會遭到調節。

## 密碼編譯操作的共用配額
<a name="rps-shared-limit"></a>

AWS KMS [密碼編譯操作](kms-cryptography.md#cryptographic-operations)共用請求配額。您可以請求 KMS 金鑰所支援密碼編譯操作的任何組合，只要密碼編譯操作的總數不會超過該 KMS 金鑰類型的請求配額即可。例外狀況是 [GenerateDataKeyPair](https://docs.aws.amazon.com/kms/latest/APIReference/API_GenerateDataKeyPair.html) 和 [GenerateDataKeyPairWithoutPlaintext](https://docs.aws.amazon.com/kms/latest/APIReference/API_GenerateDataKeyPairWithoutPlaintext.html)，它們共用個別的配額。

不同 KMS 金鑰類型的配額也會獨立計算。每個配額適用於 AWS 帳戶 和 區域中這些操作的所有請求，每個 1 秒間隔具有指定的金鑰類型。
+ *密碼編譯操作 (對稱) 請求率*是帳戶和區域中使用對稱 KMS 金鑰進行加密編譯操作的共用請求配額。此配額適用於具有對稱加密金鑰和 HMAC 金鑰 (兩者皆為對稱金鑰) 的密碼編譯操作。

  例如，您可能在 中使用[對稱 KMS 金鑰](symm-asymm-choose-key-spec.md#symmetric-cmks)， AWS 區域 共用配額為每秒 10，000 個請求。當您每秒發出 7，000 個 [GenerateDataKey](https://docs.aws.amazon.com/kms/latest/APIReference/API_GenerateDataKey.html) 請求和每秒發出 2，000 [個解密](https://docs.aws.amazon.com/kms/latest/APIReference/API_Decrypt.html)請求時， AWS KMS 不會調節您的請求。但是，當您每秒發出 9,500 次 `GenerateDataKey` 請求及 1,000 次 [Encrypt](https://docs.aws.amazon.com/kms/latest/APIReference/API_Encrypt.html) 請求時， AWS KMS 便會進行調節，因為其超過了共用配額。

  [自訂金鑰存放區](key-store-overview.md#custom-key-store-overview)中[對稱加密 KMS 金鑰](symm-asymm-choose-key-spec.md#symmetric-cmks)的密碼編譯操作會計入帳戶的*密碼編譯操作 (對稱) 請求率*以及自訂金鑰存放區的[自訂金鑰存放區請求配額](#rps-key-stores)。
+ *密碼編譯操作 (RSA) 請求率*是使用 [RSA 非對稱 KMS 金鑰](symm-asymm-choose-key-spec.md#key-spec-rsa)進行加密編譯操作的共用請求配額。

  例如，請求配額為每秒 1，000 個操作，您可以使用可加密和[解密](https://docs.aws.amazon.com/kms/latest/APIReference/API_Decrypt.html)的 RSA KMS 金鑰發出 400 [個加密](https://docs.aws.amazon.com/kms/latest/APIReference/API_Encrypt.html)請求和 200 個解密請求，加上 250 個 [Sign](https://docs.aws.amazon.com/kms/latest/APIReference/API_Sign.html) 請求和 150 個使用可簽署和驗證的 RSA KMS 金鑰[驗證](https://docs.aws.amazon.com/kms/latest/APIReference/API_Verify.html)請求。
+ *密碼編譯操作 (ECC) 請求率*是使用[橢圓曲線 (ECC) 非對稱 KMS 金鑰](symm-asymm-choose-key-spec.md#key-spec-ecc)和 [SM 非對稱 KMS 金鑰](symm-asymm-choose-key-spec.md#key-spec-sm)進行密碼編譯操作的共用請求配額。

  例如，如果請求配額為每秒 1，000 個操作，您可以使用可簽署和驗證的 ECC KMS 金鑰發出 400 個 Sign 請求和 200 個 Verify 請求，以及使用可簽署和驗證的 SM2 KMS 金鑰發出 250 個 [Sign](https://docs.aws.amazon.com/kms/latest/APIReference/API_Sign.html) 請求和 150 個 [Verify](https://docs.aws.amazon.com/kms/latest/APIReference/API_Verify.html) 請求。
+ *自訂金鑰存放區請求配額*是自訂金鑰存放區中 KMS 金鑰之密碼編譯操作的共用請求配額。此配額會針對每個自訂金鑰存放區分別計算。

  [自訂金鑰存放區](key-store-overview.md#custom-key-store-overview)中[對稱加密 KMS 金鑰](symm-asymm-choose-key-spec.md#symmetric-cmks)的密碼編譯操作會計入帳戶的*密碼編譯操作 (對稱) 請求率*以及自訂金鑰存放區的[自訂金鑰存放區請求配額](#rps-key-stores)。

不同金鑰類型的配額也會獨立計算。例如，在亞太區域 (新加坡) 區域中，如果使用對稱和非對稱 KMS 金鑰，您最多可以使用對稱 KMS 金鑰 (包括 HMAC 金鑰) 每秒進行 10,000 次呼叫，*加上*使用 RSA 非對稱 KMS 金鑰每秒進行最多 500 次額外的呼叫，再*加上*使用 ECC 型 KMS 金鑰每秒進行最多 300 次額外的請求。

## 代表您進行的 API 請求
<a name="rps-from-service"></a>

您可以直接提出 API 請求，或使用整合式 AWS 服務 AWS KMS 代表您向 提出 API 請求。此配額同時適用於這兩種請求。

例如，您可能將資料存放在使用伺服器端加密搭配 KMS 金鑰 (SSE-KMS) 的 Amazon S3 上。每次上傳或下載使用 SSE-KMS 加密的 S3 物件時，Amazon S3 都會 AWS KMS 代表您向 發出 `GenerateDataKey`（上傳） 或 `Decrypt`（下載） 請求。這些請求會計入您的配額，因此如果您超過每秒 5，500 個 （或 10，000 或 50，000 個，視您的 而定 AWS 區域) 上傳或下載使用 SSE-KMS 加密的 S3 物件，則 會 AWS KMS 調節請求。

## 跨帳戶請求
<a name="rps-cross-account"></a>

當一個 中的應用程式 AWS 帳戶 使用不同帳戶擁有的 KMS 金鑰時，稱為*跨帳戶請求*。對於跨帳戶請求， AWS KMS 會調節發出請求的帳戶，而不是擁有 KMS 金鑰的帳戶。例如，如果帳戶 A 中的應用程式使用帳戶 B 中的 KMS 金鑰，使用該 KMS 金鑰就會套用帳戶 A 中的配額。

## 自訂金鑰存放區請求配額
<a name="rps-key-stores"></a>

AWS KMS 在[自訂金鑰存放](key-store-overview.md#custom-key-store-overview)區中的 KMS 金鑰上維護[密碼編譯操作](kms-cryptography.md#cryptographic-operations)的請求配額。會針對每個自訂金鑰存放區分別計算這些請求配額。


| 自訂金鑰存放區請求配額 | 每個自訂金鑰存放區的預設值 (每秒請求數) | 可調整 | 
| --- | --- | --- | 
| [AWS CloudHSM 金鑰存放區](keystore-cloudhsm.md)請求配額 | 1800 | 否 | 
| [外部金鑰存放區](keystore-external.md)請求配額 | 1800 | 否 | 

**注意**  
AWS KMS [自訂金鑰存放區請求配額](#rps-key-stores)不會出現在 Service Quotas 主控台中。您無法使用 Service Quotas API 操作來檢視或管理這些配額。  
如果與 AWS CloudHSM 金鑰存放區相關聯的 AWS CloudHSM 叢集正在處理許多命令，包括與自訂金鑰存放區無關的命令，您可能會`ThrottlingException`以lower-than-expected速率取得 AWS KMS 。如果發生這種情況，請將請求率降低為 AWS KMS、減少不相關的負載，或為您的 AWS CloudHSM 金鑰存放區使用專用 AWS CloudHSM 叢集。  
AWS KMS 會報告 [`ExternalKeyStoreThrottle`](monitoring-cloudwatch.md#metric-throttling) CloudWatch 指標中外部金鑰存放區請求的限流。您可以使用此指標來檢視限流模式、建立警示以及調整外部金鑰存放區請求配額。

自訂金鑰存放區 KMS 金鑰的[密碼編譯操作](kms-cryptography.md#cryptographic-operations)請求會計入兩個配額：
+ 密碼編譯操作 (對稱) 請求率配額 (每個帳戶)

  自訂金鑰存放區中 KMS 金鑰的密碼編譯操作請求會計入每個 AWS 帳戶 和區域的 `Cryptographic operations (symmetric) request rate` 配額。例如，在美國東部 （維吉尼亞北部） (us-east-1)，每個 對對稱加密 KMS 金鑰每秒 AWS 帳戶 最多可以有 100，000 個請求，包括在自訂金鑰存放區中使用 KMS 金鑰的請求。
+ 自訂金鑰存放區請求配額 (每個自訂金鑰存放區)

  自訂金鑰存放區中 KMS 金鑰的密碼編譯操作請求也會計入每秒 1,800 次 `Custom key store request quota` 操作中。會針對每個自訂金鑰存放區分別計算這些配額。它們可能包括來自多個 AWS 帳戶 在自訂金鑰存放區中使用 KMS 金鑰的請求。

例如，美國東部 （維吉尼亞北部） (us-east-1) 區域中自訂金鑰存放區 （任一類型） 中 KMS 金鑰的[加密](https://docs.aws.amazon.com/kms/latest/APIReference/API_Encrypt.html)操作會計入其`Cryptographic operations (symmetric) request rate`帳戶和區域的帳戶層級配額 （每秒 100，000 個請求），以及自訂金鑰存放區的 `Custom key store request quota`（每秒 1，800 個請求）。不過，針對自訂金鑰存放區中 KMS 金鑰的管理操作 (例如 [PutKeyPolicy](https://docs.aws.amazon.com/kms/latest/APIReference/API_PutKeyPolicy.html)) 的請求只會套用至其帳戶層級配額 (每秒 15 個請求)。

# 調節 AWS KMS 請求
<a name="throttling"></a>

為了確保 AWS KMS 可以為所有客戶的 API 請求提供快速且可靠的回應，它會調節超過特定界限的 API 請求。

當 AWS KMS 拒絕原本可能有效的請求，並傳回如下的`ThrottlingException`錯誤時，就會發生*限流*。

```
You have exceeded the rate at which you may call KMS. Reduce the frequency of your calls. 
(Service: AWSKMS; Status Code: 400; Error Code: ThrottlingException; Request ID: <ID>
```

AWS KMS 針對下列條件調節請求。
+ 每秒請求的速率超過帳戶和區域的 AWS KMS [請求配額](requests-per-second.md)。

  例如，如果您帳戶中的使用者在一秒內提交 1000 個`DescribeKey`請求， 會 AWS KMS 調節該秒中的所有後續`DescribeKey`請求。

  如要回應調節，請使用[退避與重試策略](https://docs.aws.amazon.com/general/latest/gr/api-retries.html)。此策略會自動針對 AWS SDKs中的 HTTP 400 錯誤實作。
+ 變更相同 KMS 金鑰狀態之高載或持續高水準的請求率。這種情況通常稱為「快速鍵」。

  例如，如果您帳戶中的應用程式傳送相同 KMS 金鑰的持久性 `EnableKey`和 `DisableKey`請求， 會 AWS KMS 調節請求。即使對於 `EnableKey` 和 `DisableKey` 操作，請求未超過請求每秒次數的請求限制，也會發生此調節。

  若要回應調節，請調整您的應用程式邏輯，讓其只提出必要的請求，或合併多個函數的請求。
+ 當與金鑰[AWS CloudHSM 存放](requests-per-second.md#rps-key-stores)區相關聯的叢集正在處理許多命令，包括與 AWS CloudHSM 金鑰存放區無關的命令時 AWS CloudHSM ，金鑰存放區中 KMS AWS CloudHSM 金鑰的操作請求可能會lower-than-expected速率調節。

  （當 AWS CloudHSM 叢集沒有可用的 PKCS \$111 工作階段時，AWS KMS 不會再調節對金鑰存放區中 KMS AWS CloudHSM 金鑰的操作請求。 相反地，它會擲回 `KMSInternalException`，並建議您重試請求。)

若要檢視請求率的趨勢，請使用 [Service Quotas 主控台](https://console.aws.amazon.com/servicequotas)。您也可以建立 [Amazon CloudWatch](https://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/) 警示，在您的請求率達到配額值的特定百分比時發出提醒。如需詳細資訊，請參閱 *AWS 安全部落格*中的[使用 Service Quotas 和 Amazon CloudWatch 管理您的 AWS KMS API 請求率](https://aws.amazon.com/blogs/security/manage-your-aws-kms-api-request-rates-using-service-quotas-and-amazon-cloudwatch/)。

所有 AWS KMS 配額都是可調整的，[隨需輪換資源配額](resource-limits.md#on-demand-rotation-resource-quota)和[AWS CloudHSM 金鑰存放區請求配額](requests-per-second.md#rps-key-stores)除外。若要請求提高配額，請參閱[《Service Quotas 使用者指南》](https://docs.aws.amazon.com/servicequotas/latest/userguide/request-increase.html)中的*請求提高配額*。若要請求減少配額、變更 Service Quotas 中未列出的配額，或在 AWS KMS 無法使用 AWS 區域 Service Quotas 的 中變更配額，請造訪 [AWS 支援 中心](https://console.aws.amazon.com/support/home)並建立案例。

**注意**  
AWS KMS [自訂金鑰存放區請求配額](requests-per-second.md#rps-key-stores)不會出現在 Service Quotas 主控台中。您無法使用 Service Quotas API 操作來檢視或管理這些配額。