Class OriginRequestPolicy.Builder

java.lang.Object
software.amazon.awscdk.services.cloudfront.OriginRequestPolicy.Builder
All Implemented Interfaces:
software.amazon.jsii.Builder<OriginRequestPolicy>
Enclosing class:
OriginRequestPolicy

@Stability(Stable) public static final class OriginRequestPolicy.Builder extends Object implements software.amazon.jsii.Builder<OriginRequestPolicy>
A fluent builder for OriginRequestPolicy.
  • Method Details

    • create

      @Stability(Stable) public static OriginRequestPolicy.Builder create(software.constructs.Construct scope, String id)
      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      Returns:
      a new instance of OriginRequestPolicy.Builder.
    • comment

      @Stability(Stable) public OriginRequestPolicy.Builder comment(String comment)
      A comment to describe the origin request policy.

      Default: - no comment

      Parameters:
      comment - A comment to describe the origin request policy. This parameter is required.
      Returns:
      this
    • cookieBehavior

      @Stability(Stable) public OriginRequestPolicy.Builder cookieBehavior(OriginRequestCookieBehavior cookieBehavior)
      The cookies from viewer requests to include in origin requests.

      Default: OriginRequestCookieBehavior.none()

      Parameters:
      cookieBehavior - The cookies from viewer requests to include in origin requests. This parameter is required.
      Returns:
      this
    • headerBehavior

      @Stability(Stable) public OriginRequestPolicy.Builder headerBehavior(OriginRequestHeaderBehavior headerBehavior)
      The HTTP headers to include in origin requests.

      These can include headers from viewer requests and additional headers added by CloudFront.

      Default: OriginRequestHeaderBehavior.none()

      Parameters:
      headerBehavior - The HTTP headers to include in origin requests. This parameter is required.
      Returns:
      this
    • originRequestPolicyName

      @Stability(Stable) public OriginRequestPolicy.Builder originRequestPolicyName(String originRequestPolicyName)
      A unique name to identify the origin request policy.

      The name must only include '-', '_', or alphanumeric characters.

      Default: - generated from the `id`

      Parameters:
      originRequestPolicyName - A unique name to identify the origin request policy. This parameter is required.
      Returns:
      this
    • queryStringBehavior

      @Stability(Stable) public OriginRequestPolicy.Builder queryStringBehavior(OriginRequestQueryStringBehavior queryStringBehavior)
      The URL query strings from viewer requests to include in origin requests.

      Default: OriginRequestQueryStringBehavior.none()

      Parameters:
      queryStringBehavior - The URL query strings from viewer requests to include in origin requests. This parameter is required.
      Returns:
      this
    • build

      @Stability(Stable) public OriginRequestPolicy build()
      Specified by:
      build in interface software.amazon.jsii.Builder<OriginRequestPolicy>
      Returns:
      a newly built instance of OriginRequestPolicy.