How can I request, view, and manage service quota increase requests using AWS CLI commands?

6 minute read
0

I want to use AWS Command Line Interface (AWS CLI) commands to request service quota increases and then view and manage those requests.

Short description

You can request, view, and manage quotas, formerly known as limits, for AWS services from the Service Quotas console or using AWS CLI commands.

For a list of service quota AWS CLI commands, see AWS CLI Command Reference and the Service Quotas API Reference.

Note: If you receive errors when running AWS CLI commands, make sure that you're using the most recent version of the AWS CLI.

When using the AWS CLI to manage your service quotas, review the following points:

  • Unless otherwise noted, quotas are specific to each AWS Region. Make sure that you replace the --region parameter in your commands with the Region where you're requesting a quota increase.
  • There's a maximum number of active service quota requests that you can have at a particular time. Also, you can't adjust quota values. For more information, see Service quotas for Service Quotas.
  • The output for the API commands displays in a table format. For information on changing the output to appear in text or JSON format, see Controlling command output from the AWS CLI.

Resolution

Note: Each AWS service that's available in Service Quotas has an associated service code. Within each service, the available quota type has a quota code. You must include these codes in your service quota increase requests.

Run the list-services command to see the list of service codes for your Region. Replace eu-west-1 with your Region:

# aws service-quotas list-services --region eu-west-1 --output table

Run the list-service-quotas command to see available quota codes for a particular service and Region. In the following example, replace --service-code and --region with your specific service and Region. The following example requests service quotas for Amazon Elastic Compute Cloud (Amazon EC2) in the eu-west-1 Region.

# aws service-quotas list-service-quotas --service-code ec2 --region eu-west-1 --query "Quotas[*].{ServiceName:ServiceName,QuotaName:QuotaName,QuotaCode:QuotaCode,Value:Value}" --output table

Request a service quota increase

When requesting a service quota increase, check the current limit, and then increase the service quota in a particular Region.

1.    Run the get-service-quota command to check the applied quota value for the service you want to increase. The following example requests the service quota for the number of Elastic IP addresses in Amazon EC2 in the eu-west-1 Region. Replace the --service-code, --quota-code, and --region with the values for your request.

# aws service-quotas get-service-quota --service-code ec2 --quota-code L-0263D0A3 --region eu-west-1
{
    "Quota": {
        "ServiceCode": "ec2",
        "ServiceName": "Amazon Elastic Compute Cloud (Amazon EC2)",
        "QuotaArn": "arn:aws:servicequotas:eu-west-1:111122223333:ec2/L-0263D0A3",
        "QuotaCode": "L-0263D0A3",
        "QuotaName": "EC2-VPC Elastic IPs",
        "Value": 5.0,
        "Unit": "None",
        "Adjustable": true,
        "GlobalQuota": false
    }
}

2.    Use the request-service-quota-increase command to request a quota increase. The following example requests a quota increase for Number of Elastic IP addresses in Amazon EC2 in the eu-west-1 Region. Replace the --service-code, --quota-code, and --region with the values for your request.

