Interface IOriginRequestPolicyProps
Properties for creating a Origin Request Policy.
Namespace: Amazon.CDK.AWS.CloudFront
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public interface IOriginRequestPolicyProps
Syntax (vb)
Public Interface IOriginRequestPolicyProps
Remarks
ExampleMetadata: infused
Examples
// Creating a custom origin request policy for a Distribution -- all parameters optional
S3Origin bucketOrigin;
var myOriginRequestPolicy = new OriginRequestPolicy(this, "OriginRequestPolicy", new OriginRequestPolicyProps {
OriginRequestPolicyName = "MyPolicy",
Comment = "A default policy",
CookieBehavior = OriginRequestCookieBehavior.None(),
HeaderBehavior = OriginRequestHeaderBehavior.All("CloudFront-Is-Android-Viewer"),
QueryStringBehavior = OriginRequestQueryStringBehavior.AllowList("username")
});
new Distribution(this, "myDistCustomPolicy", new DistributionProps {
DefaultBehavior = new BehaviorOptions {
Origin = bucketOrigin,
OriginRequestPolicy = myOriginRequestPolicy
}
});
Synopsis
Properties
Comment | A comment to describe the origin request policy. |
CookieBehavior | The cookies from viewer requests to include in origin requests. |
HeaderBehavior | The HTTP headers to include in origin requests. |
OriginRequestPolicyName | A unique name to identify the origin request policy. |
QueryStringBehavior | The URL query strings from viewer requests to include in origin requests. |
Properties
Comment
A comment to describe the origin request policy.
virtual string Comment { get; }
Property Value
System.String
Remarks
Default: - no comment
CookieBehavior
The cookies from viewer requests to include in origin requests.
virtual OriginRequestCookieBehavior CookieBehavior { get; }
Property Value
Remarks
Default: OriginRequestCookieBehavior.none()
HeaderBehavior
The HTTP headers to include in origin requests.
virtual OriginRequestHeaderBehavior HeaderBehavior { get; }
Property Value
Remarks
These can include headers from viewer requests and additional headers added by CloudFront.
Default: OriginRequestHeaderBehavior.none()
OriginRequestPolicyName
A unique name to identify the origin request policy.
virtual string OriginRequestPolicyName { get; }
Property Value
System.String
Remarks
The name must only include '-', '_', or alphanumeric characters.
Default: - generated from the id
QueryStringBehavior
The URL query strings from viewer requests to include in origin requests.
virtual OriginRequestQueryStringBehavior QueryStringBehavior { get; }
Property Value
OriginRequestQueryStringBehavior
Remarks
Default: OriginRequestQueryStringBehavior.none()