AWS CLI를 사용한 Service Quotas 예시 - AWS Command Line Interface

이 문서는 AWS CLI의 버전 1에만 해당합니다. AWS CLI의 버전 2와 관련된 문서는 버전 2 사용 설명서를 참조하세요.

AWS CLI를 사용한 Service Quotas 예시

다음 코드 예시는 Service Quotas와 함께 AWS Command Line Interface를 사용하여 작업을 수행하고 일반적인 시나리오를 구현하는 방법을 보여줍니다.

작업은 대규모 프로그램에서 발췌한 코드이며 컨텍스트에 맞춰 실행해야 합니다. 작업은 관련 시나리오의 컨텍스트에 따라 표시되며, 개별 서비스 함수를 직접적으로 호출하는 방법을 보여줍니다.

각 예시에는 전체 소스 코드에 대한 링크가 포함되어 있으며, 여기에서 컨텍스트에 맞춰 코드를 설정하고 실행하는 방법에 대한 지침을 찾을 수 있습니다.

주제

작업

다음 코드 예시에서는 get-aws-default-service-quota의 사용 방법을 보여줍니다.

AWS CLI

기본 서비스 할당량 설명

다음 get-aws-default-service-quota 예시에서는 지정된 할당량의 세부 정보를 표시합니다.

aws service-quotas get-aws-default-service-quota \ --service-code ec2 \ --quota-code L-1216C47A

출력:

{ "Quota": { "ServiceCode": "ec2", "ServiceName": "Amazon Elastic Compute Cloud (Amazon EC2)", "QuotaArn": "arn:aws:servicequotas:us-east-2::ec2/L-1216C47A", "QuotaCode": "L-1216C47A", "QuotaName": "Running On-Demand Standard (A, C, D, H, I, M, R, T, Z) instances", "Value": 5.0, "Unit": "None", "Adjustable": true, "GlobalQuota": false, "UsageMetric": { "MetricNamespace": "AWS/Usage", "MetricName": "ResourceCount", "MetricDimensions": { "Class": "Standard/OnDemand", "Resource": "vCPU", "Service": "EC2", "Type": "Resource" }, "MetricStatisticRecommendation": "Maximum" } } }

다음 코드 예시에서는 get-requested-service-quota-change의 사용 방법을 보여줍니다.

AWS CLI

서비스 할당량 증가 요청 설명

다음 get-requested-service-quota-change 예시에서는 지정된 할당량 증가 요청에 대해 설명합니다.

aws service-quotas get-requested-service-quota-change \ --request-id d187537d15254312a9609aa51bbf7624u7W49tPO

출력:

{ "RequestedQuota": { "Id": "d187537d15254312a9609aa51bbf7624u7W49tPO", "CaseId": "6780195351", "ServiceCode": "ec2", "ServiceName": "Amazon Elastic Compute Cloud (Amazon EC2)", "QuotaCode": "L-20F13EBD", "QuotaName": "Running Dedicated c5n Hosts", "DesiredValue": 2.0, "Status": "CASE_OPENED", "Created": 1580446904.067, "LastUpdated": 1580446953.265, "Requester": "{\"accountId\":\"123456789012\",\"callerArn\":\"arn:aws:iam::123456789012:root\"}", "QuotaArn": "arn:aws:servicequotas:us-east-2:123456789012:ec2/L-20F13EBD", "GlobalQuota": false, "Unit": "None" } }

다음 코드 예시에서는 get-service-quota의 사용 방법을 보여줍니다.

AWS CLI

서비스 할당량 설명

다음 get-service-quota 예시에서는 지정된 할당량의 세부 정보를 표시합니다.

aws service-quotas get-service-quota \ --service-code ec2 \ --quota-code L-1216C47A

출력:

{ "Quota": { "ServiceCode": "ec2", "ServiceName": "Amazon Elastic Compute Cloud (Amazon EC2)", "QuotaArn": "arn:aws:servicequotas:us-east-2:123456789012:ec2/L-1216C47A", "QuotaCode": "L-1216C47A", "QuotaName": "Running On-Demand Standard (A, C, D, H, I, M, R, T, Z) instances", "Value": 1920.0, "Unit": "None", "Adjustable": true, "GlobalQuota": false, "UsageMetric": { "MetricNamespace": "AWS/Usage", "MetricName": "ResourceCount", "MetricDimensions": { "Class": "Standard/OnDemand", "Resource": "vCPU", "Service": "EC2", "Type": "Resource" }, "MetricStatisticRecommendation": "Maximum" } } }
  • API 세부 정보는 AWS CLI 명령 참조GetServiceQuota를 참조합니다.

다음 코드 예시에서는 list-aws-default-service-quotas의 사용 방법을 보여줍니다.

AWS CLI

서비스의 기본 할당량 나열

다음 list-aws-default-service-quotas 예시에서는 지정된 서비스의 할당량에 대한 기본값을 나열합니다.

aws service-quotas list-aws-default-service-quotas \ --service-code xray

출력:

{ "Quotas": [ { "ServiceCode": "xray", "ServiceName": "AWS X-Ray", "QuotaArn": "arn:aws:servicequotas:us-west-2::xray/L-C6B6F05D", "QuotaCode": "L-C6B6F05D", "QuotaName": "Indexed annotations per trace", "Value": 50.0, "Unit": "None", "Adjustable": false, "GlobalQuota": false }, { "ServiceCode": "xray", "ServiceName": "AWS X-Ray", "QuotaArn": "arn:aws:servicequotas:us-west-2::xray/L-D781C0FD", "QuotaCode": "L-D781C0FD", "QuotaName": "Segment document size", "Value": 64.0, "Unit": "Kilobytes", "Adjustable": false, "GlobalQuota": false }, { "ServiceCode": "xray", "ServiceName": "AWS X-Ray", "QuotaArn": "arn:aws:servicequotas:us-west-2::xray/L-998BFF16", "QuotaCode": "L-998BFF16", "QuotaName": "Trace and service graph retention in days", "Value": 30.0, "Unit": "None", "Adjustable": false, "GlobalQuota": false } ] }

다음 코드 예시에서는 list-requested-service-quota-change-history-by-quota의 사용 방법을 보여줍니다.

AWS CLI

할당량 증가 요청 나열

다음 list-requested-service-quota-change-history-by-quota 예시에서는 지정된 할당량에 대한 할당량 증가 요청을 나열합니다.

aws service-quotas list-requested-service-quota-change-history-by-quota \ --service-code ec2 \ --quota-code L-20F13EBD

출력:

{ "RequestedQuotas": [ { "Id": "d187537d15254312a9609aa51bbf7624u7W49tPO", "CaseId": "6780195351", "ServiceCode": "ec2", "ServiceName": "Amazon Elastic Compute Cloud (Amazon EC2)", "QuotaCode": "L-20F13EBD", "QuotaName": "Running Dedicated c5n Hosts", "DesiredValue": 2.0, "Status": "CASE_OPENED", "Created": 1580446904.067, "LastUpdated": 1580446953.265, "Requester": "{\"accountId\":\"123456789012\",\"callerArn\":\"arn:aws:iam::123456789012:root\"}", "QuotaArn": "arn:aws:servicequotas:us-east-2:123456789012:ec2/L-20F13EBD", "GlobalQuota": false, "Unit": "None" } ] }

다음 코드 예시에서는 list-requested-service-quota-change-history의 사용 방법을 보여줍니다.

AWS CLI

할당량 증가 요청 나열

다음 list-requested-service-quota-change-history 예시에서는 지정된 서비스에 대한 할당량 증가 요청을 나열합니다.

aws service-quotas list-requested-service-quota-change-history \ --service-code ec2

출력:

{ "RequestedQuotas": [ { "Id": "d187537d15254312a9609aa51bbf7624u7W49tPO", "CaseId": "6780195351", "ServiceCode": "ec2", "ServiceName": "Amazon Elastic Compute Cloud (Amazon EC2)", "QuotaCode": "L-20F13EBD", "QuotaName": "Running Dedicated c5n Hosts", "DesiredValue": 2.0, "Status": "CASE_OPENED", "Created": 1580446904.067, "LastUpdated": 1580446953.265, "Requester": "{\"accountId\":\"123456789012\",\"callerArn\":\"arn:aws:iam::123456789012:root\"}", "QuotaArn": "arn:aws:servicequotas:us-east-2:123456789012:ec2/L-20F13EBD", "GlobalQuota": false, "Unit": "None" } ] }

다음 코드 예시에서는 list-service-quotas의 사용 방법을 보여줍니다.

AWS CLI

서비스 할당량 나열

다음 list-service-quotas 예시에서는 AWS CloudFormation의 할당량에 대한 세부 정보를 표시합니다.

aws service-quotas list-service-quotas \ --service-code cloudformation

출력:

{ "Quotas": [ { "ServiceCode": "cloudformation", "ServiceName": "AWS CloudFormation", "QuotaArn": "arn:aws:servicequotas:us-east-2:123456789012:cloudformation/L-87D14FB7", "QuotaCode": "L-87D14FB7", "QuotaName": "Output count in CloudFormation template", "Value": 60.0, "Unit": "None", "Adjustable": false, "GlobalQuota": false }, { "ServiceCode": "cloudformation", "ServiceName": "AWS CloudFormation", "QuotaArn": "arn:aws:servicequotas:us-east-2:123456789012:cloudformation/L-0485CB21", "QuotaCode": "L-0485CB21", "QuotaName": "Stack count", "Value": 200.0, "Unit": "None", "Adjustable": true, "GlobalQuota": false } ] }
  • API 세부 정보는 AWS CLI 명령 참조ListServiceQuotas를 참조하세요.

다음 코드 예시에서는 list-services의 사용 방법을 보여줍니다.

AWS CLI

사용 가능한 서비스 나열

다음 명령은 Service Quotas에서 사용할 수 있는 서비스를 나열합니다.

aws service-quotas list-services

출력:

{ "Services": [ { "ServiceCode": "AWSCloudMap", "ServiceName": "AWS Cloud Map" }, { "ServiceCode": "access-analyzer", "ServiceName": "Access Analyzer" }, { "ServiceCode": "acm", "ServiceName": "AWS Certificate Manager (ACM)" }, ...truncated... { "ServiceCode": "xray", "ServiceName": "AWS X-Ray" } ] }

--query 파라미터를 추가하여 관심 있는 정보로 표시 내용을 필터링할 수 있습니다. 다음 예시에서는 서비스 코드만 표시합니다.

aws service-quotas list-services \ --query Services[*].ServiceCode

출력:

[ "AWSCloudMap", "access-analyzer", "acm", "acm-pca", "amplify", "apigateway", "application-autoscaling", ...truncated... "xray" ]
  • API 세부 정보는 AWS CLI 명령 참조ListServices를 참조하세요.

다음 코드 예시에서는 request-service-quota-increase의 사용 방법을 보여줍니다.

AWS CLI

서비스 할당량 증가 요청

다음 request-service-quota-increase 예시에서는 지정된 서비스 할당량의 증가를 요청합니다.

aws service-quotas request-service-quota-increase \ --service-code ec2 \ --quota-code L-20F13EBD \ --desired-value 2

출력:

{ "RequestedQuota": { "Id": "d187537d15254312a9609aa51bbf7624u7W49tPO", "ServiceCode": "ec2", "ServiceName": "Amazon Elastic Compute Cloud (Amazon EC2)", "QuotaCode": "L-20F13EBD", "QuotaName": "Running Dedicated c5n Hosts", "DesiredValue": 2.0, "Status": "PENDING", "Created": 1580446904.067, "Requester": "{\"accountId\":\"123456789012\",\"callerArn\":\"arn:aws:iam::123456789012:root\"}", "QuotaArn": "arn:aws:servicequotas:us-east-2:123456789012:ec2/L-20F13EBD", "GlobalQuota": false, "Unit": "None" } }