Q56. API Gateway와 Route 53을 활용한 안전한 마이크로서비스 API 구축하기

AWS 자격증을 준비하는 여러분, 안녕하세요. 오늘은 API Gateway와 Route 53을 활용하여 안전하고 사용자 친화적인 마이크로서비스 API를 구축하는 방법에 대해 알아보겠습니다. 이 문제를 통해 API Gateway, Route 53, AWS Certificate Manager(ACM)의 주요 개념과 이들을 연계하여 사용하는 방법을 학습할 수 있습니다.

문제 상황

Q1:
회사는 Amazon Route 53에 도메인 이름을 등록했습니다. 이 회사는 ca-central-1 리전의 Amazon API Gateway를 백엔드 마이크로서비스 API의 공용 인터페이스로 사용합니다. 타사 서비스는 API를 안전하게 사용합니다. 회사는 타사 서비스에서 HTTPS를 사용할 수 있도록 회사의 도메인 이름 및 해당 인증서로 API 게이트웨이 URL을 설계하려고 합니다. 어떤 솔루션이 이러한 요구 사항을 충족합니까?

<small>A company has registered a domain name with Amazon Route 53. The company uses Amazon API Gateway in the ca-central-1 Region as the public interface for backend microservice APIs. Third-party services consume the APIs securely. The company wants to design the API Gateway URL with the company's domain name and matching certificate to allow HTTPS access from the third-party services. Which solution will meet these requirements?</small>

선택지

A. API Gateway에서 Name="Endpoint-URL" 및 Value="Company Domain Name"으로 단계 변수를 생성하여 기본 URL을 덮어씁니다. 회사의 도메인 이름과 연결된 공인 인증서를 AWS Certificate Manager(ACM)로 가져옵니다.

<small>Create a stage variable in API Gateway with Name="Endpoint-URL" and Value="Company Domain Name" to override the default URL. Import a public certificate that is associated with the company's domain name into AWS Certificate Manager (ACM).</small>

B. 회사의 도메인 이름으로 Route 53 DNS 레코드를 생성합니다. 별칭 레코드가 리전 API 게이트웨이 단계 엔드포인트를 가리키도록 합니다. 회사의 도메인 이름과 연결된 공인 인증서를 us-east-1 리전의 AWS Certificate Manager(ACM)로 가져옵니다.

<small>Create a Route 53 DNS record with the company's domain name. Point the alias record to the regional API Gateway stage endpoint. Import a public certificate that is associated with the company's domain name into AWS Certificate Manager (ACM) in the us-east-1 Region.</small>

C. 리전 API 게이트웨이 엔드포인트를 생성합니다. API Gateway 엔드포인트를 회사의 도메인 이름과 연결합니다. 회사의 도메인 이름과 연결된 공인 인증서를 동일한 리전의 AWS Certificate Manager(ACM)로 가져옵니다. API Gateway 엔드포인트에 인증서를 연결합니다. API Gateway 엔드포인트로 트래픽을 라우팅하도록 Route 53을 구성합니다.

<small>Create a regional API Gateway endpoint. Associate the API Gateway endpoint with the company's domain name. Import a public certificate that is associated with the company's domain name into AWS Certificate Manager (ACM) in the same Region. Attach the certificate to the API Gateway endpoint. Configure Route 53 to route traffic to the API Gateway endpoint.</small>

D. 리전 API 게이트웨이 엔드포인트를 생성합니다. API Gateway 엔드포인트를 회사의 도메인 이름과 연결합니다. 회사의 도메인 이름과 연결된 공인 인증서를 us-east-1 리전의 AWS Certificate Manager(ACM)로 가져옵니다. API Gateway API에 인증서를 연결합니다. 회사의 도메인 이름으로 Route 53 DNS 레코드를 생성합니다. A 레코드가 회사의 도메인 이름을 가리키도록 합니다.

<small>Create a regional API Gateway endpoint. Associate the API Gateway endpoint with the company's domain name. Import a public certificate that is associated with the company's domain name into AWS Certificate Manager (ACM) in the us-east-1 Region. Attach the certificate to the API Gateway API. Create a Route 53 DNS record with the company's domain name. Point the A record to the company's domain name.</small>

정답 및 해설

정답은 C입니다.

<small>The correct answer is C.</small>

