Interface OriginRequestPolicyProps

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

@Generated(value="jsii-pacmak/1.103.1 (build bef2dea)", date="2024-10-05T03:43:40.026Z") @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