

# 엣지 최적화된 API를 API Gateway로 가져오기
<a name="import-edge-optimized-api"></a>

API OpenAPI 정의 파일을 가져와 `EDGE` 엔드포인트 유형을 OpenAPI 파일 외에 추가 입력으로 가져오기 작업에 지정함으로써 새로운 엣지 최적화 API를 생성할 수 있습니다. API Gateway 콘솔, AWS CLI 또는 AWS SDK를 사용하여 이를 수행할 수 있습니다.

API Gateway 콘솔에서 API 가져오기 기능을 사용하려면 [자습서: 예제를 가져와 REST API 생성](api-gateway-create-api-from-example.md)을 참조하세요.

**Topics**
+ [API Gateway 콘솔을 사용하여 엣지 최적화 API 가져오기](#import-edge-optimized-api-with-console)
+ [AWS CLI를 사용해 엣지 최적화 API 가져오기](#import-edge-optimized-api-with-awscli)

## API Gateway 콘솔을 사용하여 엣지 최적화 API 가져오기
<a name="import-edge-optimized-api-with-console"></a>

API Gateway 콘솔을 사용해 엣지 최적화 API 가져오려면 다음을 따릅니다.

1. [https://console.aws.amazon.com/apigateway](https://console.aws.amazon.com/apigateway)에서 API Gateway 콘솔에 로그인합니다.

1. **API 생성**을 선택합니다.

1. **REST API** 아래에서 **가져오기**를 선택합니다.

1.  API의 OpenAPI 정의를 복사하여 코드 편집기에 붙여넣거나 **파일 선택**을 선택하여 로컬 드라이브로부터 OpenAPI 파일을 로드합니다.

1.  **API 엔드포인트 유형**에서 **엣지 최적화**를 선택합니다.

1.  OpenAPI 정의를 가져오려면 **API 생성**을 선택합니다.

## AWS CLI를 사용해 엣지 최적화 API 가져오기
<a name="import-edge-optimized-api-with-awscli"></a>

다음 [import-rest-api](https://docs.aws.amazon.com/cli/latest/reference/apigateway/import-rest-api.html) 명령은 OpenAPI 정의 파일에서 API를 가져와 새로운 엣지 최적화 API를 생성합니다.

```
aws apigateway import-rest-api \
    --fail-on-warnings \
    --body 'file://path/to/API_OpenAPI_template.json'
```

또는 다음과 같이 `endpointConfigurationTypes`에 대한 `EDGE` 쿼리 문자열 파라미터의 명시적인 사양을 사용합니다.

```
aws apigateway import-rest-api \
    --parameters endpointConfigurationTypes=EDGE \
    --fail-on-warnings \
    --body 'file://path/to/API_OpenAPI_template.json'
```

