AWS Cloudfront 에서 API Gateway Custom Domain Name Regional Endpoint로 연결 시, 기존 설정과 유의해야 될 사항이 있다.

 

 1. Cloudfront 의 Origin Domain Name을 CustomDomainName(regional) 의 Endpoint(***.excute-api.***)로 입력해야 한다.

 2. Behavior에서 Cache 정책에 Whitelist Header 를 추가해야 한다.

 3. 추가해야될 Header로는 Authorization(권한부여)와 Host 가 있다.

 4. 이 Header들을 Whitelist로 추가하면, Forbbiden이 더 이상 발생하지 않는 것을 알 수있다.

 

 참고 URL: 

 https://aws.amazon.com/ko/premiumsupport/knowledge-center/api-gateway-cloudfront-distribution/

 (사용자 지정 도메인 이름 또는 IAM 인증의 경우)