How to use the @aws-cdk/aws-cloudfront.CloudFrontAllowedMethods function in @aws-cdk/aws-cloudfront

To help you get started, we’ve selected a few @aws-cdk/aws-cloudfront examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github seagull-js / seagull / packages / deploy / src / lib / cdk / stack.ts View on Github external
private addCloudfront() {
    const name = `${this.name}CFD`
    const originPath = this.apiGatewayOriginPath
    const allowedMethods = CF.CloudFrontAllowedMethods.ALL
    const behaviors = [{ allowedMethods, isDefaultBehavior: true }]
    const customOriginSource = { domainName: this.apiGatewayDomain }
    const originConfigs = [{ behaviors, customOriginSource, originPath }]
    const conf = { defaultRootObject: '', originConfigs }
    // tslint:disable-next-line:no-unused-expression
    new CF.CloudFrontWebDistribution(this, name, conf)
  }
}
github seagull-js / seagull / packages / deploy-aws / src / seagull_stack.ts View on Github external
getDefaultBehavior() {
    return {
      allowedMethods: CF.CloudFrontAllowedMethods.ALL,
      compress: true,
      forwardedValues: { headers: ['authorization'], queryString: true },
      isDefaultBehavior: true,
    }
  }
github seagull-js / seagull / packages / deploy-aws / src / seagull_stack.ts View on Github external
getErrorPageConfig(bucket: S3.Bucket): CF.SourceConfiguration {
    const errorBehavior: CF.Behavior = {
      allowedMethods: CF.CloudFrontAllowedMethods.ALL,
      compress: true,
      forwardedValues: { headers: ['authorization'], queryString: true },
      isDefaultBehavior: false,
      pathPattern: '/error*',
    }

    const s3OriginConfig: CF.S3OriginConfig = {
      s3BucketSource: bucket,
    }

    const errorPageConfig: CF.SourceConfiguration = {
      behaviors: [errorBehavior],
      s3OriginSource: s3OriginConfig,
    }

    return errorPageConfig