다음 코드 예제는 API Gateway와 함께 AWS Command Line Interface를 사용하여 작업을 수행하고 일반적인 시나리오를 구현하는 방법을 보여줍니다.
작업은 대규모 프로그램에서 발췌한 코드이며 컨텍스트에 맞춰 실행해야 합니다. 작업은 관련 시나리오의 컨텍스트에 따라 표시되며, 개별 서비스 함수를 직접적으로 호출하는 방법을 보여줍니다.
각 예시에는 전체 소스 코드에 대한 링크가 포함되어 있으며, 여기에서 컨텍스트에 맞춰 코드를 설정하고 실행하는 방법에 대한 지침을 찾을 수 있습니다.
주제
작업
다음 코드 예시에서는 create-api-key
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
기존 API 및 스테이지에 대해 활성화된 API 키를 생성하는 방법
명령:
aws apigateway create-api-key --name '
Dev API Key
' --description 'Used for development
' --enabled --stage-keys restApiId='a1b2c3d4e5',stageName='dev'-
API 세부 정보는 AWS CLI 명령 참조의 CreateApiKey
를 참조하세요.
-
다음 코드 예시에서는 create-authorizer
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
예제 1: API에 대해 토큰 기반 API Gateway 사용자 지정 권한 부여자를 생성하는 방법
다음
create-authorizer
예제에서는 토큰 기반 권한 부여자를 생성합니다.aws apigateway create-authorizer \ --rest-api-id
1234123412
\ --name 'First_Token_Custom_Authorizer
' \ --typeTOKEN
\ --authorizer-uri 'arn:aws:apigateway:us-west-2:lambda:path/2015-03-31/functions/arn:aws:lambda:us-west-2:123412341234:function:customAuthFunction/invocations
' \ --identity-source 'method.request.header.Authorization
' \ --authorizer-result-ttl-in-seconds300
출력:
{ "authType": "custom", "name": "First_Token_Custom_Authorizer", "authorizerUri": "arn:aws:apigateway:us-west-2:lambda:path/2015-03-31/functions/arn:aws:lambda:us-west-2:123412341234:function:customAuthFunction/invocations", "authorizerResultTtlInSeconds": 300, "identitySource": "method.request.header.Authorization", "type": "TOKEN", "id": "z40xj0" }
예제 2: API에 대해 Cognito 사용자 풀 기반 API Gateway 사용자 지정 권한 부여자를 생성하는 방법
다음
create-authorizer
예제에서는 Cognito 사용자 풀 기반 API Gateway 사용자 지정 권한 부여자를 생성합니다.aws apigateway create-authorizer \ --rest-api-id
1234123412
\ --name 'First_Cognito_Custom_Authorizer
' \ --typeCOGNITO_USER_POOLS
\ --provider-arns 'arn:aws:cognito-idp:us-east-1:123412341234:userpool/us-east-1_aWcZeQbuD
' \ --identity-source 'method.request.header.Authorization
'출력:
{ "authType": "cognito_user_pools", "identitySource": "method.request.header.Authorization", "name": "First_Cognito_Custom_Authorizer", "providerARNs": [ "arn:aws:cognito-idp:us-east-1:342398297714:userpool/us-east-1_qWbZzQhzE" ], "type": "COGNITO_USER_POOLS", "id": "5yid1t" }
예제 3: API에 대해 요청 기반 API Gateway 사용자 지정 권한 부여자를 생성하는 방법
다음
create-authorizer
예제에서는 요청 기반 권한 부여자를 생성합니다.aws apigateway create-authorizer \ --rest-api-id
1234123412
\ --name 'First_Request_Custom_Authorizer
' \ --typeREQUEST
\ --authorizer-uri 'arn:aws:apigateway:us-west-2:lambda:path/2015-03-31/functions/arn:aws:lambda:us-west-2:123412341234:function:customAuthFunction/invocations
' \ --identity-source 'method.request.header.Authorization,context.accountId
' \ --authorizer-result-ttl-in-seconds300
출력:
{ "id": "z40xj0", "name": "First_Request_Custom_Authorizer", "type": "REQUEST", "authType": "custom", "authorizerUri": "arn:aws:apigateway:us-west-2:lambda:path/2015-03-31/functions/arn:aws:lambda:us-west-2:123412341234:function:customAuthFunction/invocations", "identitySource": "method.request.header.Authorization,context.accountId", "authorizerResultTtlInSeconds": 300 }
-
API 세부 정보는 AWS CLI 명령 참조의 CreateAuthorizer
를 참조하세요.
-
다음 코드 예시에서는 create-base-path-mapping
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
사용자 지정 도메인 이름의 기본 경로 매핑을 생성하는 방법
명령:
aws apigateway create-base-path-mapping --domain-name
subdomain.domain.tld
--rest-api-id1234123412
--stageprod
--base-pathv1
-
API 세부 정보는 AWS CLI 명령 참조의 CreateBasePathMapping
을 참조하세요.
-
다음 코드 예시에서는 create-deployment
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
API용으로 구성된 리소스를 새 스테이지에 배포하는 방법
명령:
aws apigateway create-deployment --rest-api-id
1234123412
--stage-namedev
--stage-description 'Development Stage
' --description 'First deployment to the dev stage
'API용으로 구성된 리소스를 기존 스테이지에 배포하는 방법
명령:
aws apigateway create-deployment --rest-api-id
1234123412
--stage-namedev
--description 'Second deployment to the dev stage
'API용으로 구성된 리소스를 기존 스테이지에 스테이지 변수와 함께 배포하는 방법
aws apigateway create-deployment --rest-api-id 1,234,123,412 --stage-name dev --description 'Third deployment to the dev stage' --variables key='value',otherKey='otherValue'
-
API 세부 정보는 AWS CLI 명령 참조의 CreateDeployment
를 참조하세요.
-
다음 코드 예시에서는 create-domain-name-access-association
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
도메인 이름 액세스 연결을 생성하려면
다음
create-domain-name-access-association
예제에서는 프라이빗 사용자 지정 도메인 이름과 VPC 엔드포인트 간에 도메인 이름 액세스 연결을 생성합니다.aws apigateway create-domain-name-access-association \ --domain-name-arn
arn:aws:apigateway:us-west-2:111122223333:/domainnames/my.private.domain.tld+abcd1234
\ --access-association-sourcevpce-abcd1234efg
\ --access-association-source-typeVPCE
출력:
{ "domainNameAccessAssociationArn": "arn:aws:apigateway:us-west-2:012345678910:/domainnameaccessassociations/domainname/my.private.domain.tld/vpcesource/vpce-abcd1234efg "accessAssociationSource": "vpce-abcd1234efg", "accessAssociationSourceType": "VPCE", "domainNameArn" : "arn:aws:apigateway:us-west-2:111122223333:/domainnames/private.example.com+abcd1234" }
자세한 내용은 Amazon API Gateway 개발자 안내서의 API Gateway에서 프라이빗 API에 대한 사용자 지정 도메인 이름을 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 CreateDomainNameAccessAssociation
섹션을 참조하세요.
-
다음 코드 예시에서는 create-domain-name
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
예제 1: 퍼블릭 사용자 지정 도메인 이름 생성
다음
create-domain-name
예제에서는 퍼블릭 사용자 지정 도메인 이름을 생성합니다.aws apigateway create-domain-name \ --domain-name '
my.domain.tld
' \ --certificate-name 'my.domain.tld cert
'\ --certificate-arn 'arn:aws:acm:us-east-1:012345678910:certificate/fb1b9770-a305-495d-aefb-27e5e101ff3
'출력:
{ "domainName": "my.domain.tld", "certificateName": "my.domain.tld cert", "certificateArn": "arn:aws:acm:us-east-1:012345678910:certificate/fb1b9770-a305-495d-aefb-27e5e101ff3", "certificateUploadDate": "2024-10-08T11:29:49-07:00", "distributionDomainName": "abcd1234.cloudfront.net", "distributionHostedZoneId": "Z2FDTNDATAQYW2", "endpointConfiguration": { "types": [ "EDGE" ] }, "domainNameStatus": "AVAILABLE", "securityPolicy": "TLS_1_2" }
자세한 내용은 Amazon API Gateway 개발자 안내서의 API Gateway에서 퍼블릭 REST API에 대한 사용자 지정 도메인 이름을 참조하세요.
예제 2: 프라이빗 사용자 지정 도메인 이름 생성
다음
create-domain-name
예제에서는 프라이빗 사용자 지정 도메인 이름을 생성합니다.aws apigateway create-domain-name \ --domain-name '
my.private.domain.tld
' \ --certificate-name 'my.domain.tld cert
' \ --certificate-arn 'arn:aws:acm:us-east-1:012345678910:certificate/fb1b9770-a305-495d-aefb-27e5e101ff3
' \ --endpoint-configuration '{"types": ["PRIVATE"]}
' \ --security-policy 'TLS_1_2
' \ --policyfile://policy.json
policy.json
의 콘텐츠:{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Principal": "*", "Action": "execute-api:Invoke", "Resource": [ "execute-api:/*" ] }, { "Effect": "Deny", "Principal": "*", "Action": "execute-api:Invoke", "Resource": [ "execute-api:/*" ], "Condition" : { "StringNotEquals": { "aws:SourceVpce": "vpce-abcd1234efg" } } } ] }
출력:
{ "domainName": "my.private.domain.tld", "domainNameId": "abcd1234", "domainNameArn": "arn:aws:apigateway:us-east-1:012345678910:/domainnames/my.private.domain.tld+abcd1234", "certificateArn": "arn:aws:acm:us-east-1:012345678910:certificate/fb1b9770-a305-495d-aefb-27e5e101ff3", "certificateUploadDate": "2024-09-10T10:31:20-07:00", "endpointConfiguration": { "types": [ "PRIVATE" ] }, "domainNameStatus": "AVAILABLE", "securityPolicy": "TLS_1_2", "policy": "{\"Version\":\"2012-10-17\",\"Statement\":[{\"Effect\":\"Allow\",\"Principal\":\"*\",\"Action\":\"execute-api:Invoke\",\"Resource\":\"arn:aws:execute-api:us-east-1:012345678910:/domainnames/my.private.domain.tld+abcd1234\"},{\"Effect\":\"Deny\",\"Principal\":\"*\",\"Action\":\"execute-api:Invoke\",\"Resource\":\"arn:aws:execute-api:us-east-1:012345678910:/domainnames/my.private.domain.tld+abcd1234\",\"Condition\":{\"StringNotEquals\":{\"aws:SourceVpc\":\"vpc-1a2b3c4d\"}}}]}" }
자세한 내용은 Amazon API Gateway 개발자 안내서의 API Gateway에서 퍼블릭 REST API에 대한 사용자 지정 도메인 이름을 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 CreateDomainName
을 참조하세요.
-
다음 코드 예시에서는 create-model
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
API에 대한 모델을 생성하는 방법
명령:
aws apigateway create-model --rest-api-id
1234123412
--name 'firstModel
' --description 'The First Model
' --content-type 'application/json
' --schema '{ "$schema": "http://json-schema.org/draft-04/schema#", "title": "firstModel", "type": "object", "properties": { "firstProperty" : { "type": "object", "properties": { "key": { "type": "string" } } } } }
'출력:
{ "contentType": "application/json", "description": "The First Model", "name": "firstModel", "id": "2rzg0l", "schema": "{ \"$schema\": \"http://json-schema.org/draft-04/schema#\", \"title\": \"firstModel\", \"type\": \"object\", \"properties\": { \"firstProperty\" : { \"type\": \"object\", \"properties\": { \"key\": { \"type\": \"string\" } } } } }" }
-
API 세부 정보는 AWS CLI 명령 참조의 CreateModel
을 참조하세요.
-
다음 코드 예시에서는 create-resource
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
API에서 리소스를 생성하는 방법
명령:
aws apigateway create-resource --rest-api-id
1234123412
--parent-ida1b2c3
--path-part 'new-resource
'-
API 세부 정보는 AWS CLI 명령 참조의 CreateResource
를 참조하세요.
-
다음 코드 예시에서는 create-rest-api
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
API를 생성하는 방법
명령:
aws apigateway create-rest-api --name '
My First API
' --description 'This is my first API
'기존 API에서 복제 API를 생성하는 방법
명령:
aws apigateway create-rest-api --name '
Copy of My First API
' --description 'This is a copy of my first API
' --clone-from1234123412
-
API 세부 정보는 AWS CLI 명령 참조의 CreateRestApi
를 참조하세요.
-
다음 코드 예시에서는 create-stage
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
API에서 기존 배포를 포함할 스테이지를 생성하는 방법
명령:
aws apigateway create-stage --rest-api-id
1234123412
--stage-name 'dev
' --description 'Development stage
' --deployment-ida1b2c3
API에서 기존 배포 및 사용자 지정 스테이지 변수를 포함할 스테이지를 생성하는 방법
명령:
aws apigateway create-stage --rest-api-id
1234123412
--stage-name 'dev
' --description 'Development stage
' --deployment-ida1b2c3
--variables key='value',otherKey='otherValue'-
API 세부 정보는 AWS CLI 명령 참조의 CreateStage
를 참조하세요.
-
다음 코드 예시에서는 create-usage-plan-key
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
기존 API 키를 사용 계획과 연결
명령:
aws apigateway create-usage-plan-key --usage-plan-id
a1b2c3
--key-type"API_KEY"
--key-id4vq3yryqm5
-
API 세부 정보는 AWS CLI 명령 참조의 CreateUsagePlanKey
를 참조하세요.
-
다음 코드 예시에서는 create-usage-plan
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
월초에 재설정되는 스로틀 및 할당량 제한이 있는 사용 계획을 생성하는 방법
명령:
aws apigateway create-usage-plan --name
"New Usage Plan"
--description"A new usage plan"
--throttleburstLimit=10,rateLimit=5
--quotalimit=500,offset=0,period=MONTH
-
API 세부 정보는 AWS CLI 명령 참조의 CreateUsagePlan
을 참조하세요.
-
다음 코드 예시에서는 delete-api-key
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
API 키를 삭제하는 방법
명령:
aws apigateway delete-api-key --api-key
8bklk8bl1k3sB38D9B3l0enyWT8c09B30lkq0blk
-
API 세부 정보는 AWS CLI 명령 참조의 DeleteApiKey
를 참조하세요.
-
다음 코드 예시에서는 delete-authorizer
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
API에서 사용자 지정 권한 부여자를 삭제하는 방법
명령:
aws apigateway delete-authorizer --rest-api-id
1234123412
--authorizer-id7gkfbo
-
API 세부 정보는 AWS CLI 명령 참조의 DeleteAuthorizer
를 참조하세요.
-
다음 코드 예시에서는 delete-base-path-mapping
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
사용자 지정 도메인 이름의 기본 경로 매핑을 삭제하는 방법
명령:
aws apigateway delete-base-path-mapping --domain-name '
api.domain.tld
' --base-path 'dev
'-
API 세부 정보는 AWS CLI 명령 참조의 DeleteBasePathMapping
을 참조하세요.
-
다음 코드 예시에서는 delete-client-certificate
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
클라이언트 인증서를 삭제하는 방법
명령:
aws apigateway delete-client-certificate --client-certificate-id
a1b2c3
-
API 세부 정보는 AWS CLI 명령 참조의 DeleteClientCertificate
를 참조하세요.
-
다음 코드 예시에서는 delete-deployment
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
API에서 배포를 삭제하는 방법
명령:
aws apigateway delete-deployment --rest-api-id
1234123412
--deployment-ida1b2c3
-
API 세부 정보는 AWS CLI 명령 참조의 DeleteDeployment
를 참조하세요.
-
다음 코드 예시에서는 delete-domain-name-access-association
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
도메인 이름 액세스 연결을 삭제하려면
다음
delete-domain-name-access-association
예제에서는 프라이빗 사용자 지정 도메인 이름과 VPC 엔드포인트 간의 도메인 이름 액세스 연결을 삭제합니다.aws apigateway delete-domain-name-access-association \ --domain-name-access-association-arn
arn:aws:apigateway:us-west-2:012345678910:/domainnameaccessassociations/domainname/my.private.domain.tld/vpcesource/vpce-abcd1234efg
이 명령은 출력을 생성하지 않습니다.
자세한 내용은 Amazon API Gateway 개발자 안내서의 API Gateway에서 프라이빗 API에 대한 사용자 지정 도메인 이름을 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 DeleteDomainNameAccessAssociation
섹션을 참조하세요.
-
다음 코드 예시에서는 delete-domain-name
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
사용자 지정 도메인 이름을 삭제하는 방법
명령:
aws apigateway delete-domain-name --domain-name '
api.domain.tld
'-
API 세부 정보는 AWS CLI 명령 참조의 DeleteDomainName
을 참조하세요.
-
다음 코드 예시에서는 delete-integration-response
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
API에서 지정된 리소스, 메서드 및 상태 코드에 대한 통합 응답을 삭제하는 방법
명령:
aws apigateway delete-integration-response --rest-api-id
1234123412
--resource-ida1b2c3
--http-methodGET
--status-code200
-
API 세부 정보는 AWS CLI 명령 참조의 DeleteIntegrationResponse
를 참조하세요.
-
다음 코드 예시에서는 delete-integration
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
API에서 지정된 리소스 및 메서드에 대한 통합을 삭제하는 방법
명령:
aws apigateway delete-integration --rest-api-id
1234123412
--resource-ida1b2c3
--http-methodGET
-
API 세부 정보는 AWS CLI 명령 참조의 DeleteIntegration
을 참조하세요.
-
다음 코드 예시에서는 delete-method-response
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
API에서 지정된 리소스, 메서드 및 상태 코드에 대한 메서드 응답을 삭제하는 방법
명령:
aws apigateway delete-method-response --rest-api-id
1234123412
--resource-ida1b2c3
--http-methodGET
--status-code200
-
API 세부 정보는 AWS CLI 명령 참조의 DeleteMethodResponse
를 참조하세요.
-
다음 코드 예시에서는 delete-method
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
API에서 지정된 리소스에 대한 메서드를 삭제하는 방법
명령:
aws apigateway delete-method --rest-api-id
1234123412
--resource-ida1b2c3
--http-methodGET
-
API 세부 정보는 AWS CLI 명령 참조의 DeleteMethod
를 참조하세요.
-
다음 코드 예시에서는 delete-model
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
지정된 API에서 모델을 삭제하는 방법
명령:
aws apigateway delete-model --rest-api-id
1234123412
--model-name 'customModel
'-
API 세부 정보는 AWS CLI 명령 참조의 DeleteModel
을 참조하세요.
-
다음 코드 예시에서는 delete-resource
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
API에서 리소스를 삭제하는 방법
명령:
aws apigateway delete-resource --rest-api-id
1234123412
--resource-ida1b2c3
-
API 세부 정보는 AWS CLI 명령 참조의 DeleteResource
를 참조하세요.
-
다음 코드 예시에서는 delete-rest-api
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
API를 삭제하는 방법
명령:
aws apigateway delete-rest-api --rest-api-id
1234123412
-
API 세부 정보는 AWS CLI 명령 참조의 DeleteRestApi
를 참조하세요.
-
다음 코드 예시에서는 delete-stage
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
API에서 스테이지를 삭제하는 방법
명령:
aws apigateway delete-stage --rest-api-id
1234123412
--stage-name 'dev
'-
API 세부 정보는 AWS CLI 명령 참조의 DeleteStage
를 참조하세요.
-
다음 코드 예시에서는 delete-usage-plan-key
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
사용 계획에서 API 키를 제거하는 방법
명령:
aws apigateway delete-usage-plan-key --usage-plan-id
a1b2c3
--key-id1NbjQzMReAkeEQPNAW8r3dXsU2rDD7fc7f2Sipnu
-
API 세부 정보는 AWS CLI 명령 참조의 DeleteUsagePlanKey
를 참조하세요.
-
다음 코드 예시에서는 delete-usage-plan
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
사용 계획을 삭제하는 방법
명령:
aws apigateway delete-usage-plan --usage-plan-id
a1b2c3
-
API 세부 정보는 AWS CLI 명령 참조의 DeleteUsagePlan
을 참조하세요.
-
다음 코드 예시에서는 flush-stage-authorizers-cache
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
스테이지의 모든 권한 부여자 캐시 항목을 비우는 방법
명령:
aws apigateway flush-stage-authorizers-cache --rest-api-id
1234123412
--stage-namedev
-
API 세부 정보는 AWS CLI 명령 참조의 FlushStageAuthorizersCache
를 참조하세요.
-
다음 코드 예시에서는 flush-stage-cache
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
API 스테이지에 대한 캐시를 비우는 방법
다음
flush-stage-cache
예제에서는 스테이지의 캐시를 플러시합니다.aws apigateway flush-stage-cache \ --rest-api-id
1234123412
\ --stage-namedev
이 명령은 출력을 생성하지 않습니다.
자세한 내용은 Amazon API Gateway 개발자 안내서의 API Gateway에서 API 스테이지 캐시 플러시를 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 FlushStageCache
를 참조하세요.
-
다음 코드 예시에서는 generate-client-certificate
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
클라이언트 측 SSL 인증서를 생성하는 방법
명령:
aws apigateway generate-client-certificate --description '
My First Client Certificate
'-
API 세부 정보는 AWS CLI 명령 참조의 GenerateClientCertificate
를 참조하세요.
-
다음 코드 예시에서는 get-account
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
API Gateway 계정 설정을 가져오는 방법
명령:
aws apigateway get-account
출력:
{ "cloudwatchRoleArn": "arn:aws:iam::123412341234:role/APIGatewayToCloudWatchLogsRole", "throttleSettings": { "rateLimit": 500.0, "burstLimit": 1000 } }
-
API 세부 정보는 AWS CLI 명령 참조의 GetAccount
를 참조하세요.
-
다음 코드 예시에서는 get-api-key
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
특정 API 키에 대한 정보를 가져오는 방법
명령:
aws apigateway get-api-key --api-key
8bklk8bl1k3sB38D9B3l0enyWT8c09B30lkq0blk
출력:
{ "description": "My first key", "enabled": true, "stageKeys": [ "a1b2c3d4e5/dev", "e5d4c3b2a1/dev" ], "lastUpdatedDate": 1456184515, "createdDate": 1456184452, "id": "8bklk8bl1k3sB38D9B3l0enyWT8c09B30lkq0blk", "name": "My key" }
-
API 세부 정보는 AWS CLI 명령 참조의 GetApiKey
를 참조하세요.
-
다음 코드 예시에서는 get-api-keys
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
API 키 목록을 가져오는 방법
명령:
aws apigateway get-api-keys
출력:
{ "items": [ { "description": "My first key", "enabled": true, "stageKeys": [ "a1b2c3d4e5/dev", "e5d4c3b2a1/dev" ], "lastUpdatedDate": 1456184515, "createdDate": 1456184452, "id": "8bklk8bl1k3sB38D9B3l0enyWT8c09B30lkq0blk", "name": "My key" } ] }
-
API 세부 정보는 AWS CLI 명령 참조의 GetApiKeys
를 참조하세요.
-
다음 코드 예시에서는 get-authorizer
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
API Gateway API별 권한 부여자 설정을 가져오는 방법
명령:
aws apigateway get-authorizer --rest-api-id
1234123412
--authorizer-idgfi4n3
출력:
{ "authorizerResultTtlInSeconds": 300, "name": "MyAuthorizer", "type": "TOKEN", "identitySource": "method.request.header.Authorization", "authorizerUri": "arn:aws:apigateway:us-west-2:lambda:path/2015-03-31/functions/arn:aws:lambda:us-west-2:123412341234:function:authorizer_function/invocations", "id": "gfi4n3" }
-
API 세부 정보는 AWS CLI 명령 참조의 GetAuthorizer
를 참조하세요.
-
다음 코드 예시에서는 get-authorizers
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
REST API에 대한 권한 부여자의 목록을 가져오는 방법
명령:
aws apigateway get-authorizers --rest-api-id
1234123412
출력:
{ "items": [ { "name": "MyAuthorizer", "authorizerUri": "arn:aws:apigateway:us-west-2:lambda:path/2015-03-31/functions/arn:aws:lambda:us-west-2:123412341234:function:My_Authorizer_Function/invocations", "authorizerResultTtlInSeconds": 300, "identitySource": "method.request.header.Authorization", "type": "TOKEN", "id": "gfi4n3" } ] }
-
API 세부 정보는 AWS CLI 명령 참조의 GetAuthorizers
를 참조하세요.
-
다음 코드 예시에서는 get-base-path-mapping
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
사용자 지정 도메인 이름의 기본 경로 매핑을 가져오는 방법
명령:
aws apigateway get-base-path-mapping --domain-name
subdomain.domain.tld
--base-pathv1
출력:
{ "basePath": "v1", "restApiId": "1234w4321e", "stage": "api" }
-
API 세부 정보는 AWS CLI 명령 참조의 GetBasePathMapping
을 참조하세요.
-
다음 코드 예시에서는 get-base-path-mappings
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
사용자 지정 도메인 이름의 기본 경로 매핑들을 가져오는 방법
명령:
aws apigateway get-base-path-mappings --domain-name
subdomain.domain.tld
출력:
{ "items": [ { "basePath": "(none)", "restApiId": "1234w4321e", "stage": "dev" }, { "basePath": "v1", "restApiId": "1234w4321e", "stage": "api" } ] }
-
API 세부 정보는 AWS CLI 명령 참조의 GetBasePathMappings
를 참조하세요.
-
다음 코드 예시에서는 get-client-certificate
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
클라이언트 인증서를 가져오는 방법
명령:
aws apigateway get-client-certificate --client-certificate-id
a1b2c3
-
API 세부 정보는 AWS CLI 명령 참조의 GetClientCertificate
를 참조하세요.
-
다음 코드 예시에서는 get-client-certificates
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
클라이언트 인증서의 목록을 가져오는 방법
명령:
aws apigateway get-client-certificates
출력:
{ "items": [ { "pemEncodedCertificate": "-----BEGIN CERTIFICATE----- <certificate content> -----END CERTIFICATE-----", "clientCertificateId": "a1b2c3", "expirationDate": 1483556561, "description": "My Client Certificate", "createdDate": 1452020561 } ] }
-
API 세부 정보는 AWS CLI 명령 참조의 GetClientCertificates
를 참조하세요.
-
다음 코드 예시에서는 get-deployment
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
배포에 대한 정보를 가져오는 방법
명령:
aws apigateway get-deployment --rest-api-id
1234123412
--deployment-idztt4m2
출력:
{ "description": "myDeployment", "id": "ztt4m2", "createdDate": 1455218022 }
-
API 세부 정보는 AWS CLI 명령 참조의 GetDeployment
섹션을 참조하세요.
-
다음 코드 예시에서는 get-deployments
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
REST API에 대한 배포의 목록을 가져오는 방법
명령:
aws apigateway get-deployments --rest-api-id
1234123412
출력:
{ "items": [ { "createdDate": 1453797217, "id": "0a2b4c", "description": "Deployed my API for the first time" } ] }
-
API 세부 정보는 AWS CLI 명령 참조의 GetDeployments
를 참조하세요.
-
다음 코드 예시에서는 get-domain-name-access-associations
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
예제 1: 모든 도메인 이름 액세스 연결 나열
다음
get-domain-name-access-associations
예제에서는 모든 도메인 이름 액세스 연결을 나열합니다.aws apigateway get-domain-name-access-associations
출력:
{ "items": [ { "domainNameAccessAssociationArn": "arn:aws:apigateway:us-west-2:012345678910:/domainnameaccessassociations/domainname/my.private.domain.tld/vpcesource/vpce-abcd1234efg "accessAssociationSource": "vpce-abcd1234efg", "accessAssociationSourceType": "VPCE", "domainNameArn" : "arn:aws:apigateway:us-west-2:111122223333:/domainnames/private.example.com+abcd1234" } ] }
자세한 내용은 Amazon API Gateway 개발자 안내서의 API Gateway에서 프라이빗 API에 대한 사용자 지정 도메인 이름을 참조하세요.
예제 2: 이 AWS 계정이 소유한 모든 도메인 이름 액세스 연결 나열
다음
get-domain-name-access-associations
예제에서는 현재 AWS 계정이 소유한 모든 도메인 이름 액세스 연결을 나열합니다.aws apigateway get-domain-name-access-associations \ --resource-owner
SELF
출력:
{ "items": [ { "domainNameAccessAssociationArn": "arn:aws:apigateway:us-west-2:012345678910:/domainnameaccessassociations/domainname/my.private.domain.tld/vpcesource/vpce-abcd1234efg "accessAssociationSource": "vpce-abcd1234efg", "accessAssociationSourceType": "VPCE", "domainNameArn" : "arn:aws:apigateway:us-west-2:111122223333:/domainnames/private.example.com+abcd1234" } ] }
자세한 내용은 Amazon API Gateway 개발자 안내서의 API Gateway에서 프라이빗 API에 대한 사용자 지정 도메인 이름을 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 GetDomainNameAccessAssociations
를 참조하세요.
-
다음 코드 예시에서는 get-domain-name
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
예제 1: 퍼블릭 사용자 지정 도메인 이름에 대한 정보를 가져오는 방법
다음
get-domain-name
예제에서는 퍼블릭 사용자 지정 도메인 이름에 대한 정보를 가져옵니다.aws apigateway get-domain-name \ --domain-name
api.domain.tld
출력:
{ "domainName": "api.domain.tld", "distributionDomainName": "d1a2f3a4c5o6d.cloudfront.net", "certificateName": "uploadedCertificate", "certificateUploadDate": 1462565487 }
자세한 내용은 Amazon API Gateway 개발자 안내서의 API Gateway에서 퍼블릭 REST API에 대한 사용자 지정 도메인 이름을 참조하세요.
예제 2: 프라이빗 사용자 지정 도메인 이름에 대한 정보를 가져오는 방법
다음
get-domain-name
예제에서는 프라이빗 사용자 지정 도메인 이름에 대한 정보를 가져옵니다.aws apigateway get-domain-name \ --domain-name
api.private.domain.tld
\ --domain-name-idabcd1234
출력:
{ "domainName": "my.private.domain.tld", "domainNameId": "abcd1234", "domainNameArn": "arn:aws:apigateway:us-east-1:012345678910:/domainnames/my.private.domain.tld+abcd1234", "certificateArn": "arn:aws:acm:us-east-1:012345678910:certificate/fb1b9770-a305-495d-aefb-27e5e101ff3", "certificateUploadDate": "2024-09-10T10:31:20-07:00", "endpointConfiguration": { "types": [ "PRIVATE" ] }, "domainNameStatus": "AVAILABLE", "securityPolicy": "TLS_1_2", "policy": "{\"Version\":\"2012-10-17\",\"Statement\":[{\"Effect\":\"Allow\",\"Principal\":\"*\",\"Action\":\"execute-api:Invoke\",\"Resource\":\"arn:aws:execute-api:us-east-1:012345678910:/domainnames/my.private.domain.tld+abcd1234\"},{\"Effect\":\"Deny\",\"Principal\":\"*\",\"Action\":\"execute-api:Invoke\",\"Resource\":\"arn:aws:execute-api:us-east-1:012345678910:/domainnames/my.private.domain.tld+abcd1234\",\"Condition\":{\"StringNotEquals\":{\"aws:SourceVpc\":\"vpc-1a2b3c4d\"}}}]}" }
자세한 내용은 Amazon API Gateway 개발자 안내서의 API Gateway에서 퍼블릭 REST API에 대한 사용자 지정 도메인 이름을 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 GetDomainName
을 참조하세요.
-
다음 코드 예시에서는 get-domain-names
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
예제 1: 사용자 지정 도메인 이름의 목록을 가져오는 방법
다음
get-domain-names
명령은 도메인 이름 목록을 가져옵니다.aws apigateway get-domain-names
출력:
{ "items": [ { "distributionDomainName": "d9511k3l09bkd.cloudfront.net", "certificateUploadDate": 1452812505, "certificateName": "my_custom_domain-certificate", "domainName": "subdomain.domain.tld" } ] }
자세한 내용은 Amazon API Gateway 개발자 안내서의 API Gateway에서 프라이빗 API에 대한 사용자 지정 도메인 이름을 참조하세요.
예제 2: 이 AWS 계정이 소유한 사용자 지정 도메인 이름 목록을 가져오는 방법
다음
get-domain-names
명령은 이 AWS 계정이 소유한 도메인 이름 목록을 가져옵니다.aws apigateway get-domain-names \ --resource-owner
SELF
출력:
{ "items": [ { "domainName": "my.domain.tld", "domainNameArn": "arn:aws:apigateway:us-east-1::/domainnames/my.private.domain.tld", "certificateUploadDate": "2024-08-15T17:02:55-07:00", "regionalDomainName": "d-abcd1234.execute-api.us-east-1.amazonaws.com", "regionalHostedZoneId": "Z1UJRXOUMOOFQ8", "regionalCertificateArn": "arn:aws:acm:us-east-1:012345678910:certificate/fb1b9770-a305-495d-aefb-27e5e101ff3", "endpointConfiguration": { "types": [ "REGIONAL" ] }, "domainNameStatus": "AVAILABLE", "securityPolicy": "TLS_1_2" }, { "domainName": "my.private.domain.tld", "domainNameId": "abcd1234", "domainNameArn": "arn:aws:apigateway:us-east-1:012345678910:/domainnames/my.private.domain.tld+abcd1234", "certificateArn": "arn:aws:acm:us-east-1:012345678910:certificate/fb1b9770-a305-495d-aefb-27e5e101ff3", "certificateUploadDate": "2024-11-26T11:44:40-08:00", "endpointConfiguration": { "types": [ "PRIVATE" ] }, "domainNameStatus": "AVAILABLE", "securityPolicy": "TLS_1_2" } ] }
자세한 내용은 Amazon API Gateway 개발자 안내서의 API Gateway에서 프라이빗 API에 대한 사용자 지정 도메인 이름을 참조하세요.
예제 3: 도메인 이름 액세스 연결을 생성할 수 있는 다른 AWS 계정이 소유한 사용자 지정 도메인 이름 목록을 가져오는 방법.
다음
get-domain-names
명령은 도메인 이름 액세스 연결을 생성할 수 있는 액세스 권한이 있는 다른 AWS 계정이 소유한 도메인 이름 목록을 가져옵니다.aws apigateway get-domain-names \ --resource-owner
OTHER_ACCOUNTS
출력:
{ "items": [ { "domainName": "my.private.domain.tld", "domainNameId": "abcd1234", "domainNameArn": "arn:aws:apigateway:us-east-1:012345678910:/domainnames/my.private.domain.tld+abcd1234" } ] }
자세한 내용은 Amazon API Gateway 개발자 안내서의 API Gateway에서 프라이빗 API에 대한 사용자 지정 도메인 이름을 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 GetDomainNames
를 참조하세요.
-
다음 코드 예시에서는 get-export
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
스테이지에 대한 JSON Swagger 템플릿을 가져오는 방법
명령:
aws apigateway get-export --rest-api-id
a1b2c3d4e5
--stage-namedev
--export-typeswagger
/path/to/filename.json
스테이지에 대한 JSON Swagger 템플릿 + API Gateway 확장을 가져오는 방법
명령:
aws apigateway get-export --parameters extensions='integrations' --rest-api-id
a1b2c3d4e5
--stage-namedev
--export-typeswagger
/path/to/filename.json
스테이지에 대한 JSON Swagger 템플릿 + Postman 확장을 가져오는 방법
명령:
aws apigateway get-export --parameters extensions='postman' --rest-api-id
a1b2c3d4e5
--stage-namedev
--export-typeswagger
/path/to/filename.json
-
API 세부 정보는 AWS CLI명령 참조의 GetExport
를 참조하세요.
-
다음 코드 예시에서는 get-integration-response
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
REST API의 리소스에서 정의된 HTTP 메서드에 대한 통합 응답 구성을 가져오는 방법
명령:
aws apigateway get-integration-response --rest-api-id
1234123412
--resource-idy9h6rt
--http-methodGET
--status-code200
출력:
{ "statusCode": "200", "responseTemplates": { "application/json": null } }
-
API 세부 정보는 AWS CLI 명령 참조의 GetIntegrationResponse
를 참조하세요.
-
다음 코드 예시에서는 get-integration
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
REST API의 리소스에서 정의된 HTTP 메서드에 대한 통합 구성을 가져오는 방법
명령:
aws apigateway get-integration --rest-api-id
1234123412
--resource-idy9h6rt
--http-methodGET
출력:
{ "httpMethod": "POST", "integrationResponses": { "200": { "responseTemplates": { "application/json": null }, "statusCode": "200" } }, "cacheKeyParameters": [], "type": "AWS", "uri": "arn:aws:apigateway:us-west-2:lambda:path/2015-03-31/functions/arn:aws:lambda:us-west-2:123412341234:function:My_Function/invocations", "cacheNamespace": "y9h6rt" }
-
API 세부 정보는 AWS CLI 명령 참조의 GetIntegration
을 참조하세요.
-
다음 코드 예시에서는 get-method-response
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
REST API의 리소스에서 정의된 HTTP 메서드에 대한 메서드 응답 리소스 구성을 가져오는 방법
명령:
aws apigateway get-method-response --rest-api-id
1234123412
--resource-idy9h6rt
--http-methodGET
--status-code200
출력:
{ "responseModels": { "application/json": "Empty" }, "statusCode": "200" }
-
API 세부 정보는 AWS CLI 명령 참조의 GetMethodResponse
를 참조하세요.
-
다음 코드 예시에서는 get-method
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
REST API의 리소스에서 정의된 HTTP 메서드에 대한 메서드 리소스 구성을 가져오는 방법
명령:
aws apigateway get-method --rest-api-id
1234123412
--resource-idy9h6rt
--http-methodGET
출력:
{ "apiKeyRequired": false, "httpMethod": "GET", "methodIntegration": { "integrationResponses": { "200": { "responseTemplates": { "application/json": null }, "statusCode": "200" } }, "cacheKeyParameters": [], "uri": "arn:aws:apigateway:us-west-2:lambda:path/2015-03-31/functions/arn:aws:lambda:us-west-2:123412341234:function:My_Function/invocations", "httpMethod": "POST", "cacheNamespace": "y9h6rt", "type": "AWS" }, "requestParameters": {}, "methodResponses": { "200": { "responseModels": { "application/json": "Empty" }, "statusCode": "200" } }, "authorizationType": "NONE" }
-
API 세부 정보는 AWS CLI 명령 참조의 GetMethod
를 참조하세요.
-
다음 코드 예시에서는 get-model-template
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
REST API에서 정의된 모델에 대한 매핑 템플릿을 가져오는 방법
명령:
aws apigateway get-model-template --rest-api-id
1234123412
--model-nameEmpty
출력:
{ "value": "#set($inputRoot = $input.path('$'))\n{ }" }
-
API 세부 정보는 AWS CLI 명령 참조의 GetModelTemplate
을 참조하세요.
-
다음 코드 예시에서는 get-model
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
REST API에서 정의된 모델에 대한 구성을 가져오는 방법
명령:
aws apigateway get-model --rest-api-id
1234123412
--model-nameEmpty
출력:
{ "contentType": "application/json", "description": "This is a default empty schema model", "name": "Empty", "id": "etd5w5", "schema": "{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"title\" : \"Empty Schema\",\n \"type\" : \"object\"\n}" }
-
API 세부 정보는 AWS CLI 명령 참조의 GetModel
을 참조하세요.
-
다음 코드 예시에서는 get-models
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
REST API에 대한 모델의 목록을 가져오는 방법
명령:
aws apigateway get-models --rest-api-id
1234123412
출력:
{ "items": [ { "description": "This is a default error schema model", "schema": "{\n \"$schema\" : \"http://json-schema.org/draft-04/schema#\",\n \"title\" : \"Error Schema\",\n \"type\" : \"object\",\n \"properties\" : {\n \"message\" : { \"type\" : \"string\" }\n }\n}", "contentType": "application/json", "id": "7tpbze", "name": "Error" }, { "description": "This is a default empty schema model", "schema": "{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"title\" : \"Empty Schema\",\n \"type\" : \"object\"\n}", "contentType": "application/json", "id": "etd5w5", "name": "Empty" } ] }
-
API 세부 정보는 AWS CLI명령 참조의 GetModels
를 참조하세요.
-
다음 코드 예시에서는 get-resource
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
리소스에 대한 정보를 가져오는 방법
명령:
aws apigateway get-resource --rest-api-id
1234123412
--resource-idzwo0y3
출력:
{ "path": "/path", "pathPart": "path", "id": "zwo0y3", "parentId": "uyokt6ij2g" }
-
API 세부 정보는 AWS CLI 명령 참조의 GetResource
를 참조하세요.
-
다음 코드 예시에서는 get-resources
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
REST API에 사용할 리소스 목록을 가져오는 방법
명령:
aws apigateway get-resources --rest-api-id
1234123412
출력:
{ "items": [ { "path": "/resource/subresource", "resourceMethods": { "POST": {} }, "id": "024ace", "pathPart": "subresource", "parentId": "ai5b02" } ] }
-
API 세부 정보는 AWS CLI 명령 참조의 GetResources
를 참조하세요.
-
다음 코드 예시에서는 get-rest-api
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
API에 대한 정보를 가져오는 방법
명령:
aws apigateway get-rest-api --rest-api-id
1234123412
출력:
{ "name": "myAPI", "id": "o1y243m4f5", "createdDate": 1453416433 }
-
API 세부 정보는 AWS CLI 명령 참조의 GetRestApi
를 참조하세요.
-
다음 코드 예시에서는 get-rest-apis
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
REST API 목록을 가져오는 방법
명령:
aws apigateway get-rest-apis
출력:
{ "items": [ { "createdDate": 1438884790, "id": "12s44z21rb", "name": "My First API" } ] }
-
API 세부 정보는 AWS CLI 명령 참조의 GetRestApis
를 참조하세요.
-
다음 코드 예시에서는 get-sdk
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
REST API 스테이지에 대한 Android SDK를 가져오는 방법
명령:
aws apigateway get-sdk --rest-api-id
1234123412
--stage-namedev
--sdk-typeandroid
--parameters groupId='com.mycompany',invokerPackage='com.mycompany.clientsdk',artifactId='Mycompany-client',artifactVersion='1.0.0'/path/to/android_sdk.zip
출력:
{ "contentType": "application/octet-stream", "contentDisposition": "attachment; filename=\"android_2016-02-22_23-52Z.zip\"" }
REST API 스테이지에 대한 IOS SDK를 가져오는 방법
명령:
aws apigateway get-sdk --rest-api-id
1234123412
--stage-namedev
--sdk-typeobjectivec
--parameters classPrefix='myprefix'/path/to/iOS_sdk.zip
출력:
{ "contentType": "application/octet-stream", "contentDisposition": "attachment; filename=\"objectivec_2016-02-22_23-52Z.zip\"" }
REST API 스테이지에 대한 Javascript SDK를 가져오는 방법
명령:
aws apigateway get-sdk --rest-api-id
1234123412
--stage-namedev
--sdk-typejavascript
/path/to/javascript_sdk.zip
출력:
{ "contentType": "application/octet-stream", "contentDisposition": "attachment; filename=\"javascript_2016-02-22_23-52Z.zip\"" }
-
API 세부 정보는 AWS CLI 명령 참조의 GetSdk
를 참조하세요.
-
다음 코드 예시에서는 get-stage
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
API의 스테이지에 대한 정보를 가져오는 방법
명령:
aws apigateway get-stage --rest-api-id
1234123412
--stage-namedev
출력:
{ "stageName": "dev", "cacheClusterSize": "0.5", "cacheClusterEnabled": false, "cacheClusterStatus": "NOT_AVAILABLE", "deploymentId": "rbh1fj", "lastUpdatedDate": 1466802961, "createdDate": 1460682074, "methodSettings": { "*/*": { "cacheTtlInSeconds": 300, "loggingLevel": "INFO", "dataTraceEnabled": false, "metricsEnabled": true, "unauthorizedCacheControlHeaderStrategy": "SUCCEED_WITH_RESPONSE_HEADER", "throttlingRateLimit": 500.0, "cacheDataEncrypted": false, "cachingEnabled": false, "throttlingBurstLimit": 1000, "requireAuthorizationForCacheControl": true }, "~1resource/GET": { "cacheTtlInSeconds": 300, "loggingLevel": "INFO", "dataTraceEnabled": false, "metricsEnabled": true, "unauthorizedCacheControlHeaderStrategy": "SUCCEED_WITH_RESPONSE_HEADER", "throttlingRateLimit": 500.0, "cacheDataEncrypted": false, "cachingEnabled": false, "throttlingBurstLimit": 1000, "requireAuthorizationForCacheControl": true } } }
-
API 세부 정보는 AWS CLI 명령 참조의 GetStage
를 참조하세요.
-
다음 코드 예시에서는 get-stages
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
REST API에 대한 스테이지의 목록을 가져오는 방법
명령:
aws apigateway get-stages --rest-api-id
1234123412
출력:
{ "item": [ { "stageName": "dev", "cacheClusterSize": "0.5", "cacheClusterEnabled": true, "cacheClusterStatus": "AVAILABLE", "deploymentId": "123h64", "lastUpdatedDate": 1456185138, "createdDate": 1453589092, "methodSettings": { "~1resource~1subresource/POST": { "cacheTtlInSeconds": 300, "loggingLevel": "INFO", "dataTraceEnabled": true, "metricsEnabled": true, "throttlingRateLimit": 500.0, "cacheDataEncrypted": false, "cachingEnabled": false, "throttlingBurstLimit": 1000 } } } ] }
-
API 세부 정보는 AWS CLI 명령 참조의 GetStages
를 참조하세요.
-
다음 코드 예시에서는 get-usage-plan-key
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
사용 계획과 연결된 API 키의 세부 정보를 가져오는 방법
명령:
aws apigateway get-usage-plan-key --usage-plan-id
a1b2c3
--key-id1NbjQzMReAkeEQPNAW8r3dXsU2rDD7fc7f2Sipnu
-
API 세부 정보는 AWS CLI 명령 참조의 GetUsagePlanKey
를 참조하세요.
-
다음 코드 예시에서는 get-usage-plan-keys
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
사용 계획과 연결된 API 키의 목록을 가져오는 방법
명령:
aws apigateway get-usage-plan-keys --usage-plan-id
a1b2c3
-
API 세부 정보는 AWS CLI 명령 참조의 GetUsagePlanKeys
를 참조하세요.
-
다음 코드 예시에서는 get-usage-plan
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
사용 계획의 세부 정보를 가져오는 방법
명령:
aws apigateway get-usage-plan --usage-plan-id
a1b2c3
-
API 세부 정보는 AWS CLI 명령 참조의 GetUsagePlan
을 참조하세요.
-
다음 코드 예시에서는 get-usage-plans
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
모든 사용 계획의 세부 정보를 가져오는 방법
명령:
aws apigateway get-usage-plans
-
API 세부 정보는 AWS CLI 명령 참조의 GetUsagePlans
를 참조하세요.
-
다음 코드 예시에서는 get-usage
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
사용 계획에 대한 사용 세부 정보를 가져오는 방법
명령:
aws apigateway get-usage --usage-plan-id
a1b2c3
--start-date"2016-08-16"
--end-date"2016-08-17"
-
API 세부 정보는 AWS CLI 명령 참조의 GetUsage
를 참조하세요.
-
다음 코드 예시에서는 import-rest-api
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
Swagger 템플릿을 가져오고 API를 생성하는 방법
명령:
aws apigateway import-rest-api --body '
file:///path/to/API_Swagger_template.json
'-
API 세부 정보는 AWS CLI 명령 참조의 ImportRestApi
를 참조하세요.
-
다음 코드 예시에서는 put-integration-response
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
정의된 매핑 템플릿을 사용하여 통합 응답을 기본 응답으로 생성하는 방법
명령:
aws apigateway put-integration-response --rest-api-id
1234123412
--resource-ida1b2c3
--http-methodGET
--status-code200
--selection-pattern "" --response-templates '{"application/json": "{\"json\": \"template\"}"}
'정규식이 400이고 헤더 값이 정적으로 정의된 통합 응답을 생성하는 방법
명령:
aws apigateway put-integration-response --rest-api-id
1234123412
--resource-ida1b2c3
--http-methodGET
--status-code400
--selection-pattern400
--response-parameters '{"method.response.header.custom-header": "'"'"'custom-value'"'"'"}'-
API 세부 정보는 AWS CLI 명령 참조의 PutIntegrationResponse
를 참조하세요.
-
다음 코드 예시에서는 put-integration
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
모의 통합 요청을 생성하는 방법
명령:
aws apigateway put-integration --rest-api-id
1234123412
--resource-ida1b2c3
--http-methodGET
--typeMOCK
--request-templates '{ "application/json": "{\"statusCode\": 200}" }
'HTTP 통합 요청을 생성하는 방법
명령:
aws apigateway put-integration --rest-api-id
1234123412
--resource-ida1b2c3
--http-methodGET
--typeHTTP
--integration-http-methodGET
--uri 'https://domain.tld/path
'Lambda 함수 엔드포인트를 사용하여 AWS 통합 요청을 생성하는 방법
명령:
aws apigateway put-integration --rest-api-id
1234123412
--resource-ida1b2c3
--http-methodGET
--typeAWS
--integration-http-methodPOST
--uri 'arn:aws:apigateway:us-west-2:lambda:path/2015-03-31/functions/arn:aws:lambda:us-west-2:123412341234:function:function_name/invocations
'-
API 세부 정보는 AWS CLI 명령 참조의 PutIntegration
을 참조하세요.
-
다음 코드 예시에서는 put-method-response
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
사용자 지정 메서드 응답 헤더를 사용하여 지정된 상태 코드에서 메서드 응답을 생성하는 방법
명령:
aws apigateway put-method-response --rest-api-id
1234123412
--resource-ida1b2c3
--http-methodGET
--status-code400
--response-parameters"method.response.header.custom-header=false"
-
API 세부 정보는 AWS CLI 명령 참조의 PutMethodResponse
를 참조하세요.
-
다음 코드 예시에서는 put-method
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
권한 부여, API 키 및 사용자 지정 메서드 요청 헤더가 없는 API의 리소스에 대한 메서드를 생성하는 방법
명령:
aws apigateway put-method --rest-api-id
1234123412
--resource-ida1b2c3
--http-methodPUT
--authorization-type"NONE"
--no-api-key-required --request-parameters"method.request.header.custom-header=false"
-
API 세부 정보는 AWS CLI 명령 참조의 PutMethod
를 참조하세요.
-
다음 코드 예시에서는 put-rest-api
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
Swagger 템플릿을 사용하여 기존 API를 덮어쓰는 방법
명령:
aws apigateway put-rest-api --rest-api-id
1234123412
--modeoverwrite
--body 'fileb:///path/to/API_Swagger_template.json
'Swagger 템플릿을 기존 API에 병합하는 방법
명령:
aws apigateway put-rest-api --rest-api-id
1234123412
--modemerge
--body 'fileb:///path/to/API_Swagger_template.json
'-
API 세부 정보는 AWS CLI 명령 참조의 PutRestApi
를 참조하세요.
-
다음 코드 예시에서는 reject-domain-name-access-association
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
도메인 이름 액세스 연결을 거부하려면
다음
reject-domain-name-access-association
예제에서는 프라이빗 사용자 지정 도메인 이름과 VPC 엔드포인트 간의 도메인 이름 액세스 연결을 거부합니다.aws apigateway reject-domain-name-access-association \ --domain-name-access-association-arn
arn:aws:apigateway:us-west-2:012345678910:/domainnameaccessassociations/domainname/my.private.domain.tld/vpcesource/vpce-abcd1234efg
\ --domain-name-arnarn:aws:apigateway:us-east-1:012345678910:/domainnames/my.private.domain.tld+abcd1234
이 명령은 출력을 생성하지 않습니다.
자세한 내용은 Amazon API Gateway 개발자 안내서의 API Gateway에서 프라이빗 API에 대한 사용자 지정 도메인 이름을 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 RejectDomainNameAccessAssociation
섹션을 참조하세요.
-
다음 코드 예시에서는 test-invoke-authorizer
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
사용자 지정 권한 부여자에게 필수 헤더 및 값을 포함하여 보내는 요청의 호출을 테스트하는 방법
명령:
aws apigateway test-invoke-authorizer --rest-api-id
1234123412
--authorizer-id5yid1t
--headers Authorization='Value'-
API 세부 정보는 AWS CLI 명령 참조의 TestInvokeAuthorizer
를 참조하세요.
-
다음 코드 예시에서는 test-invoke-method
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
GET 요청을 수행하여 API에서 루트 리소스의 호출을 테스트하는 방법
명령:
aws apigateway test-invoke-method --rest-api-id
1234123412
--resource-idavl5sg8fw8
--http-methodGET
--path-with-query-string '/
'경로 파라미터 값이 지정된 GET 요청을 수행하여 API에서 하위 리소스의 호출을 테스트하는 방법
명령:
aws apigateway test-invoke-method --rest-api-id
1234123412
--resource-id3gapai
--http-methodGET
--path-with-query-string '/pets/1
'-
API 세부 정보는 AWS CLI 명령 참조의 TestInvokeMethod
를 참조하세요.
-
다음 코드 예시에서는 update-account
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
CloudWatch 로그에 로깅하는 IAM 역할 ARN을 변경하는 방법
명령:
aws apigateway update-account --patch-operations op='replace',path='/cloudwatchRoleArn',value='arn:aws:iam::123412341234:role/APIGatewayToCloudWatchLogs'
출력:
{ "cloudwatchRoleArn": "arn:aws:iam::123412341234:role/APIGatewayToCloudWatchLogs", "throttleSettings": { "rateLimit": 1000.0, "burstLimit": 2000 } }
-
API 세부 정보는 AWS CLI 명령 참조의 UpdateAccount
를 참조하세요.
-
다음 코드 예시에서는 update-api-key
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
API 키의 이름을 변경하는 방법
명령:
aws apigateway update-api-key --api-key
sNvjQDMReA1eEQPNAW8r37XsU2rDD7fc7m2SiMnu
--patch-operations op='replace',path='/name',value='newName'출력:
{ "description": "currentDescription", "enabled": true, "stageKeys": [ "41t2j324r5/dev" ], "lastUpdatedDate": 1470086052, "createdDate": 1445460347, "id": "sNvjQDMReA1vEQPNzW8r3dXsU2rrD7fcjm2SiMnu", "name": "newName" }
API 키를 비활성화하는 방법
명령:
aws apigateway update-api-key --api-key
sNvjQDMReA1eEQPNAW8r37XsU2rDD7fc7m2SiMnu
--patch-operations op='replace',path='/enabled',value='false'출력:
{ "description": "currentDescription", "enabled": false, "stageKeys": [ "41t2j324r5/dev" ], "lastUpdatedDate": 1470086052, "createdDate": 1445460347, "id": "sNvjQDMReA1vEQPNzW8r3dXsU2rrD7fcjm2SiMnu", "name": "newName" }
-
API 세부 정보는 AWS CLI 명령 참조의 UpdateApiKey
를 참조하세요.
-
다음 코드 예시에서는 update-authorizer
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
사용자 지정 권한 부여자의 이름을 변경하는 방법
명령:
aws apigateway update-authorizer --rest-api-id
1234123412
--authorizer-idgfi4n3
--patch-operations op='replace',path='/name',value='testAuthorizer'출력:
{ "authType": "custom", "name": "testAuthorizer", "authorizerUri": "arn:aws:apigateway:us-west-2:lambda:path/2015-03-31/functions/arn:aws:lambda:us-west-2:123412341234:function:customAuthorizer/invocations", "authorizerResultTtlInSeconds": 300, "identitySource": "method.request.header.Authorization", "type": "TOKEN", "id": "gfi4n3" }
사용자 지정 권한 부여자가 호출하는 Lambda 함수를 변경하는 방법
명령:
aws apigateway update-authorizer --rest-api-id
1234123412
--authorizer-idgfi4n3
--patch-operations op='replace',path='/authorizerUri',value='arn:aws:apigateway:us-west-2:lambda:path/2015-03-31/functions/arn:aws:lambda:us-west-2:123412341234:function:newAuthorizer/invocations'출력:
{ "authType": "custom", "name": "testAuthorizer", "authorizerUri": "arn:aws:apigateway:us-west-2:lambda:path/2015-03-31/functions/arn:aws:lambda:us-west-2:123412341234:function:newAuthorizer/invocations", "authorizerResultTtlInSeconds": 300, "identitySource": "method.request.header.Authorization", "type": "TOKEN", "id": "gfi4n3" }
-
API 세부 정보는 AWS CLI 명령 참조의 UpdateAuthorizer
를 참조하세요.
-
다음 코드 예시에서는 update-base-path-mapping
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
사용자 지정 도메인 이름의 기본 경로를 변경하는 방법
명령:
aws apigateway update-base-path-mapping --domain-name
api.domain.tld
--base-pathprod
--patch-operations op='replace',path='/basePath',value='v1'출력:
{ "basePath": "v1", "restApiId": "1234123412", "stage": "api" }
-
API 세부 정보는 AWS CLI 명령 참조의 UpdateBasePathMapping
을 참조하세요.
-
다음 코드 예시에서는 update-client-certificate
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
클라이언트 인증서의 설명을 업데이트하는 방법
명령:
aws apigateway update-client-certificate --client-certificate-id
a1b2c3
--patch-operations op='replace',path='/description',value='My new description'-
API 세부 정보는 AWS CLI 명령 참조의 UpdateClientCertificate
를 참조하세요.
-
다음 코드 예시에서는 update-deployment
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
배포의 설명을 변경하는 방법
명령:
aws apigateway update-deployment --rest-api-id
1234123412
--deployment-idztt4m2
--patch-operations op='replace',path='/description',value='newDescription'출력:
{ "description": "newDescription", "id": "ztt4m2", "createdDate": 1455218022 }
-
API 세부 정보는 AWS CLI 명령 참조의 UpdateDeployment
를 참조하세요.
-
다음 코드 예시에서는 update-domain-name
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
사용자 지정 도메인 이름에 대한 인증서 이름을 변경하는 방법
다음
update-domain-name
예제에서는 사용자 지정 도메인에 대한 인증서 이름을 변경합니다.aws apigateway update-domain-name \ --domain-name
api.domain.tld
\ --patch-operations op='replace',path='/certificateArn',value='arn:aws:acm:us-west-2:111122223333:certificate/CERTEXAMPLE123EXAMPLE'출력:
{ "domainName": "api.domain.tld", "distributionDomainName": "d123456789012.cloudfront.net", "certificateArn": "arn:aws:acm:us-west-2:111122223333:certificate/CERTEXAMPLE123EXAMPLE", "certificateUploadDate": 1462565487 }
자세한 내용은 Amazon API Gateway 개발자 안내서의 API Gateway에서 API에 대한 사용자 지정 도메인 이름 설정을 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 UpdateDomainName
을 참조하세요.
-
다음 코드 예시에서는 update-integration-response
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
'*' 정적 매핑을 사용하도록 통합 응답 헤더를 변경하는 방법
명령:
aws apigateway update-integration-response --rest-api-id
1234123412
--resource-id3gapai
--http-methodGET
--status-code200
--patch-operations op='replace',path='/responseParameters/method.response.header.Access-Control-Allow-Origin',value='"'"'*'"'"'출력:
{ "statusCode": "200", "responseParameters": { "method.response.header.Access-Control-Allow-Origin": "'*'" } }
통합 응답 헤더를 제거하는 방법
명령:
aws apigateway update-integration-response --rest-api-id
1234123412
--resource-id3gapai
--http-methodGET
--status-code200
--patch-operations op='remove',path='/responseParameters/method.response.header.Access-Control-Allow-Origin'-
API 세부 정보는 AWS CLI 명령 참조의 UpdateIntegrationResponse
을 참조하세요.
-
다음 코드 예시에서는 update-integration
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
Input Passthrough로 구성된 'Content-Type: application/json' 매핑 템플릿을 추가하는 방법
명령:
aws apigateway update-integration \ --rest-api-id
a1b2c3d4e5
\ --resource-ida1b2c3
\ --http-methodPOST
\ --patch-operations"op='add',path='/requestTemplates/application~1json'"
사용자 지정 템플릿으로 구성된 'Content-Type: application/json' 매핑 템플릿을 업데이트(교체)하는 방법
명령:
aws apigateway update-integration \ --rest-api-id
a1b2c3d4e5
\ --resource-ida1b2c3
\ --http-methodPOST
\ --patch-operations "op='replace',path='/requestTemplates/application~1json',value='{"example": "json"}'"Input Passthrough가 있는 'Content-Type: application/json'과 연결된 사용자 지정 템플릿을 업데이트(교체)하는 방법
명령:
aws apigateway update-integration \ --rest-api-id
a1b2c3d4e5
\ --resource-ida1b2c3
\ --http-methodPOST
\ --patch-operations"op='replace',path='requestTemplates/application~1json'"
'Content-Type: application/json' 매핑 템플릿을 제거하는 방법
명령:
aws apigateway update-integration \ --rest-api-id
a1b2c3d4e5
\ --resource-ida1b2c3
\ --http-methodPOST
\ --patch-operations"op='remove',path='/requestTemplates/application~1json'"
-
API 세부 정보는 AWS CLI 명령 참조의 UpdateIntegration
을 참조하세요.
-
다음 코드 예시에서는 update-method-response
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
메서드에서 200 응답에 대한 새 메서드 응답 헤더를 생성하고 이를 필요 없음(기본값)으로 정의하는 방법
명령:
aws apigateway update-method-response --rest-api-id
1234123412
--resource-ida1b2c3
--http-methodGET
--status-code200
--patch-operations op="add",path="/responseParameters/method.response.header.custom-header",value="false"메서드에서 200 응답에 대한 응답 모델을 삭제하는 방법
명령:
aws apigateway update-method-response --rest-api-id
1234123412
--resource-ida1b2c3
--http-methodGET
--status-code200
--patch-operations op="remove",path="/responseModels/application~1json"-
API 세부 정보는 AWS CLI 명령 참조의 UpdateMethodResponse
를 참조하세요.
-
다음 코드 예시에서는 update-method
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
예제 1: API 키를 요구하도록 메서드를 수정하는 방법
다음
update-method
예제에서는 API 키를 요구하도록 메서드를 수정합니다.aws apigateway update-method \ --rest-api-id
1234123412
\ --resource-ida1b2c3
\ --http-methodGET
\ --patch-operations op="replace",path="/apiKeyRequired",value="true"출력:
{ "httpMethod": "GET", "authorizationType": "NONE", "apiKeyRequired": true, "methodResponses": { "200": { "statusCode": "200", "responseModels": {} } }, "methodIntegration": { "type": "AWS", "httpMethod": "POST", "uri": "arn:aws:apigateway:us-east-1:lambda:path/2015-03-31/functions/arn:aws:lambda:us-east-1:123456789111:function:hello-world/invocations", "passthroughBehavior": "WHEN_NO_MATCH", "contentHandling": "CONVERT_TO_TEXT", "timeoutInMillis": 29000, "cacheNamespace": "h7i8j9", "cacheKeyParameters": [], "integrationResponses": { "200": { "statusCode": "200", "responseTemplates": {} } } } }
예제 2: IAM 권한 부여를 요구하도록 메서드를 수정하는 방법
다음
update-method
예제에서는 IAM 권한 부여를 요구하도록 메서드를 수정합니다.aws apigateway update-method \ --rest-api-id
1234123412
\ --resource-ida1b2c3
\ --http-methodGET
\ --patch-operations op="replace",path="/authorizationType",value="AWS_IAM"출력:
{ "httpMethod": "GET", "authorizationType": "AWS_IAM", "apiKeyRequired": false, "methodResponses": { "200": { "statusCode": "200", "responseModels": {} } }, "methodIntegration": { "type": "AWS", "httpMethod": "POST", "uri": "arn:aws:apigateway:us-east-1:lambda:path/2015-03-31/functions/arn:aws:lambda:us-east-1:123456789111:function:hello-world/invocations", "passthroughBehavior": "WHEN_NO_MATCH", "contentHandling": "CONVERT_TO_TEXT", "timeoutInMillis": 29000, "cacheNamespace": "h7i8j9", "cacheKeyParameters": [], "integrationResponses": { "200": { "statusCode": "200", "responseTemplates": {} } } } }
예제 3: Lambda 권한 부여를 요구하도록 메서드를 수정하는 방법
다음
update-method
예제에서는 Lambda 권한 부여를 요구하도록 메서드를 수정합니다.aws apigateway update-method --rest-api-id
1234123412
\ --resource-ida1b2c3
\ --http-methodGET
\ --patch-operations op="replace",path="/authorizationType",value="CUSTOM" op="replace",path="/authorizerId",value="e4f5g6"출력:
{ "httpMethod": "GET", "authorizationType": "CUSTOM", "authorizerId" : "e4f5g6", "apiKeyRequired": false, "methodResponses": { "200": { "statusCode": "200", "responseModels": {} } }, "methodIntegration": { "type": "AWS", "httpMethod": "POST", "uri": "arn:aws:apigateway:us-east-1:lambda:path/2015-03-31/functions/arn:aws:lambda:us-east-1:123456789111:function:hello-world/invocations", "passthroughBehavior": "WHEN_NO_MATCH", "contentHandling": "CONVERT_TO_TEXT", "timeoutInMillis": 29000, "cacheNamespace": "h7i8j9", "cacheKeyParameters": [], "integrationResponses": { "200": { "statusCode": "200", "responseTemplates": {} } } } }
자세한 내용은 Amazon API Gateway 개발자 안내서의 API Gateway CLI 및 REST API를 사용하여 사용 계획 생성, 구성 및 테스트와 API Gateway에서 REST API에 대한 액세스 제어 및 관리를 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 UpdateMethod
를 참조하세요.
-
다음 코드 예시에서는 update-model
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
API에서 모델의 설명을 변경하는 방법
명령:
aws apigateway update-model --rest-api-id
1234123412
--model-name 'Empty
' --patch-operations op=replace,path=/description,value='New Description'API에서 모델의 스키마를 변경하는 방법
명령:
aws apigateway update-model --rest-api-id
1234123412
--model-name 'Empty
' --patch-operations op=replace,path=/schema,value='"{ \"$schema\": \"http://json-schema.org/draft-04/schema#\", \"title\" : \"Empty Schema\", \"type\" : \"object\" }"'-
API 세부 정보는 AWS CLI 명령 참조의 UpdateModel
을 참조하세요.
-
다음 코드 예시에서는 update-resource
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
API에서 리소스를 이동하고 이를 다른 상위 리소스에 배치하는 방법
명령:
aws apigateway update-resource --rest-api-id
1234123412
--resource-id1a2b3c
--patch-operations op=replace,path=/parentId,value='3c2b1a'출력:
{ "path": "/resource", "pathPart": "resource", "id": "1a2b3c", "parentId": "3c2b1a" }
API에서 리소스(pathPart)의 이름을 바꾸는 방법
명령:
aws apigateway update-resource --rest-api-id
1234123412
--resource-id1a2b3c
--patch-operationsop=replace,path=/pathPart,value=newresourcename
출력:
{ "path": "/newresourcename", "pathPart": "newresourcename", "id": "1a2b3c", "parentId": "3c2b1a" }
-
API 세부 정보는 AWS CLI 명령 참조의 UpdateResource
를 참조하세요.
-
다음 코드 예시에서는 update-rest-api
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
API의 이름을 변경하는 방법
명령:
aws apigateway update-rest-api --rest-api-id
1234123412
--patch-operations op=replace,path=/name,value='New Name'API의 설명을 변경하는 방법
명령:
aws apigateway update-rest-api --rest-api-id
1234123412
--patch-operations op=replace,path=/description,value='New Description'-
API 세부 정보는 AWS CLI 명령 참조의 UpdateRestApi
를 참조하세요.
-
다음 코드 예시에서는 update-stage
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
예제 1: 리소스 및 메서드에 대한 스테이지 설정을 재정의하는 방법
다음
update-stage
예제에서는 특정 리소스 및 메서드에 대한 스테이지 설정을 재정의하고 전체 요청/응답 로깅을 끕니다.aws apigateway update-stage \ --rest-api-id
1234123412
\ --stage-name 'dev
' \ --patch-operationsop=replace,path=/~1resourceName/GET/logging/dataTrace,value=false
출력:
{ "deploymentId": "5ubd17", "stageName": "dev", "cacheClusterEnabled": false, "cacheClusterStatus": "NOT_AVAILABLE", "methodSettings": { "~1resourceName/GET": { "metricsEnabled": false, "dataTraceEnabled": false, "throttlingBurstLimit": 5000, "throttlingRateLimit": 10000.0, "cachingEnabled": false, "cacheTtlInSeconds": 300, "cacheDataEncrypted": false, "requireAuthorizationForCacheControl": true, "unauthorizedCacheControlHeaderStrategy": "SUCCEED_WITH_RESPONSE_HEADER" } }, "tracingEnabled": false, "createdDate": "2022-07-18T10:11:18-07:00", "lastUpdatedDate": "2022-07-18T10:19:04-07:00" }
자세한 내용은 Amazon API Gateway 개발자 안내서의 REST API에 대한 스테이지 설정을 참조하세요.
예제 2: API 스테이지의 모든 리소스 및 메서드에 대한 스테이지 설정을 업데이트하는 방법
다음
update-stage
예제에서는 API 스테이지의 모든 리소스 및 메서드에 대한 전체 요청/응답 로깅을 켭니다.aws apigateway update-stage \ --rest-api-id
1234123412
\ --stage-name 'dev
' \ --patch-operations 'op=replace,path=/*/*/logging/dataTrace,value=true
'출력:
{ "deploymentId": "5ubd17", "stageName": "dev", "cacheClusterEnabled": false, "cacheClusterStatus": "NOT_AVAILABLE", "methodSettings": { "*/*": { "metricsEnabled": false, "dataTraceEnabled": true, "throttlingBurstLimit": 5000, "throttlingRateLimit": 10000.0, "cachingEnabled": false, "cacheTtlInSeconds": 300, "cacheDataEncrypted": false, "requireAuthorizationForCacheControl": true, "unauthorizedCacheControlHeaderStrategy": "SUCCEED_WITH_RESPONSE_HEADER" } }, "tracingEnabled": false, "createdDate": "2022-07-18T10:11:18-07:00", "lastUpdatedDate": "2022-07-18T10:31:04-07:00" }
자세한 내용은 Amazon API Gateway 개발자 안내서의 REST API에 대한 스테이지 설정을 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 UpdateStage
를 참조하세요.
-
다음 코드 예시에서는 update-usage-plan
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
사용 계획에서 정의된 기간을 변경하는 방법
명령:
aws apigateway update-usage-plan --usage-plan-id
a1b2c3
--patch-operations op="replace",path="/quota/period",value="MONTH"사용 계획에서 정의된 할당량 제한을 변경하는 방법
명령:
aws apigateway update-usage-plan --usage-plan-id
a1b2c3
--patch-operations op="replace",path="/quota/limit",value="500"사용 계획에서 정의된 스로틀 요율 제한을 변경하는 방법
명령:
aws apigateway update-usage-plan --usage-plan-id
a1b2c3
--patch-operations op="replace",path="/throttle/rateLimit",value="10"사용 계획에서 정의된 스로틀 버스트 제한을 변경하는 방법
명령:
aws apigateway update-usage-plan --usage-plan-id
a1b2c3
--patch-operations op="replace",path="/throttle/burstLimit",value="20"-
API 세부 정보는 AWS CLI 명령 참조의 UpdateUsagePlan
을 참조하세요.
-
다음 코드 예시에서는 update-usage
을 사용하는 방법을 보여 줍니다.
- AWS CLI
-
사용 계획에서 정의된 현재 기간에 대해 API 키의 할당량을 일시적으로 수정하는 방법
명령:
aws apigateway update-usage --usage-plan-id
a1b2c3
--key-id1NbjQzMReAkeEQPNAW8r3dXsU2rDD7fc7f2Sipnu
--patch-operations op="replace",path="/remaining",value="50"-
API 세부 정보는 AWS CLI 명령 참조의 UpdateUsage
를 참조하세요.
-