클라우드 프론트 어피가트웨이 - AWS 솔루션 구성체

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

클라우드 프론트 어피가트웨이

모든 클래스는 활발히 개발 중이며 향후 버전에서 이전 버전과 호환되지 않는 변경 또는 제거 될 수 있습니다. 이들은 적용되지 않습니다의미 체계 버전모델. 즉, 이 패키지를 사용할 수도 있지만 이 패키지의 최신 버전으로 업그레이드할 때 소스 코드를 업데이트해야 할 수도 있습니다.

참고: 적절한 기능을 보장하려면 프로젝트의 AWS 솔루션 구성 패키지와 AWS CDK 패키지가 동일한 버전이어야 합니다.

언어 패키지
Python
aws_solutions_constructs.aws_cloudfront_apigateway
타이프 스크립트
@aws-solutions-constructs/aws-cloudfront-apigateway
Java
software.amazon.awsconstructs.services.cloudfrontapigateway

Overview

이 AWS 솔루션 구성은 Amazon API 게이트웨이 REST API 앞에 Amazon CloudFront 배포를 구현합니다.

다음은 TypeScript 터의 최소 배포 가능한 패턴 정의입니다.

import * as api from '@aws-cdk/aws-apigateway'; import * as lambda from "@aws-cdk/aws-lambda"; import { CloudFrontToApiGateway } from '@aws-solutions-constructs/aws-cloudfront-apigateway'; const lambdaProps: lambda.FunctionProps = { code: lambda.Code.fromAsset(`${__dirname}/lambda`), runtime: lambda.Runtime.NODEJS_12_X, handler: 'index.handler' }; const lambdafunction = new lambda.Function(this, 'LambdaFunction', lambdaProps); const apiGatewayProps: api.LambdaRestApiProps = { handler: lambdafunction, endpointConfiguration: { types: [api.EndpointType.REGIONAL] }, defaultMethodOptions: { authorizationType: api.AuthorizationType.NONE } }; const apiGateway = new api.LambdaRestApi(this, 'LambdaRestApi', apiGatewayProps); new CloudFrontToApiGateway(this, 'test-cloudfront-apigateway', { existingApiGatewayObj: apiGateway });

Initializer

new CloudFrontToApiGateway(scope: Construct, id: string, props: CloudFrontToApiGatewayProps);

파라미터

소품 패턴 구성

이름 유형 설명
기존가피가테와요비 api.RestApi CloudFront 와 함께 선두될 지역별 API Gateway
클라우드프런트배포소품? cloudfront.DistributionProps 선택적 사용자가 CloudFront 배포에 대한 기본 소품을 재정의하는 소품을 제공했습니다.
보안 헤더를 삽입하시겠습니까? boolean CloudFront 모든 응답에서 모범 사례 HTTP 보안 헤더의 자동 삽입을 켜거나 끌 수 있는 선택적 사용자 제공 소품

패턴 속성

이름 유형 설명
ApigGateway api.RestApi 패턴에 의해 생성 된 API Gateway REST API의 인스턴스를 돌려줍니다.
클라우드 프론트로깅 버킷? s3.Bucket CloudFront 웹 배포의 패턴으로 생성된 로깅 버킷의 인스턴스를 반환합니다.
클라우드프런트웹배포 cloudfront.CloudFrontWebDistribution 패턴에 의해 생성된 CloudFront 웹 배포의 인스턴스를 반환합니다.
엣지람다기능 버전? lambda.Version 패턴에 의해 생성 된 Lambda edge 함수 버전의 인스턴스를 돌려줍니다.

기본 설정

재정의없이이 패턴을 즉시 구현하면 다음과 같은 기본값이 설정됩니다.

Amazon CloudFront

  • CloudFront 웹 배포에 대한 액세스 로깅 구성

  • CloudFront 웹 배포의 모든 응답에서 모범 사례 HTTP 보안 헤더의 자동 삽입 사용

Amazon API Gateway

  • 사용자 제공 API Gateway 객체는 그대로 사용됩니다.

  • X-Ray 추적 사용

Architecture

GitHub

이 패턴의 코드를 보려면 문제 및 끌어오기 요청을 작성/조회하는 등의 작업을 수행합니다.
@aws -솔루션 - 구조/AWS - 클라우드 프론트 어피 게이트 웨이