

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

# Amazon API Gateway 配額
<a name="limits"></a>

下列配額適用於所有 Amazon API Gateway API 類型。

## 每個區域的 API Gateway 帳戶層級配額
<a name="apigateway-account-level-limits-table"></a>

以下配額會根據 Amazon API Gateway 中的每個區域套用至每個區域。


| 資源或操作 | 預設配額 | 可以提高 | 
| --- | --- | --- | 
| HTTP API、REST API、WebSocket API 和 WebSocket Callback API 間每個帳戶、每個區域的調節配額。 | 每秒 10,000 個請求 (RPS)，加上[字符儲存貯體演算法](https://en.wikipedia.org/wiki/Token_bucket)提供的額外高載容量，最多使用 5,000 個請求的儲存貯體容量。 該高載配額是由 API Gateway 服務團隊根據各區域中該帳戶整體 RPS 配額而決定。客戶無法針對該配額進行控制或請求變更。  | [是](https://console.aws.amazon.com/servicequotas/home/services/apigateway/quotas/L-8A5B8E43) | 
| 入口網站每個區域每個帳戶無存取控制的調節配額 | 每秒 250，000 個請求 | 否 | 
| 入口網站每個區域每個帳戶的存取控制調節配額 | 每秒 10，000 個請求 | 否 | 

\$1 對於下列區域，預設限流配額為 2500 RPS，預設暴增配額為 1250 RPS：非洲 (開普敦)、歐洲 (米蘭)、亞太區域 (雅加達)、中東 (阿拉伯聯合大公國)、亞太區域 (海德拉巴)、亞太區域 (墨爾本)、歐洲 (西班牙)、歐洲 (蘇黎世)、以色列 (特拉維夫)、加拿大西部 (卡加利)、亞太區域 (馬來西亞)、亞太區域 (泰國) 和墨西哥 (中部)。

## 建立、部署和管理 API 的 API Gateway 配額
<a name="api-gateway-control-service-limits-table"></a>

下列固定配額適用於使用 、API Gateway 主控台或 API Gateway REST API 及其 SDKs 在 API Gateway 中建立 AWS CLI、部署和管理 API。這些配額無法增加。


| 動作 | 預設配額 | 可以提高 | 
| --- | --- | --- | 
| [CreateApiKey](https://docs.aws.amazon.com/apigateway/latest/api/API_CreateApiKey.html) | 每個帳戶每秒 5 個請求 | 否 | 
| [CreateDeployment](https://docs.aws.amazon.com/apigateway/latest/api/API_CreateDeployment.html) | 每個帳戶每 5 秒 1 個請求。 | 否 | 
| [CreateDocumentationVersion](https://docs.aws.amazon.com/apigateway/latest/api/API_CreateDocumentationVersion.html) | 每個帳戶每 20 秒 1 個請求。 | 否 | 
| [CreateDomainName](https://docs.aws.amazon.com/apigateway/latest/api/API_CreateDomainName.html) | 每個帳戶每 30 秒 1 個請求。 | 否 | 
| [CreateResource](https://docs.aws.amazon.com/apigateway/latest/api/API_CreateResource.html) | 每個帳戶每秒 5 個請求 | 否 | 
| 區域或私有 API 的 [CreateRestApi](https://docs.aws.amazon.com/apigateway/latest/api/API_CreateRestApi.html) | 每個帳戶每 3 秒 1 個請求。 | 否 | 
| 邊緣最佳化 API 的 [CreateRestApi](https://docs.aws.amazon.com/apigateway/latest/api/API_CreateRestApi.html) | 每個帳戶每 30 秒 1 個請求。 | 否 | 
|  [CreateVpcLink](https://docs.aws.amazon.com/apigatewayv2/latest/api-reference/vpclinks.html#CreateVpcLink) (V2)  | 每個帳戶每 15 秒 1 個請求。 | 否 | 
| [DeleteApiKey](https://docs.aws.amazon.com/apigateway/latest/api/API_DeleteApiKey.html) | 每個帳戶每秒 5 個請求 | 否 | 
| [DeleteDomainName](https://docs.aws.amazon.com/apigateway/latest/api/API_DeleteDomainName.html) | 每個帳戶每 30 秒 1 個請求。 | 否 | 
| [DeleteResource](https://docs.aws.amazon.com/apigateway/latest/api/API_DeleteResource.html) | 每個帳戶每秒 5 個請求 | 否 | 
| [DeleteRestApi](https://docs.aws.amazon.com/apigateway/latest/api/API_DeleteRestApi.html) | 每個帳戶每 30 秒 1 個請求。 | 否 | 
| [GetResources](https://docs.aws.amazon.com/apigateway/latest/api/API_GetResources.html) | 每個帳戶每 2 秒 5 個請求。 | 否 | 
|  [DeleteVpcLink](https://docs.aws.amazon.com/apigatewayv2/latest/api-reference/vpclinks.html#DeleteVpcLink) (V2)  | 每個帳戶每 30 秒 1 個請求。 | 否 | 
| [ImportDocumentationParts](https://docs.aws.amazon.com/apigateway/latest/api/API_ImportDocumentationParts.html) | 每個帳戶每 30 秒 1 個請求。 | 否 | 
| 區域或私有 API 的 [ImportRestApi](https://docs.aws.amazon.com/apigateway/latest/api/API_ImportRestApi.html) | 每個帳戶每 3 秒 1 個請求。 | 否 | 
| 邊緣最佳化 API 的 [ImportRestApi](https://docs.aws.amazon.com/apigateway/latest/api/API_ImportRestApi.html)  | 每個帳戶每 30 秒 1 個請求。 | 否 | 
| [PutRestApi](https://docs.aws.amazon.com/apigateway/latest/api/API_PutRestApi.html) | 每個帳戶每秒 1 個請求 | 否 | 
| [UpdateAccount](https://docs.aws.amazon.com/apigateway/latest/api/API_UpdateAccount.html) | 每個帳戶每 20 秒 1 個請求。 | 否 | 
| [UpdateDomainName](https://docs.aws.amazon.com/apigateway/latest/api/API_UpdateDomainName.html) | 每個帳戶每 30 秒 1 個請求。 | 否 | 
| [UpdateUsagePlan](https://docs.aws.amazon.com/apigateway/latest/api/API_UpdateUsagePlan.html) | 每個帳戶每 20 秒 1 個請求。 | 否 | 
| 建立入口網站 | 每 3 秒 1 個請求 | 否 | 
| 更新入口網站 | 每分鐘 2 個請求 | 否 | 
| 取得入口網站 | 每秒 10 個請求 | 否 | 
| 列出入口網站 | 每秒 10 個請求 | 否 | 
| 發佈入口網站 | 每分鐘 2 個請求 | 否 | 
| DeletePortal | 每分鐘 2 個請求 | 否 | 
| PreviewPortal | 每 3 秒 1 個請求 | 否 | 
| DisablePortal | 每分鐘 2 個請求 | 否 | 
| GetPortalProduct | 每秒 10 個請求 | 否 | 
| ListPortalProduct | 每秒 5 個請求 | 否 | 
| CreatePortalProduct | 每秒 2 個請求 | 否 | 
| UpdatePortalProduct | 每秒 0.5 個請求 | 否 | 
| DeletePortalProduct | 每秒 1 個請求 | 否 | 
| PutPortalProductSharingPolicy | 每 3 秒 1 個請求 | 否 | 
| GetPortalProductSharingPolicy | 每秒 10 個請求 | 否 | 
| DeletePortalProductSharingPolicy | 每 3 秒 1 個請求 | 否 | 
| CreateProductRestEndpointPage | 每 3 秒 1 個請求 | 否 | 
| GetProductRestEndpointPage | 每秒 10 個請求 | 否 | 
| UpdateProductRestEndpointPage | 每 3 秒 1 個請求 | 否 | 
| DeleteProductRestEndpointPage | 每 3 秒 1 個請求 | 否 | 
| ListProductRestEndpointPages | 每秒 10 個請求 | 否 | 
| CreateProductPage | 每 3 秒 1 個請求 | 否 | 
| GetProductPage | 每秒 10 個請求 | 否 | 
| UpdateProductPage | 每 3 秒 1 個請求 | 否 | 
| DeleteProductPage | 每 3 秒 1 個請求 | 否 | 
| ListProductPages | 每秒 10 個請求 | 否 | 
| 其他操作 | 配額不可超過帳戶配額總計。 | 否 | 
| 操作總計 | 每秒 10 個請求 (rps)，爆量配額為每秒 40 個請求。 | 否 | 

# 在 API Gateway 中設定和執行 REST API 的配額
<a name="api-gateway-execution-service-limits-table"></a>

下列配額適用於在 Amazon API Gateway 中設定和執行 REST API。如果配額是依每個 API 計算，則只能在特定 API 上增加配額，無法對帳戶中的所有 API 增加配額。

如需帳戶層級配額的相關資訊，請參閱 [Amazon API Gateway 配額](limits.md)。


| 資源或操作 | 預設配額 | 可以提高 | 
| --- | --- | --- | 
| 每個區域每個帳戶的公有自訂網域名稱 | 120 | [是](https://console.aws.amazon.com/servicequotas/home/services/apigateway/quotas/L-A93447B8) | 
| 每個區域每個帳戶的私有自訂網域名稱 | 50 | [是](https://console.aws.amazon.com/servicequotas/home/services/apigateway/quotas/L-24E7E662) | 
| 每個區域的區域 API | 600 | 否 | 
| 每個區域的邊緣最佳化 API | 120 | 否 | 
| 每個區域每個帳戶的私有 API | 600 | 否 | 
| 每個帳戶的網域名稱存取關聯 | 100 | [是](https://console.aws.amazon.com/servicequotas/home/services/apigateway/quotas/L-4D98A8A5) | 
| 每個網域的多層 API 映射 | 200 | 否 | 
| 每個網域的路由規則 | 50 | [是](https://console.aws.amazon.com/servicequotas/home/services/apigateway/quotas/L-68B79FF0) | 
| 邊緣最佳化 API 的 URL 長度 (以字元為單位) | 8192 | 否 | 
| 區域 API URL 的長度，以字元為單位 | 10240 | 否 | 
| 私有 API URL 的長度，以字元為單位 | 8192 | 否 | 
| API Gateway 資源政策的長度 (以字元為單位) | 8192 | [是](https://console.aws.amazon.com/servicequotas/home/services/apigateway/quotas/L-8B81B02C) | 
| 每個區域每個帳戶的 API 金鑰 | 10000 | 否 | 
| 每個區域每個帳戶的用戶端憑證 | 60 | [是](https://console.aws.amazon.com/servicequotas/home/services/apigateway/quotas/L-824C9E42) | 
| 每個 API (AWS Lambda 和 Amazon Cognito) 的授權方 | 10 |  是 若要增加此配額，請連絡 [AWS 支援中心](https://console.aws.amazon.com/support/home#/)  | 
| 每個 API 的文件部分 | 2000 |  是 若要增加此配額，請連絡 [AWS 支援中心](https://console.aws.amazon.com/support/home#/)  | 
| 每個 API 資源 | 300 | [是](https://console.aws.amazon.com/servicequotas/home/services/apigateway/quotas/L-01C8A9E0) | 
| 每個 API 階段 | 10 | [是](https://console.aws.amazon.com/servicequotas/home/services/apigateway/quotas/L-379E48B0) | 
| 每個階段的階段變數 | 100 | 否 | 
| 階段變數中的金鑰長度 (以字元為單位) | 64 | 否 | 
| 階段變數中的數值長度 (以字元為單位) | 512 | 否 | 
| 每個區域每個帳戶的用量計劃 | 300 | [是](https://console.aws.amazon.com/servicequotas/home/services/apigateway/quotas/L-E8693075) | 
| 每個 API 金鑰的用量計畫 | 10 | [是](https://console.aws.amazon.com/servicequotas/home/services/apigateway/quotas/L-985EB478) | 
| 每個區域每個帳戶的 VPC 連結 | 20 | [是](https://console.aws.amazon.com/servicequotas/home/services/apigateway/quotas/L-A4C7274F) | 
| API 快取 TTL | 預設值為 300 秒，而且 API 擁有者可以設定為 0 與 3600 之間的值。 | 不適用於上限 (3600) | 
| 快取的回應大小 | 1048576 個位元組。快取資料加密可能增加正在快取的項目大小。 | 否 | 
| 區域 API 的整合逾時 | 50 毫秒 - 所有整合類型的 29 秒，包括 Lambda、Lambda 代理、HTTP、HTTP 代理和 AWS 整合。 | [是 \$1](https://console.aws.amazon.com/servicequotas/home/services/apigateway/quotas/L-E5AE38E3) | 
| 邊緣最佳化 API 的整合逾時 | 50 毫秒 - 所有整合類型的 29 秒，包括 Lambda、Lambda 代理、HTTP、HTTP 代理和 AWS 整合。 | 否 | 
| 私有 API 的整合逾時 | 50 毫秒 - 所有整合類型的 29 秒，包括 Lambda、Lambda 代理、HTTP、HTTP 代理和 AWS 整合。 | [是 \$1](https://console.aws.amazon.com/servicequotas/home/services/apigateway/quotas/L-E5AE38E3) | 
| 所有標頭值的總合併大小，包括標頭名稱、值、任何換行符號和空格 | 10240 個位元組 | 否 | 
| 一個私有 API 所有標頭值的總合併大小 | 8000 個位元組 | 否 | 
| 承載大小 | 10 MB | 否 | 
| 每個階段的標籤 | 50 | 否 | 
| 映射範本中 \$1foreach ... \$1end 迴圈的反覆運算數目 | 1000 | 否 | 
| 映射範本大小上限 | 300 KB | 否 | 
| 存取日誌範本大小 | 3 KB | 否 | 
| 方法 ARN 長度 | 1600 個位元組。如果您的方法包含路徑參數，且用戶端使用的值超過 ARN 長度，則您的 API 將傳回 414 Request URI too long 回應。 | 否 | 
| 用量計劃中單一階段的方法層級調節設定 | 20 |  是 若要增加此配額，請連絡 [AWS 支援中心](https://console.aws.amazon.com/support/home#/)  | 
| 每個 API 的資料大小 | 400 KB | 否 | 
| 信任庫中的憑證數量 | 1,000 個憑證，總物件大小上限為 1 MB。 | 否 | 
| 閒置連線逾時 | 310 秒 | 否 | 
| 使用 [restapi:import](https://docs.aws.amazon.com/apigateway/latest/api/API_ImportRestApi.html) 或 [restapi:put](https://docs.aws.amazon.com/apigateway/latest/api/API_PutRestApi.html) 時的 API 定義檔案大小上限 | 6 MB | 否 | 

\$1 您無法將整合逾時設定為小於 50 毫秒。您可以將整合逾時提高到 29 秒以上，但這樣做可能需要減少您帳戶的區域層級限流配額。

## 減少配額的最佳實務
<a name="api-gateway-execution-service-limits-best-practices"></a>

以下最佳實務可能有助於減少您目前的資源數量，以避免增加您的配額。請確定這些建議適用於您的 API 架構。

**每個區域的 API**  
若要減少每個區域的 API 數量，請匯出任何未使用的 API，然後從 API Gateway 將其刪除。如需詳細資訊，請參閱[從 API Gateway 匯出 REST API](api-gateway-export-api.md)。

**每個 API 階段**  
若要減少每個 API 的階段數量，請將您的 API 拆分為多個 API。

**每個 API 資源**  
使用 `{proxy+}` 路徑來減少資源數量。如需詳細資訊，請參閱[設定代理整合與代理資源](api-gateway-set-up-simple-proxy.md)。

**API 映射**  
若要減少自訂網域名稱的 API 映射數量，請使用具有單一層級的 API 映射，例如 `/prod`。具有單一層級的 API 映射不會計入 API 映射配額。

**每個 API 的授權方**  
若要減少每個 API 的授權方數量，請對不同的 API 方法重複使用授權方。

**每個 API 的文件部分**  
若要減少每個 API 的文件組件數量，請在匯入 API 時使用 `ignore=documentation`。如需詳細資訊，請參閱[匯入 API 文件](api-gateway-documenting-api-quick-start-import-export.md)。  
您也可以使用內容繼承，允許某些文件組件從規格更普通的 API 實體繼承內容。如需詳細資訊，請參閱[API Gateway 中的 API 文件表示](api-gateway-documenting-api-content-representation.md)。

**API Gateway 資源政策的長度 (以字元為單位)**  
若要減少資源政策的長度，請使用 AWS WAFV2 來保護您的 API。如需詳細資訊，請參閱[使用 AWS WAF 來保護 API Gateway APIs 中的 REST API](apigateway-control-access-aws-waf.md)。  
如果您的政策包含 IP 位址，您也可以使用範圍而非特定值來定義 IP 位址。

**每個 API 金鑰的用量計畫**  
若要減少每個 API 金鑰的用量計畫數量，則讓每個用量計畫使用一個 API 金鑰，並將您的用量計畫與多個 API 建立關聯。我們不建議在多個用量計畫之間共用一個 API 金鑰。

# 在 API Gateway 中設定和執行 HTTP API 的配額
<a name="http-api-quotas"></a>

下列配額適用於在 Amazon API Gateway 中設定和執行 HTTP API。如果配額是依每個 API 計算，則只能在特定 API 上增加配額，無法對帳戶中的所有 API 增加配額。如需帳戶層級配額的相關資訊，請參閱 [Amazon API Gateway 配額](limits.md)


| 資源或操作 | 預設配額 | 可以提高 | 
| --- | --- | --- | 
| 每 API 的路由 | 300 | [是](https://console.aws.amazon.com/servicequotas/home/services/apigateway/quotas/L-65B5C802) | 
| 每 API 的整合 | 300 | 否 | 
| 最大整合逾時 | 30 秒 | 否 | 
| 每個 API 階段 | 10 | [是](https://console.aws.amazon.com/servicequotas/home/services/apigateway/quotas/L-379E48B0) | 
| 每個網域的多層 API 映射 | 200 個 API 映射。此限制不包括具有單一層級的 API 映射，例如 /prod。 | 否 | 
| 每個階段的標籤  | 50 | 否 | 
| 請求行與標頭值的總大小 | 10240 個位元組 | 否 | 
| 承載大小 | 10 MB | 否 | 
| 每個區域每個帳戶的自訂網域數 | 120 | [是](https://console.aws.amazon.com/servicequotas/home/services/apigateway/quotas/L-A93447B8) | 
| 存取日誌範本大小  | 3 KB | 否 | 
| Amazon CloudWatch Logs 日誌項目  | 1 MB | 否 | 
| 每個 API 的授權方  | 10 |  是 若要增加此配額，請連絡 [AWS 支援中心](https://console.aws.amazon.com/support/home#/)  | 
| 每個授權方的對象  | 50 | 否 | 
| 每個路由的範圍  | 10 | 否 | 
| JSON Web Key Set 端點的逾時  | 1500 毫秒 | 否 | 
| 來自 JSON Web 密鑰集端點的回應大小 | 150000 個位元組 | 否 | 
| OpenID Connect 探索端點的逾時  | 1500 毫秒 | 否 | 
| Lambda 授權方回應逾時 | 10000 毫秒 | 否 | 
| 每個區域每個帳戶的 VPC 連結 | 10 | [是](https://console.aws.amazon.com/servicequotas/home/services/apigateway/quotas/L-608BDCD4) | 
| 每個 VPC 連結的子網路數  | 10 | [是](https://console.aws.amazon.com/servicequotas/home/services/apigateway/quotas/L-668C9B28) | 
| 每個階段的階段變數 | 100 | 否 | 
| 階段變數中的金鑰長度 (以字元為單位) | 64 | 否 | 
| 階段變數中的數值長度 (以字元為單位) | 512 | 否 | 

## 減少配額的最佳實務
<a name="http-api-quotas-best-practices"></a>

以下最佳實務可能有助於減少您目前的資源數量，以避免增加您的配額。請確定這些建議適用於您的 API 架構。

**每個區域的 API**  
若要減少每個區域的 API 數量，請匯出任何未使用的 API，然後從 API Gateway 將其刪除。如需詳細資訊，請參閱[從 APIs Gateway 匯出 HTTP API](http-api-export.md)。

**每個 API 階段**  
若要減少每個 API 的階段數量，請將您的 API 拆分為多個 API。

**每個 API 的授權方**  
若要減少每個 API 的授權方數量，請對不同的 API 方法重複使用授權方。

# 在 API Gateway 中設定入口網站的配額
<a name="api-gateway-portal-quotas"></a>

下列配額適用於在 API Gateway 中建立入口網站。如需詳細資訊，請參閱[API Gateway 入口網站](apigateway-portals.md)。


| 資源或操作 | 預設配額 | 可以提高 | 
| --- | --- | --- | 
| 每個帳戶的入口網站 | 15 | 是 | 
| 每個入口網站的入口網站產品 | 200 | 是 | 
| 每個帳戶的入口網站產品 | 2000 | 是 | 
| 每個入口網站產品的產品 REST 端點頁面 | 40 | 是 | 
| 每個入口網站產品的產品頁面 | 40 | 是 | 
| 標誌大小 | 200 KB | 否 | 
| 每個產品 REST 端點頁面的文件頁面大小 | 32，000 個字元 | 否 | 
| 產品頁面的自訂頁面大小 | 32，000 個字元 | 否 | 
| 每個入口網站的自訂網域名稱 | 1 | 否 | 
| 每個入口網站的授權方 | 1 | 否 | 

# 在 API Gateway 中設定和執行 WebSocket 的配額
<a name="apigateway-execution-service-websocket-limits-table"></a>

下列配額適用於在 Amazon API Gateway 中設定和執行 WebSocket API。如果配額是依每個 API 計算，則只能在特定 API 上增加配額，無法對帳戶中的所有 API 增加配額。如需帳戶層級配額的相關資訊，請參閱 [Amazon API Gateway 配額](limits.md)


| 資源或操作 | 預設配額 | 可以提高 | 
| --- | --- | --- | 
| 每個帳戶 (所有 WebSocket API) 在每個區域每秒的新連線 | 500 | [是](https://console.aws.amazon.com/servicequotas/home/services/apigateway/quotas/L-9ED1E49A) | 
| 並行連線 | 不適用 \$1 | 不適用 | 
| AWS Lambda 每個 API 的授權方 | 10 |  是 若要增加此配額，請連絡 [AWS 支援中心](https://console.aws.amazon.com/support/home#/)  | 
| AWS Lambda 授權方結果大小 | 8 KB | 否 | 
| 每 API 的路由 | 300 | [是](https://console.aws.amazon.com/servicequotas/home/services/apigateway/quotas/L-01C8A9E0) | 
| 每 API 的整合 | 300 |  是 若要增加此配額，請連絡 [AWS 支援中心](https://console.aws.amazon.com/support/home#/)  | 
| 整合逾時 | 50 毫秒 - 所有整合類型的 29 秒，包括 Lambda、Lambda 代理、HTTP、HTTP 代理和 AWS 整合。 | 否 | 
| 每個 API 階段 | 10 | [是](https://console.aws.amazon.com/servicequotas/home/services/apigateway/quotas/L-379E48B0) | 
| WebSocket 框架大小 | 32 KB | 否 | 
| 訊息承載大小 | 128 KB \$1\$1 | 否 | 
| 映射範本大小上限 | 300 KB | 否 | 
| WebSocket API 連線持續時間 | 2 小時 | 否 | 
| 閒置連線逾時 | 10 分鐘 | 否 | 
| WebSocket API 的 URL 長度 (以字元為單位) | 4096 | 否 | 
| 存取日誌範本大小 | 3 KB | 否 | 

\$1 API Gateway 不會在並行連線上強制執行配額。並行連線的最大數目取決於新連線每秒速率，以及兩小時期間的連線數目上限。例如，預設配額為每秒 500 個新連線，如果用戶端在兩小時內以最大速率連線，則 API Gateway 最多可提供 3,600,000 個並行連線。

\$1\$1 由於 WebSocket 框架大小配額為 32 KB，因此大於 32 KB 的訊息必須分割成多個框架，每個最多 32 KB。這適用於 `@connections` 命令。如果接收到更大的訊息 (或更大的框架大小)，則該連線會關閉，並出現代碼 1009。

# Amazon API Gateway 重要說明
<a name="api-gateway-known-issues"></a>

下一節詳細說明可能會影響您使用 API Gateway 的備註。

**Topics**
+ [適用於 HTTP API 的 Amazon API Gateway 重要說明](#api-gateway-known-issues-http-apis)
+ [適用於 HTTP 和 WebSocket API 的 Amazon API Gateway 重要說明](#api-gateway-known-issues-http-and-websocket-apis)
+ [適用於 REST 和 WebSocket API 的 Amazon API Gateway 重要說明](#api-gateway-known-issues-rest-and-websocket-apis)
+ [適用於 WebSocket API 的 Amazon API Gateway 重要說明](#api-gateway-known-issues-websocket-apis)
+ [適用於 REST API 的 Amazon API Gateway 重要說明](#api-gateway-known-issues-rest-apis)

## 適用於 HTTP API 的 Amazon API Gateway 重要說明
<a name="api-gateway-known-issues-http-apis"></a>
+ HTTP API 會將傳入 `X-Forwarded-*` 標頭轉譯為標準 `Forwarded` 標頭，並附加傳出 IP、主機和通訊協定。
+ 如果沒有承載且 Content-Length 為 0，API Gateway 會將 Content-type 標頭新增至您的請求。

## 適用於 HTTP 和 WebSocket API 的 Amazon API Gateway 重要說明
<a name="api-gateway-known-issues-http-and-websocket-apis"></a>
+ 適用於 HTTP 和 WebSocket API 的 Amazon API Gateway 未正式支援第 4A 版簽署程序。

## 適用於 REST 和 WebSocket API 的 Amazon API Gateway 重要說明
<a name="api-gateway-known-issues-rest-and-websocket-apis"></a>
+ API Gateway 不支援在 REST 和 WebSocket API 間共用自訂網域名稱。
+ 階段名稱僅可含有英數字元、連字號與底線。長度上限為 128 字元。
+ 系統會為服務運作狀態檢查保留 `/ping` 和 `/sping` 的路徑。針對具有自訂網域的 API 根層級資源使用這些項目，將會無法產生預期的結果。
+ API Gateway 目前將日誌事件限制為 1024 個位元組。API Gateway 會先截斷大於 1024 個位元組的日誌事件 (例如請求和回應內文)，再提交至 CloudWatch Logs。
+ CloudWatch 指標目前會將維度名稱和值限制為 255 有效的 XML 字元。(如需更多詳細資訊，請參閱 [CloudWatch 使用者指南](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch_concepts.html#Dimension)。) 維度值是使用者定義的名稱的函數，包括 API 名稱、標籤 (階段) 名稱和資源名稱。選擇這些名稱時，請小心不要超過 CloudWatch 指標限制。
+ 映射範本的大小上限為 300 KB。

## 適用於 WebSocket API 的 Amazon API Gateway 重要說明
<a name="api-gateway-known-issues-websocket-apis"></a>
+ API Gateway 將支援高達 128 KB 的訊息承載，影格大小上限為 32 KB。如果訊息超過 32 KB，則必須分割成多個影格，每個為 32 KB 或以下。如果接收到更大的訊息，則該連線會關閉，並出現程式碼 1009。

## 適用於 REST API 的 Amazon API Gateway 重要說明
<a name="api-gateway-known-issues-rest-apis"></a>
+ 任何請求 URL 查詢字串不支援純文字管道字元 (`|`) 和大括號字元 (`{` 或 `}`)，而且必須進行 URL 編碼。
+ 任何請求 URL 查詢字串不支援分號字元 (`;`) 且會 導致資料分割。
+ REST API 會先解碼 URL 編碼的請求參數，然後再將它們傳遞至後端整合。對於 UTF-8 請求參數，REST API 會解碼參數，然後將參數當作 Unicode 傳遞至後端整合。REST API 在將百分號字元 (`%`) 傳遞到後端整合之前對其進行 URL 編碼。
+ 使用 API Gateway 主控台測試 API 時，如果向後端呈現自我簽署憑證、憑證鏈遺失中繼憑證，或後端擲回任何其他無法辨識憑證的相關例外狀況，則您可能會收到「不明端點錯誤」回應。
+ 針對具有私有整合的 API [https://docs.aws.amazon.com/apigateway/latest/api/API_Resource.html](https://docs.aws.amazon.com/apigateway/latest/api/API_Resource.html) 或 [https://docs.aws.amazon.com/apigateway/latest/api/API_Method.html](https://docs.aws.amazon.com/apigateway/latest/api/API_Method.html) 實體，您應該在移除 [https://docs.aws.amazon.com/apigateway/latest/api/API_VpcLink.html](https://docs.aws.amazon.com/apigateway/latest/api/API_VpcLink.html) 的任何硬式編碼參考之後將其刪除。否則，您會有一個懸置整合，並收到錯誤，指出仍在使用 VPC 連結，即使刪除 `Resource` 或 `Method` 實體也是一樣。私有整合透過階段變數參考 `VpcLink` 時，此行為不適用。
+ 下列後端可能不支援使用與 API Gateway 相容的方式來進行 SSL 用戶端身分驗證：
  + [NGINX](https://nginx.org/en/)
  +  [Heroku](https://www.heroku.com/)
+ API Gateway 支援大部分 [OpenAPI 2.0 規格](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/2.0.md)和 [OpenAPI 3.0 規格](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.1.md)，除了以下例外：
  + 路徑區段只能包含英數字元、底線、連字號、句號、逗號、冒號和大括號。路徑參數必須是個別的路徑區段。例如，"resource/\$1path\$1parameter\$1name\$1" 有效，"resource\$1path\$1parameter\$1name\$1" 卻無效。
  + 模型名稱只能包含英數字元。
  + 針對輸入參數，只支援下列屬性：`name`、`in`、`required`、`type`、`description`。其他屬性一概忽略。
  + `securitySchemes` 類型 (若已使用) 必須是 `apiKey`。不過，透過 [Lambda 授權方](apigateway-use-lambda-authorizer.md)支援 OAuth 2 和 HTTP 基本驗證；透過[供應商延伸](api-gateway-swagger-extensions-authorizer.md)完成 OpenAPI 組態。
  + 不支援 `deprecated` 欄位，且會在匯出的 API 中刪除此欄位。
  + 使用 [JSON 結構描述草稿第 4 版](https://datatracker.ietf.org/doc/html/draft-zyp-json-schema-04)定義 API Gateway 模型，而非 OpenAPI 所使用的 JSON 結構描述。
  + 在任何結構描述物件中，不支援 `discriminator` 參數。
  + 不支援 `example` 標籤。
  + 不支援 `nullable` 欄位。
  + API Gateway 不支援 `exclusiveMinimum`。
  + [簡單請求驗證](api-gateway-method-request-validation.md)不包含 `maxItems` 和 `minItems` 標籤。若要解決這個問題，請在執行驗證之前於匯入後更新模型。
  + 對於 OpenAPI 3.0，您無法在相同結構描述內擁有對定義使用 `$ref` 的 `oneOf`、`anyOf` 或 `allOf`。您可以直接輸入結構描述，或定義個別 API Gateway 模型資源。如需詳細資訊，請參閱[建立更複雜的模型](models-mappings-models.md#api-gateway-request-validation-model-more-complex)。
  + `oneOf` 不支援 OpenAPI 2.0 或 SDK 開發套件產生。
  + 不支援 `readOnly` 欄位。
  + `$ref` 無法用於參考其他檔案。
  + 在 OpenAPI 文件根中，不支援 `"500": {"$ref": "#/responses/UnexpectedError"}` 形式的回應定義。若要解決這個問題，請將參考取代為內嵌結構描述。
  + 不支援 `Int32` 或 `Int64` 類型的數字。範例顯示如下：

    ```
    "elementId": {
        "description": "Working Element Id",
        "format": "int32",
        "type": "number"
    }
    ```
  + 在結構描述定義中，不支援小數格式類型 (`"format": "decimal"`)。
  + 在方法回應中，結構描述定義必須為物件類型，而且不能是基本類型。例如，不支援 `"schema": { "type": "string"}`。不過，您可以使用下列物件類型來解決這個問題：

    ```
    "schema": {
         "$ref": "#/definitions/StringResponse"
                }
    
     "definitions": {
        "StringResponse": {
          "type": "string"
        }
      }
    ```
  + API Gateway 不會使用 OpenAPI 規格中定義的根層級安全性，因此您需要在操作層級中定義安全性，以便適當應用。
  + 不支援 `default` 關鍵字。
+ 使用 Lambda 整合或 HTTP 整合處理方法時，API Gateway 制定下列限制。
  + 標頭名稱和查詢參數是以區分大小寫的方式進行處理。
  + 傳送至整合端點或由整合端點送回時，可能會將下列資料表清單中的標頭捨棄或修改：在此資料表中：
    + `Remapped` 表示標頭名稱從 `<string>` 變更為 `X-Amzn-Remapped-<string>`。

      `Remapped Overwritten` 表示標頭名稱從 `<string>` 變更為 `X-Amzn-Remapped-<string>` 並且覆寫原來的值。    
[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/apigateway/latest/developerguide/api-gateway-known-issues.html)

    \$1 如果其包含[簽章版本 4](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_aws-signing.html) 的簽章或使用 `AWS_IAM` 授權，則 `Authorization` 標頭將被丟棄。
+ API Gateway 所產生之 API 的 Android 軟體開發套件使用 `java.net.HttpURLConnection` 類別。針對將 `WWW-Authenticate` 標頭重新對應至 `X-Amzn-Remapped-WWW-Authenticate` 的 401 回應，在執行 Android 4.4 和之前版本的裝置上，此類別將會擲回未處理的例外狀況。
+  與 API Gateway 所產生之 API 的 Java、Android 和 iOS 開發套件不同，API Gateway 所產生之 API 的 JavaScript 軟體開發套件不支援 500 層級錯誤重試。
+  方法測試呼叫會使用預設的 `application/json` 內容類型，並忽略任何其他內容類型的規格。
+ 傳遞 `X-HTTP-Method-Override` 標頭以傳送請求至 API 時，API Gateway 即會覆寫該方法。為了將標頭傳遞至後端，您需要將該標頭新增至整合請求中。
+  當請求在其 `Accept` 標頭中包含多個媒體類型時，API Gateway 只會採用第一個 `Accept` 媒體類型。如果您無法控制 `Accept` 媒體類型的順序，而且二進位內容的媒體類型不是清單中的第一個類型，您可以在 API 的 `binaryMediaTypes` 清單中新增第一個 `Accept` 媒體類型，API Gateway 將會傳回二進位格式的內容。例如，若要在瀏覽器中使用 `<img>` 元素來傳送 JPEG 檔案，瀏覽器可能會在請求中傳送 `Accept:image/webp,image/*,*/*;q=0.8`。透過新增 `image/webp` 至 `binaryMediaTypes` 清單，端點就能收到二進位格式的 JPEG 檔案。
+ 目前不支援自訂 `413 REQUEST_TOO_LARGE` 的預設閘道回應。
+ API Gateway 包含所有整合回應的 `Content-Type` 標頭。內容類型預設為 `application/json`。