# aws service-quotas request-service-quota-increase --service-code ec2 --quota-code L-0263D0A3 --region eu-west-1 --desired-value 10
{
    "RequestedQuota": {
        "Id": "d323c5f4eb8d400e96fbf34743b373a7YRHQ2y20",
        "ServiceCode": "ec2",
        "ServiceName": "Amazon Elastic Compute Cloud (Amazon EC2)",
        "QuotaCode": "L-0263D0A3",
        "QuotaName": "EC2-VPC Elastic IPs",
        "DesiredValue": 10.0,
        "Status": "PENDING",
        "Created": 1576431516.421,
        "Requester": "{\"accountId\":\"111122223333\",\"callerArn\":\"arn:aws:iam::111122223333:user/testeksuser\"}",
        "QuotaArn": "arn:aws:servicequotas:eu-west-1:111122223333:ec2/L-0263D0A3",
        "GlobalQuota": false,
        "Unit": "None"
    }

After creating the request, you can use the Service Quotas console to track the new case. Or, you can use the AWS CLI to check the request status.

Check the status of a service quota increase request

Run the get-requested-service-quota-change command to check the status of a pending request. In the following example, replace the --request-id and --region with the values of your request. The output shows the Case ID and the Status of the request.

# aws service-quotas get-requested-service-quota-change --request-id "d323c5f4eb8d400e96fbf34743b373a7YRHQ2y20" --region eu-west-1
{
    "RequestedQuota": {
        "Id": "d323c5f4eb8d400e96fbf34743b373a7YRHQ2y20",
        "CaseId": "6672648091",
        "ServiceCode": "ec2",
        "ServiceName": "Amazon Elastic Compute Cloud (Amazon EC2)",
        "QuotaCode": "L-0263D0A3",
        "QuotaName": "EC2-VPC Elastic IPs",
        "DesiredValue": 10.0,
        "Status": "CASE_OPENED",
        "Created": 1576431516.421,
        "LastUpdated": 1576431520.527,
        "Requester": "{\"accountId\":\"111122223333\",\"callerArn\":\"arn:aws:iam::111122223333:user/testeksuser\"}",
        "QuotaArn": "arn:aws:servicequotas:eu-west-1:111122223333:ec2/L-0263D0A3",
        "GlobalQuota": false,
        "Unit": "None"
    }
}

After a quota increase request reaches CASE_CLOSED, APPROVED, or DENIED status, you can check the details of the request. Service quota increase request history is kept for 90 days. For more information, see ListRequestedServiceQuotaChangeHistoryByQuota.

# aws service-quotas get-requested-service-quota-change --request-id "d323c5f4eb8d400e96fbf34743b373a7YRHQ2y20" --region eu-west-1
{
    "RequestedQuota": {
        "Id": "d323c5f4eb8d400e96fbf34743b373a7YRHQ2y20",
 
                                          "CaseId": "6672648091",
        "ServiceCode": "ec2",
        "ServiceName": "Amazon Elastic Compute Cloud (Amazon EC2)",
       
                                    "QuotaCode": "L-0263D0A3",
        "QuotaName": "EC2-VPC Elastic IPs",
        "DesiredValue": 10.0,
        "Status": "CASE_CLOSED",
 
                                          "Created": 1576431516.421,
        "LastUpdated": 1576432913.04,
        "Requester": "{\"accountId\":\"111122223333\",\"callerArn\":\"arn:aws:iam::111122223333:user/testeksuser\"}",
 
                                          "QuotaArn": "arn:aws:servicequotas:eu-west-1:111122223333:ec2/L-0263D0A3",
        "GlobalQuota": false,
        "Unit": "None"
    }
}

Track multiple service quota increase requests

Using the following APIs, you can check all requests that were made in a particular Region, including all services and their quotas codes. You can also check all requests that were made for a Region that's specific to a quota code.

Example 1

Run the following command to check the status of all requests that were made in a specific Region, including all services and their quota codes:

# aws service-quotas list-requested-service-quota-change-history --region eu-west-1 --query "RequestedQuotas[*].{CaseId:CaseId,Id:Id,QuotaCode:QuotaCode,QuotaName:QuotaName,DesiredValue:DesiredValue,Status:Status}" --output table
-------------------------------------------------------------------------------------------------------------------------------------------------
|                                                    ListRequestedServiceQuotaChangeHistory                                                     |
+------------+---------------+--------------------------------------------+-------------+----------------------------------------+--------------+
|   CaseId   | DesiredValue  |                    Id                      |  QuotaCode  |               QuotaName                |   Status     |
+------------+---------------+--------------------------------------------+-------------+----------------------------------------+--------------+
|  None      |  50.0         |  2f919bc7e8b942e4a4d9e48b70e714547VLCFkjY  |  L-3D9CCA6E |  Tasks per Maintenance Window          |  APPROVED    |
|  6673136551|  10.0         |  cc07103300c74653911cebbd78739dacEToPmn3Z  |  L-DE82EABA |  Running Dedicated g3 Hosts            |  CASE_OPENED |
|  6673112701|  10.0         |  fb78996c9c364915825bab46f2b6a313J8FAIAFm  |  L-8CCBD91B |  Running On-Demand m5d hosts           |  CASE_OPENED |
|  6673109881|  10.0         |  06db5543f3a74dcda55346ca4812a6a0H4jikbty  |  L-24D7D4AD |  Running On-Demand m5n hosts           |  CASE_OPENED |
|  6673043811|  10.0         |  0cf070a56ae742acaf5143f5685d9cc8pGWjHH9l  |  L-0263D0A3 |  EC2-VPC Elastic IPs                   |  CASE_OPENED |
|  6672648091|  10.0         |  d323c5f4eb8d400e96fbf34743b373a7YRHQ2y20  |  L-0263D0A3 |  EC2-VPC Elastic IPs                   |  CASE_CLOSED |
+------------+---------------+--------------------------------------------+-------------+----------------------------------------+--------------+

Example 2

Run the following command to check the status of all your requests that were made for a specific quota code:

# aws service-quotas list-requested-service-quota-change-history-by-quota --service-code ec2 --quota-code L-0263D0A3 --region eu-west-1 --query "RequestedQuotas[*].{CaseId:CaseId,Id:Id,QuotaCode:QuotaCode,QuotaName:QuotaName,DesiredValue:DesiredValue,Status:Status}" --output table
--------------------------------------------------------------------------------------------------------------------------------------
|                                            ListRequestedServiceQuotaChangeHistoryByQuota                                           |
+------------+---------------+--------------------------------------------+-------------+----------------------------+---------------+
|   CaseId   | DesiredValue  |                    Id                      |  QuotaCode  |         QuotaName          |    Status     |
+------------+---------------+--------------------------------------------+-------------+----------------------------+---------------+
|  6673043811|  10.0         |  0cf070a56ae742acaf5143f5685d9cc8pGWjHH9l  |  L-0263D0A3 |  EC2-VPC Elastic IPs       |  CASE_OPENED  |
|  6672648091|  10.0         |  d323c5f4eb8d400e96fbf34743b373a7YRHQ2y20  |  L-0263D0A3 |  EC2-VPC Elastic IPs       |  CASE_CLOSED  |
+------------+---------------+--------------------------------------------+-------------+----------------------------+---------------+

Related information

How can I troubleshoot errors using the AWS CLI to manage my Service Quota requests? 

What is Service Quotas?

Introducing Service Quotas: View and manage your quotas for AWS services from one central location

AWS OFFICIAL
AWS OFFICIALUpdated 10 months ago