

# AWSOpenAPI 가져오기를 위한 변수
<a name="import-api-aws-variables"></a>

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 변수 예제
<a name="import-api-aws-variables-example"></a>

다음 예제에서는 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
```

------