

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

# Amazon Verified Permissions 的配額
<a name="quotas"></a>

您的 AWS 帳戶 具有每個 AWS 服務的預設配額，先前稱為限制。除非另有說明，否則每個配額都是區域特定的。您可以請求提高某些配額，而其他配額無法提高。

若要檢視已驗證許可的配額，請開啟 [Service Quotas 主控台](https://console.aws.amazon.com/servicequotas/home)。在導覽窗格中，選擇 **AWS 服務**，然後選取**已驗證的許可**。

若要請求增加配額，請參閱 *Service Quotas 使用者指南*中的[請求提高配額](https://docs.aws.amazon.com/servicequotas/latest/userguide/request-quota-increase.html)。如果 Service Quotas 中尚未提供配額，請使用[增加服務配額表單](https://console.aws.amazon.com/support/home#/case/create?issueType=service-limit-increase)。

您的 AWS 帳戶 具有下列與 Verified Permissions 相關的配額。

**Topics**
+ [資源的配額](#quotas-resources)
+ [階層的配額](#quotas-hierarchies)
+ [每秒操作的配額](#quotas-tps)

## 資源的配額
<a name="quotas-resources"></a>

[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/verifiedpermissions/latest/userguide/quotas.html)

1 [IsAuthorized](https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_IsAuthorized.html) 和 [IsAuthorizedWithToken](https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_IsAuthorizedWithToken.html) 的授權請求配額相同。



2 單一資源範圍的所有政策總大小的預設限制為 200，000 位元組。同樣地，所有政策的總大小，其中範圍未定義資源，因此套用至所有資源，預設限制為 200，000 個位元組。請注意，對於範本連結政策，政策範本的大小只會計算一次，加上用於執行個體化每個範本連結政策的每組參數大小。如果您的政策設計符合特定限制，則可以提高此限制。如果您需要探索此選項，[請聯絡 支援](https://aws.amazon.com/contact-us/)。

### 範本連結政策大小範例
<a name="quotas-resources-example"></a>

您可以透過取得委託人和資源的長度總和，來判斷範本連結政策對*每個資源配額的政策大小*有何貢獻。如果未指定委託人或資源，則該片段的長度為 0。如果未指定資源，其大小會計入`"unspecified"`資源配額。範本內文的大小不會影響政策大小。

讓我們來看看下列範本：

```
@id("template1")
permit (
  principal in ?principal,
  action in [Action::"view", Action::"comment"], 
  resource in ?resource
)
unless {
  resource.tag =="private"
};
```

讓我們從該範本建立下列政策：

```
TemplateLinkedPolicy {
  policyId: "policy1",
  templateId: "template1",
  principal: User::"alice",
  resource: Photo::"car.jpg"
}

TemplateLinkedPolicy {
  policyId: "policy2",
  templateId: "template1",
  principal: User::"bob",
  resource: Photo::"boat.jpg"
}

TemplateLinkedPolicy {
  policyId: "policy3",
  templateId: "template1",
  principal: User::"jane",
  resource: Photo::"car.jpg"
  
TemplateLinkedPolicy {
  policyId: "policy4",
  templateId: "template1",
  principal: User::"jane",
  resource
}
```

現在，讓我們計算這些政策的大小，方法是計算 和每個政策`principal``resource`的字元。每個字元計為 1 個位元組。

的大小`policy1`為委託人 `User::"alice"`(13) 的長度加上資源 `Photo::"car.jpg"`(16) 的長度。將它們加起來，我們有 13 \$1 16 = 29 個位元組。

的大小`policy2`為委託人 `User::"bob"`(11) 的長度加上資源 `Photo::"boat.jpg"`(17) 的長度。將它們加起來，我們有 11 \$1 17 = 28 個位元組。

的大小`policy3`為委託人 `User::"jane"`(12) 的長度加上資源 `Photo::"car.jpg"`(16) 的長度。將它們加起來，我們有 12 \$1 16 = 28 個位元組。

的大小`policy4`為委託人 `User::"jane"`(12) 的長度加上資源 (0) 的長度。將它們加起來，我們有 12 \$1 0 = 12 個位元組。

由於 `policy2`是唯一參考資源 的政策`Photo::"boat.jpg"`，因此總資源大小為 28 個位元組。

由於 `policy1`和 `policy3`都參考資源 `Photo::"car.jpg"`，因此總資源大小為 29 \$1 28 = 57 位元組。

由於 `policy4`是唯一參考`"unspecified"`資源的政策，因此總資源大小為 12 個位元組。

## 階層的配額
<a name="quotas-hierarchies"></a>

**注意**  
下列配額會彙總，這表示它們會一起新增。群組的可轉移父項數量上限是列出的。例如，如果*每個主體的可轉移父*項限制為 100，表示在*動作**和資源*中，可能會有 100 *個主體*的父項和 0 個父項，或總計最多 100 個****父項的任何父項組合。


| 名稱 | 預設 | 可調整 | Description | 
| --- | --- | --- | --- | 
| 每個主體的暫時性父系 | 100 | 否 | 每個主體的可轉移父項數量上限。 | 
| 每個動作的暫時性父項 | 100 | 否 | 每個動作的可轉移父項數量上限。 | 
| 每個資源的暫時性父項 | 100 | 否 | 每個資源的可轉移父項數量上限。 | 

下圖說明如何為實體 （委託人、動作或資源） 定義可轉移的父系。

![\[每個實體的暫時性父項\]](http://docs.aws.amazon.com/zh_tw/verifiedpermissions/latest/userguide/images/quotas-transitive-parents.png)


## 每秒操作的配額
<a name="quotas-tps"></a>

當應用程式請求超過 API 操作的配額 AWS 區域 時，Verified Permissions 會調節對 中服務端點的請求。當您超過每秒請求的配額，或嘗試同時寫入操作時，Verified Permissions 可能會傳回例外狀況。您可以在 [Service Quotas](https://console.aws.amazon.com/servicequotas/home/services/verifiedpermissions/quotas) 中檢視目前的 RPS 配額。為了防止應用程式超過 操作的配額，您必須針對重試和指數退避進行最佳化。如需詳細資訊，請參閱[使用退避模式重試](https://docs.aws.amazon.com/prescriptive-guidance/latest/cloud-design-patterns/retry-backoff.html)，以及[管理和監控工作負載中的 API 限流](https://aws.amazon.com/blogs/mt/managing-monitoring-api-throttling-in-workloads/)。

[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/verifiedpermissions/latest/userguide/quotas.html)