

# REL01-BP02 管理跨帳戶和區域的服務配額
<a name="rel_manage_service_limits_limits_considered"></a>

 如果您使用多個帳戶或區域，請在生產工作負載執行的所有環境中都要求合適的配額。

 **預期成果：**對於跨帳戶或區域的組態，或使用地區、區域或帳戶容錯移轉具有彈性設計的組態，服務和應用程式不應受到服務配額耗盡的影響。

 **常見的反模式：**
+ 允許一個隔離區域內的資源用量增長，但無維持其他隔離區域中容量的機制。
+  在隔離區域中單獨手動設定所有配額。
+  未考量彈性架構 (例如主動或被動) 日後在非主要區域降級期間對配額需求產生的影響。
+  未定期評估配額，並在工作負載執行所在的每個區域和帳戶中進行必要的變更。
+  不要利用[配額請求範本](https://docs.aws.amazon.com/servicequotas/latest/userguide/organization-templates.html)在多個區域和帳戶之間請求增加。
+  因誤認為增加配額會產生成本上的影響 (例如運算保留要求) 而未更新服務配額。

 **建立此最佳實務的優勢：**確認如果區域服務無法使用時，您可以處理次要區域或帳戶中目前的負載。這有助於降低區域中斷期間發生的錯誤數量或降級程度。

 **未建立此最佳實務時的曝險等級：**高 

## 實作指引
<a name="implementation-guidance"></a>

 系統會針對每個帳戶追蹤服務配額。除非另有說明，否則每個配額都是 AWS 區域 特有的。除生產環境之外，也會在所有適用的非生產環境中管理配額，因此不會阻礙測試和開發。要維持高水準的彈性，必須持續評估服務配額 (無論自動還是手動)。

 由於採用*主動/主動*、*主動/被動 - 熱*、*主動/被動 - 冷*，以及*主動/被動- 指示燈*方法實作設計，跨區域的工作負載越來越多，因此了解所有區域和帳戶配額級別至關重要。過去的流量模式不一定可明確指出服務配額是否正確設定。

 同樣重要的是，每個區域的服務配額名稱限制不一定相同。在某個區域中，該值可能是五，而另一個區域中的值可能是十。這些配額的管理必須跨所有的相同服務、帳戶和區域，以在負載下提供一致的彈性。

 在不同區域 (主動區域或被動區域) 間協調所有服務配額差異，並建立持續協調這類差異的程序。被動區域容錯移轉的測試計劃鮮少擴展至尖峰主動容量，意即演練日或桌面演練可能找不到區域之間的服務配額差異，因而無法維持正確的限制。

 *服務配額漂移*是指特定指定配額的服務配額限制在一個區域而非所有區域中發生變更的情況，這對於追蹤和評估非常重要。您應考慮在具有流量甚或雲端承載流量的區域中變更配額。
+  根據您的服務要求、延遲、法規和災難復原 (DR) 要求，選取相關的帳戶和區域。
+  確定所有相關帳戶、區域和可用區域中的服務配額。限制範圍受限於帳戶和區域。您應比較這些值的差異。

 **實作步驟** 
+  審查可能超出使用風險等級的 Service Quotas 值。超出 80% 和 90% 閾值時，AWS Trusted Advisor 會提供提醒。
+  審查任何被動區域 (主動/被動設計中) 的服務配額值。確認在主要區域失敗時，負載將可在次要區域中成功執行。
+  自動評估相同帳戶中的區域之間是否發生了任何服務配額漂移，並採取因應措施以變更限制。
+  如果客戶的組織單位 (OU) 是以支援的方式建構的，則應更新服務配額範本，以反映應套用至多個區域和帳戶的任何配額中的變更。
  +  建立範本，並將區域關聯至配額變更。
  +  審查所有現有的服務配額範本，確認是否有任何必要的變更 (區域、限制和帳戶)。

## 資源
<a name="resources"></a>

 **相關的最佳實務：**
+  [REL01-BP01 了解服務配額和限制](rel_manage_service_limits_aware_quotas_and_constraints.md) 
+  [REL01-BP03 透過架構適應固定服務配額和限制](rel_manage_service_limits_aware_fixed_limits.md) 
+  [REL01-BP04 監控和管理配額](rel_manage_service_limits_monitor_manage_limits.md) 
+  [REL01-BP05 自動化配額管理](rel_manage_service_limits_automated_monitor_limits.md) 
+  [REL01-BP06 確保目前配額與最大用量之間存在足夠差距以適應容錯移轉](rel_manage_service_limits_suff_buffer_limits.md) 
+  [REL03-BP01 選擇如何分割工作負載](rel_service_architecture_monolith_soa_microservice.md) 
+  [REL10-BP01 將工作負載部署至多個位置](rel_fault_isolation_multiaz_region_system.md) 
+  [REL11-BP01 監控工作負載的所有元件以偵測故障](rel_withstand_component_failures_monitoring_health.md) 
+  [REL11-BP03 將所有分層的修復自動化](rel_withstand_component_failures_auto_healing_system.md) 
+  [REL12-BP04 使用混沌工程測試彈性](rel_testing_resiliency_failure_injection_resiliency.md) 

 **相關文件：**
+ [AWS Well-Architected Framework 的可靠性支柱：可用性](https://docs.aws.amazon.com/wellarchitected/latest/reliability-pillar/availability.html)
+  [AWS Service Quotas (先前稱為 Service Limits)](https://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html) 
+  [AWS Trusted Advisor 最佳實務檢查 (請參閱 Service Limits 章節)](https://aws.amazon.com/premiumsupport/technology/trusted-advisor/best-practice-checklist/) 
+  [AWS Answers 上的 AWS Limit Monitor](https://aws.amazon.com/answers/account-management/limit-monitor/) 
+  [Amazon EC2 Service Limits](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-resource-limits.html) 
+  [什麼是 Service Quotas？](https://docs.aws.amazon.com/servicequotas/latest/userguide/intro.html) 
+ [如何請求提高配額](https://docs.aws.amazon.com/servicequotas/latest/userguide/request-quota-increase.html)
+ [服務端點和配額](https://docs.aws.amazon.com/general/latest/gr/aws-service-information.html)
+  [Service Quotas 使用者指南](https://docs.aws.amazon.com/servicequotas/latest/userguide/intro.html) 
+ [Quota Monitor for AWS](https://aws.amazon.com/solutions/implementations/quota-monitor/)
+ [AWS 故障隔離界限](https://docs.aws.amazon.com/whitepapers/latest/aws-fault-isolation-boundaries/abstract-and-introduction.html)
+ [備援的可用性](https://docs.aws.amazon.com/whitepapers/latest/availability-and-beyond-improving-resilience/availability-with-redundancy.html)
+ [AWS for Data](https://aws.amazon.com/data/)
+ [什麼是持續整合？](https://aws.amazon.com/devops/continuous-integration/)
+ [什麼是持續交付？](https://aws.amazon.com/devops/continuous-delivery/)
+ [APN 合作夥伴：可以幫助進行組態管理的合作夥伴](https://partners.amazonaws.com/search/partners?keyword=Configuration+Management&ref=wellarchitected)
+ [管理 AWS 上每租用戶帳戶 SaaS 環境中的帳戶生命週期](https://aws.amazon.com/blogs/mt/managing-the-account-lifecycle-in-account-per-tenant-saas-environments-on-aws/)
+ [管理和監控工作負載中的 API 限流](https://aws.amazon.com/blogs/mt/managing-monitoring-api-throttling-in-workloads/)
+ [使用 AWS Organizations 大規模檢視 AWS Trusted Advisor 建議](https://aws.amazon.com/blogs/mt/organizational-view-for-trusted-advisor/)
+ [使用 AWS Control Tower 自動提高服務限制和企業支援](https://aws.amazon.com/blogs/mt/automating-service-limit-increases-enterprise-support-aws-control-tower/)

 **相關影片：**
+  [AWS Live re:Inforce 2019 - Service Quotas](https://youtu.be/O9R5dWgtrVo) 
+ [使用 Service Quotas 檢視和管理 AWS 服務的配額](https://www.youtube.com/watch?v=ZTwfIIf35Wc)
+ [AWS IAM 配額示範](https://www.youtube.com/watch?v=srJ4jr6M9YQ)

 **相關服務：**
+ [Amazon CodeGuru Reviewer](https://aws.amazon.com/codeguru/)
+ [AWS CodeDeploy](https://aws.amazon.com/codedeploy/)
+ [AWS CloudTrail](https://aws.amazon.com/cloudtrail/)
+ [Amazon CloudWatch](https://aws.amazon.com/cloudwatch/)
+ [Amazon EventBridge](https://aws.amazon.com/eventbridge/)
+ [Amazon DevOps Guru](https://aws.amazon.com/devops-guru/)
+ [AWS Config](https://aws.amazon.com/config/)
+ [AWS Trusted Advisor](https://aws.amazon.com/premiumsupport/technology/trusted-advisor/)
+ [AWS CDK](https://aws.amazon.com/cdk/)
+ [AWS Systems Manager](https://aws.amazon.com/systems-manager/)
+ [AWS Marketplace](https://aws.amazon.com/marketplace/search/results?searchTerms=CMDB)