Interface OriginRequestPolicyProps

All Superinterfaces:
software.amazon.jsii.JsiiSerializable
All Known Implementing Classes:
OriginRequestPolicyProps.Jsii$Proxy

@Generated(value="jsii-pacmak/1.94.0 (build b380f01)", date="2024-02-23T02:06:29.323Z") @Stability(Stable) public interface OriginRequestPolicyProps extends software.amazon.jsii.JsiiSerializable
Properties for creating a Origin Request Policy.

Example:

 // Creating a custom origin request policy for a Distribution -- all parameters optional
 S3Origin bucketOrigin;
 OriginRequestPolicy myOriginRequestPolicy = OriginRequestPolicy.Builder.create(this, "OriginRequestPolicy")
         .originRequestPolicyName("MyPolicy")
         .comment("A default policy")
         .cookieBehavior(OriginRequestCookieBehavior.none())
         .headerBehavior(OriginRequestHeaderBehavior.all("CloudFront-Is-Android-Viewer"))
         .queryStringBehavior(OriginRequestQueryStringBehavior.allowList("username"))
         .build();
 Distribution.Builder.create(this, "myDistCustomPolicy")
         .defaultBehavior(BehaviorOptions.builder()
                 .origin(bucketOrigin)
                 .originRequestPolicy(myOriginRequestPolicy)
                 .build())
         .build();
 
  • Method Details

    • getComment

      @Stability(Stable) @Nullable default String getComment()
      A comment to describe the origin request policy.

      Default: - no comment

    • getCookieBehavior

      @Stability(Stable) @Nullable default OriginRequestCookieBehavior getCookieBehavior()
      The cookies from viewer requests to include in origin requests.

      Default: OriginRequestCookieBehavior.none()

    • getHeaderBehavior

      @Stability(Stable) @Nullable default OriginRequestHeaderBehavior getHeaderBehavior()
      The HTTP headers to include in origin requests.

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

      Default: OriginRequestHeaderBehavior.none()

    • getOriginRequestPolicyName

      @Stability(Stable) @Nullable default String getOriginRequestPolicyName()
      A unique name to identify the origin request policy.

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

      Default: - generated from the `id`

    • getQueryStringBehavior

      @Stability(Stable) @Nullable default OriginRequestQueryStringBehavior getQueryStringBehavior()
      The URL query strings from viewer requests to include in origin requests.

      Default: OriginRequestQueryStringBehavior.none()

    • builder

      @Stability(Stable) static OriginRequestPolicyProps.Builder builder()
      Returns:
      a OriginRequestPolicyProps.Builder of OriginRequestPolicyProps