如何對我使用 AWS CLI 管理服務配額請求時遇到的問題進行疑難排解?
當我使用 AWS Command Line Interface (AWS CLI) 管理服務配額增加時,遇到問題或收到錯誤訊息。
解決方法
**注意:**如果您在執行 AWS CLI 命令時收到錯誤,請參閱 Troubleshooting errors for the AWS CLI (對 AWS CLI 錯誤進行疑難排解)。此外,請務必使用最新版 AWS CLI。如需了解與服務配額無關的 AWS CLI 錯誤,請參閱 Why do I receive errors when I run AWS CLI commands? (為什麼我在執行 AWS CLI 命令時收到錯誤訊息?)
根據您遇到的問題採取下列動作。
list-service-quotas 命令未列出所有可用配額
list-service-quotas 命令僅顯示套用配額值的配額。若要檢視所有預設值,請執行 list-aws-default-service-quotas 命令。
list-service-quotas 命令範例:
aws service-quotas list-service-quotas --service-code vpc --region eu-west-1 --query "Quotas[*].{ServiceName:ServiceName,QuotaName:QuotaName,QuotaCode:QuotaCode,Value:Value}" --output table
輸出範例:
# aws service-quotas list-service-quotas --service-code vpc --region eu-west-1 --query "Quotas[*].{ServiceName:ServiceName,QuotaName:QuotaName,QuotaCode:QuotaCode,Value:Value}" --output table------------------------------------------------------------------------------------------------------ | ListServiceQuotas | +------------+--------------------------------+---------------------------------------------+--------+ | QuotaCode | QuotaName | ServiceName | Value | +------------+--------------------------------+---------------------------------------------+--------+ | L-A4707A72| Internet gateways per Region | Amazon Virtual Private Cloud (Amazon VPC) | 10.0 | | L-F678F1CE| VPCs per Region | Amazon Virtual Private Cloud (Amazon VPC) | 10.0 | +------------+--------------------------------+---------------------------------------------+--------+
**注意:**輸出顯示兩個套用值的 Amazon Virtual Private Cloud (Amazon VPC) 服務配額。
list-aws-default-service-quotas 命令範例:
aws service-quotas list-aws-default-service-quotas --service-code vpc --region eu-west-1 --query "Quotas[*].{ServiceName:ServiceName,QuotaName:QuotaName,QuotaCode:QuotaCode,Value:Value}" --output table
輸出範例:
# aws service-quotas list-aws-default-service-quotas --service-code vpc --region eu-west-1 --query "Quotas[*].{ServiceName:ServiceName,QuotaName:QuotaName,QuotaCode:QuotaCode,Value:Value}" --output table----------------------------------------------------------------------------------------------------------------------- | ListAWSDefaultServiceQuotas | +------------+------------------------------------------------+---------------------------------------------+---------+ | QuotaCode | QuotaName | ServiceName | Value | +------------+------------------------------------------------+---------------------------------------------+---------+ | L-7E9ECCDB| Active VPC peering connections per VPC | Amazon Virtual Private Cloud (Amazon VPC) | 50.0 | | L-45FE3B85| Egress-only internet gateways per Region | Amazon Virtual Private Cloud (Amazon VPC) | 5.0 | | L-1B52E74A| Gateway VPC endpoints per Region | Amazon Virtual Private Cloud (Amazon VPC) | 20.0 | | L-83CA0A9D| IPv4 CIDR blocks per VPC | Amazon Virtual Private Cloud (Amazon VPC) | 5.0 | | L-085A6257| IPv6 CIDR blocks per VPC | Amazon Virtual Private Cloud (Amazon VPC) | 1.0 | | L-0EA8095F| Inbound or outbound rules per security group | Amazon Virtual Private Cloud (Amazon VPC) | 60.0 | | L-29B6F2EB| Interface VPC endpoints per VPC | Amazon Virtual Private Cloud (Amazon VPC) | 50.0 | | L-A4707A72| Internet gateways per Region | Amazon Virtual Private Cloud (Amazon VPC) | 5.0 | | L-FE5A380F| NAT gateways per Availability Zone | Amazon Virtual Private Cloud (Amazon VPC) | 5.0 | | L-B4A6D682| Network ACLs per VPC | Amazon Virtual Private Cloud (Amazon VPC) | 200.0 | | L-DF5E4CA3| Network interfaces per Region | Amazon Virtual Private Cloud (Amazon VPC) | 5000.0 | | L-DC9F7029| Outstanding VPC peering connection requests | Amazon Virtual Private Cloud (Amazon VPC) | 25.0 | | L-2C462E13| Participant accounts per VPC | Amazon Virtual Private Cloud (Amazon VPC) | 100.0 | | L-589F43AA| Route tables per VPC | Amazon Virtual Private Cloud (Amazon VPC) | 200.0 | | L-93826ACB| Routes per route table | Amazon Virtual Private Cloud (Amazon VPC) | 50.0 | | L-2AEEBF1A| Rules per network ACL | Amazon Virtual Private Cloud (Amazon VPC) | 20.0 | | L-2AFB9258| Security groups per network interface | Amazon Virtual Private Cloud (Amazon VPC) | 5.0 | | L-407747CB| Subnets per VPC | Amazon Virtual Private Cloud (Amazon VPC) | 200.0 | | L-44499CD2| Subnets that can be shared with an account | Amazon Virtual Private Cloud (Amazon VPC) | 100.0 | | L-8312C5BB| VPC peering connection request expiry hours | Amazon Virtual Private Cloud (Amazon VPC) | 168.0 | | L-E79EC296| VPC security groups per Region | Amazon Virtual Private Cloud (Amazon VPC) | 2500.0 | | L-F678F1CE| VPCs per Region | Amazon Virtual Private Cloud (Amazon VPC) | 5.0 | +------------+------------------------------------------------+---------------------------------------------+---------+
**注意:**輸出顯示與 Amazon VPC 相關聯的所有配額及其預設配額值。
您收到 "ResourceAlreadyExistsException" 錯誤訊息
每個配額僅允許一個進行中的服務配額增加請求。如果您在上一個請求完成前就提交另一個請求,便會收到下列錯誤訊息:
"An error occurred (ResourceAlreadyExistsException) when calling the RequestServiceQuotaIncrease operation: Only one open service quota increase request is allowed per quota."
在提交配額增加請求前,請執行下列 list-requested-service-quota-change-history 命令,來檢查是否有待處理的服務配額請求:
aws service-quotas list-requested-service-quota-change-history --service-code example-service-code
**注意:**請將 example-service-code 替換為您的服務代碼。若要檢查是否有配額增加請求具特定狀態 (例如 Pending (待處理)),請使用 --status 選項。
您收到 "NoSuchResourceException" 錯誤訊息
如果您執行命令的服務沒有相關聯的服務配額,便會收到下列錯誤訊息:
"An error occurred (NoSuchResourceException) when calling the ListAWSDefaultServiceQuotas operation: The request failed because the specified service does not exist."
若要解決此問題,請執行下列 list-services 命令,以確認服務是否具有您搜尋的服務配額:
aws service-quotas list-services
此外,請確保您在命令中使用了正確的大小寫,因為服務代碼需區分大小寫。例如,Amazon Elastic Compute Cloud (Amazon EC2) 的服務代碼為 ec2,而非 EC2。
如需與服務配額相關的所有 API 清單,請參閱 Actions (動作)。
相關資訊
如何使用 AWS CLI 命令要求、檢視和管理增加服務配額的要求?
What is Service Quotas? (什麼是 Service Quotas?)
- 語言
- 中文 (繁體)

相關內容
已提問 3 年前