Amazon API Gateway를 사용하여 사용자 지정 도메인 이름으로 API를 설정하고 HTTPS를 통해 안전하게 액세스할 수 있도록 하려면 다음 단계를 따라야 합니다:

  1. 리전 API Gateway 엔드포인트 생성: 이는 특정 리전(이 경우 ca-central-1)에 API 엔드포인트를 설정합니다.

  2. API Gateway 엔드포인트를 회사의 도메인 이름과 연결: 이를 통해 회사의 도메인 이름을 API URL로 사용할 수 있습니다.

  3. 회사의 도메인 이름과 연결된 공인 인증서를 동일한 리전의 AWS Certificate Manager(ACM)로 가져오기: API Gateway의 리전 사용자 지정 도메인 이름은 API와 동일한 리전에 있는 SSL/TLS 인증서를 사용해야 합니다.

  4. API Gateway 엔드포인트에 인증서 연결: 이를 통해 HTTPS를 사용할 수 있습니다.

  5. Route 53 구성하여 API Gateway 엔드포인트로 트래픽 라우팅: 이렇게 하면 회사의 도메인 이름을 사용하여 API에 액세스할 수 있습니다.

이 접근 방식은 보안 HTTPS 액세스를 제공하고 회사의 도메인 이름을 사용하여 API에 액세스할 수 있게 해주므로 요구 사항을 충족합니다.

<small>To set up an API with a custom domain name using Amazon API Gateway and allow secure access via HTTPS, you need to follow these steps:

  1. Create a regional API Gateway endpoint: This sets up an API endpoint in a specific region (in this case, ca-central-1).

  2. Associate the API Gateway endpoint with the company's domain name: This allows the use of the company's domain name as the API URL.

  3. Import a public certificate associated with the company's domain name into AWS Certificate Manager (ACM) in the same region: Regional custom domain names in API Gateway must use an SSL/TLS certificate in the same AWS region as the API.

  4. Attach the certificate to the API Gateway endpoint: This enables the use of HTTPS.

  5. Configure Route 53 to route traffic to the API Gateway endpoint: This allows access to the API using the company's domain name.

This approach meets the requirements by providing secure HTTPS access and allowing the API to be accessed using the company's domain name.</small>

오답 설명

A. 단계 변수를 사용하여 기본 URL을 재정의하는 것은 사용자 지정 도메인 이름을 설정하는 올바른 방법이 아닙니다. 또한 이 옵션은 Route 53 구성에 대해 언급하지 않습니다.

<small>A. Using stage variables to override the default URL is not the correct way to set up a custom domain name. Also, this option doesn't mention configuring Route 53.</small>

B. 인증서를 us-east-1 리전으로 가져오는 것은 올바르지 않습니다. 리전 API Gateway 엔드포인트의 경우 인증서는 API와 동일한 리전(이 경우 ca-central-1)에 있어야 합니다.

<small>B. Importing the certificate into the us-east-1 region is incorrect. For regional API Gateway endpoints, the certificate should be in the same region as the API (ca-central-1 in this case).</small>

D. 이 옵션도 인증서를 잘못된 리전(us-east-1)으로 가져옵니다. 또한 A 레코드를 회사의 도메인 이름으로 지정하는 것은 의미가 없습니다.

<small>D. This option also imports the certificate into the wrong region (us-east-1). Additionally, pointing an A record to the company's domain name doesn't make sense.</small>

결론

이 문제는 API Gateway, Route 53, 그리고 AWS Certificate Manager를 사용하여 안전하고 사용자 지정된 API 엔드포인트를 설정하는 방법을 테스트합니다. 핵심 포인트는 다음과 같습니다:

  1. 리전 API Gateway 엔드포인트 사용
  2. 사용자 지정 도메인 이름 설정
  3. 올바른 리전에 SSL/TLS 인증서 배치
  4. Route 53을 사용한 DNS 구성

이러한 서비스들을 올바르게 구성하고 통합하는 것은 안전하고 확장 가능한 API 솔루션을 구축하는 데 중요합니다.

<small>This question tests your understanding of how to set up a secure and customized API endpoint using API Gateway, Route 53, and AWS Certificate Manager. Key points to remember are:

  1. Use of regional API Gateway endpoints
  2. Setting up custom domain names
  3. Proper placement of SSL/TLS certificates in the correct region
  4. DNS configuration using Route 53

Correctly configuring and integrating these services is crucial for building secure and scalable API solutions.</small>

원본 문제 링크

댓글

이 블로그의 인기 게시물

Anaconda-Python 환경 VSCode에서 사용하기

Python 웹 크롤링 - Scrapy 활용 파워볼 번호 수집(파일)