Class CloudFrontToApiGatewayToLambda.Builder

java.lang.Object
software.amazon.awsconstructs.services.cloudfrontapigatewaylambda.CloudFrontToApiGatewayToLambda.Builder
All Implemented Interfaces:
software.amazon.jsii.Builder<CloudFrontToApiGatewayToLambda>
Enclosing class:
CloudFrontToApiGatewayToLambda

public static final class CloudFrontToApiGatewayToLambda.Builder extends Object implements software.amazon.jsii.Builder<CloudFrontToApiGatewayToLambda>
A fluent builder for CloudFrontToApiGatewayToLambda.
  • Method Details

    • create

      public static CloudFrontToApiGatewayToLambda.Builder create(software.constructs.Construct scope, String id)
      Parameters:
      scope -
      • represents the scope for all the resources.
      This parameter is required.
      id -
      • this is a a scope-unique id.
      This parameter is required.
      Returns:
      a new instance of CloudFrontToApiGatewayToLambda.Builder.
    • apiGatewayProps

      public CloudFrontToApiGatewayToLambda.Builder apiGatewayProps(Object apiGatewayProps)
      User provided props to override the default props for the API Gateway.

      As of release 2.48.0, clients must include this property with defaultMethodOptions: { authorizationType: string } specified. See Issue1043 in the github repo https://github.com/awslabs/aws-solutions-constructs/issues/1043

      Default: - defaultMethodOptions/authorizationType is required, for other, unspecified values the default props are used

      Parameters:
      apiGatewayProps - User provided props to override the default props for the API Gateway. This parameter is required.
      Returns:
      this
    • cloudFrontDistributionProps

      public CloudFrontToApiGatewayToLambda.Builder cloudFrontDistributionProps(Object cloudFrontDistributionProps)
      Optional user provided props to override the default props.

      Default: - Default props are used

      Parameters:
      cloudFrontDistributionProps - Optional user provided props to override the default props. This parameter is required.
      Returns:
      this
    • cloudFrontLoggingBucketProps

      public CloudFrontToApiGatewayToLambda.Builder cloudFrontLoggingBucketProps(software.amazon.awscdk.services.s3.BucketProps cloudFrontLoggingBucketProps)
      Optional user provided props to override the default props for the CloudFront Logging Bucket.

      Default: - Default props are used

      Parameters:
      cloudFrontLoggingBucketProps - Optional user provided props to override the default props for the CloudFront Logging Bucket. This parameter is required.
      Returns:
      this
    • createUsagePlan

      public CloudFrontToApiGatewayToLambda.Builder createUsagePlan(Boolean createUsagePlan)
      Whether to create a Usage Plan attached to the API.

      Must be true if apiGatewayProps.defaultMethodOptions.apiKeyRequired is true

      Default: - true (to match legacy behavior)

      Parameters:
      createUsagePlan - Whether to create a Usage Plan attached to the API. This parameter is required.
      Returns:
      this
    • existingLambdaObj

      public CloudFrontToApiGatewayToLambda.Builder existingLambdaObj(software.amazon.awscdk.services.lambda.Function existingLambdaObj)
      Existing instance of Lambda Function object, providing both this and lambdaFunctionProps will cause an error.

      Default: - None

      Parameters:
      existingLambdaObj - Existing instance of Lambda Function object, providing both this and lambdaFunctionProps will cause an error. This parameter is required.
      Returns:
      this
    • insertHttpSecurityHeaders

      public CloudFrontToApiGatewayToLambda.Builder insertHttpSecurityHeaders(Boolean insertHttpSecurityHeaders)
      Optional user provided props to turn on/off the automatic injection of best practice HTTP security headers in all responses from cloudfront.

      Turning this on will inject default headers and is mutually exclusive with passing custom security headers via the responseHeadersPolicyProps parameter.

      Default: - true

      Parameters:
      insertHttpSecurityHeaders - Optional user provided props to turn on/off the automatic injection of best practice HTTP security headers in all responses from cloudfront. This parameter is required.
      Returns:
      this
    • lambdaFunctionProps

      public CloudFrontToApiGatewayToLambda.Builder lambdaFunctionProps(software.amazon.awscdk.services.lambda.FunctionProps lambdaFunctionProps)
      Optional user provided props to override the default props for the Lambda function.

      Default: - Default props are used

      Parameters:
      lambdaFunctionProps - Optional user provided props to override the default props for the Lambda function. This parameter is required.
      Returns:
      this
    • logGroupProps

      public CloudFrontToApiGatewayToLambda.Builder logGroupProps(software.amazon.awscdk.services.logs.LogGroupProps logGroupProps)
      Optional user provided props to override the default props for the CloudWatchLogs LogGroup.

      Default: - Default props are used

      Parameters:
      logGroupProps - Optional user provided props to override the default props for the CloudWatchLogs LogGroup. This parameter is required.
      Returns:
      this
    • responseHeadersPolicyProps

      public CloudFrontToApiGatewayToLambda.Builder responseHeadersPolicyProps(software.amazon.awscdk.services.cloudfront.ResponseHeadersPolicyProps responseHeadersPolicyProps)
      Optional user provided configuration that cloudfront applies to all http responses.

      Can be used to pass a custom ResponseSecurityHeadersBehavior, ResponseCustomHeadersBehavior or ResponseHeadersCorsBehavior to the cloudfront distribution.

      Passing a custom ResponseSecurityHeadersBehavior is mutually exclusive with turning on the default security headers via insertHttpSecurityHeaders prop. Will throw an error if both insertHttpSecurityHeaders is set to true and ResponseSecurityHeadersBehavior is passed.

      Default: - undefined

      Parameters:
      responseHeadersPolicyProps - Optional user provided configuration that cloudfront applies to all http responses. This parameter is required.
      Returns:
      this
    • build

      Specified by:
      build in interface software.amazon.jsii.Builder<CloudFrontToApiGatewayToLambda>
      Returns:
      a newly built instance of CloudFrontToApiGatewayToLambda.