AWSOpenAPI 가져오기를 위한 변수 - Amazon API Gateway

기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.

AWSOpenAPI 가져오기를 위한 변수

OpenAPI 정의에서 다음 AWS 변수를 사용할 수 있습니다. API Gateway는 API를 가져올 때 변수를 확인합니다. 변수를 지정하려면 ${variable-name}을 사용합니다.

AWS 변수
변수 이름 설명
AWS::AccountId API를 가져오는 AWS 계정 ID입니다(예: 123456789012).
AWS::Partition API를 가져올 AWS 파티션입니다. 표준 AWS 리전에서 파티션은 aws입니다.
AWS::Region API를 가져오는 AWS 리전(예: us-east-2)입니다.

AWS 변수 예제

다음 예제에서는 AWS 변수를 사용하여 통합에 대한 AWS Lambda 함수를 지정합니다.

OpenAPI 3.0
openapi: "3.0.1" info: title: "tasks-api" version: "v1.0" paths: /: get: summary: List tasks description: Returns a list of tasks responses: 200: description: "OK" content: application/json: schema: type: array items: $ref: "#/components/schemas/Task" 500: description: "Internal Server Error" content: {} x-amazon-apigateway-integration: uri: arn:${AWS::Partition}:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/arn:${AWS::Partition}:lambda:${AWS::Region}:${AWS::AccountId}:function:LambdaFunctionName/invocations responses: default: statusCode: "200" passthroughBehavior: "when_no_match" httpMethod: "POST" contentHandling: "CONVERT_TO_TEXT" type: "aws_proxy" components: schemas: Task: type: object properties: id: type: integer name: type: string description: type: string