AWS Cloudfront到AWS API网关集成的CDK构造。

aws-solutions-constructs.aws-cloudfront-apigatewa的Python项目详细描述


aws cloudfront API网关模块

---

Stability: Experimental

All classes are under active development and subject to non-backward compatible changes or removal in any future version. These are not subject to the Semantic Versioning model. This means that while you may use them, you may need to update your source code when upgrading to a newer version of this package.


Reference Documentation:https://docs.aws.amazon.com/solutions/latest/constructs/
^{tb2}$

这个AWS解决方案构造实现了一个面向amazonapi网关restapi的awscloudfront。在

以下是Typescript中的最小可部署模式定义:

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

初始值设定项

^{pr2}$

参数

  • 范围^{}
  • 标识string
  • 道具^{}

构装道具

NameTypeDescription
existingApiGatewayObj^{}The regional API Gateway that will be fronted with the CloudFront
cloudFrontDistributionProps?[`cloudfront.CloudFrontWebDistributionPropsany`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-cloudfront.CloudFrontWebDistributionProps.html)
insertHttpSecurityHeaders?^{}Optional user provided props to turn on/off the automatic injection of best practice HTTP security headers in all responses from CloudFront

图案属性

NameTypeDescription
cloudFrontWebDistribution^{}Returns an instance of cloudfront.CloudFrontWebDistribution created by the construct
apiGateway^{}Returns an instance of the API Gateway REST API created by the pattern.
edgeLambdaFunctionVersion^{}Returns an instance of the edge Lambda function version created by the pattern.
cloudFrontLoggingBucket^{}Returns an instance of the logging bucket for CloudFront WebDistribution.

默认设置

没有任何重写的构件的现成实现将设置以下默认值:

亚马逊CloudFront

  • 配置CloudFront WebDistribution的访问日志记录
  • 在cloudfrontwebdistribution的所有响应中启用自动注入最佳实践HTTP安全标头

亚马逊API网关

  • 用户提供的API网关对象按原样使用
  • 启用X射线跟踪

建筑

Architecture Diagram


©版权所有2020亚马逊网站,Inc.或其附属公司。版权所有。在

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java接口中的每个方法都是抽象的,但在抽象类中,我们也只能使用抽象方法   初始化Java中声明的、未初始化的变量会发生什么情况?   java BouncyCastle openPGP将字节[]数组加密为csv文件   在Java中将类A(和所有子类)映射到类B的实例的字典   RSA公钥编码,在Java和Android中,代码相同,结果不同   java在安卓中实现数字检测语音识别   java取消选择复选框   java如何在其他配置中重用Maven配置XML片段   java有没有一种有效的方法来检查HashMap是否包含映射到相同值的键?   spring处理程序调度失败;嵌套的例外是java。lang.NoClassDefFoundError:org/apache/http/client/HttpClient   带有ehcache的java多层缓存   java如何访问chromium(或任何其他浏览器)cookie   java通过将两个集合与spring data mongodb data中的条件合并来获取计数   安卓中R.java的语法错误