class OriginRequestQueryStringBehavior
| Language | Type name | 
|---|---|
  .NET | Amazon.CDK.AWS.CloudFront.OriginRequestQueryStringBehavior | 
  Go | github.com/aws/aws-cdk-go/awscdk/v2/awscloudfront#OriginRequestQueryStringBehavior | 
  Java | software.amazon.awscdk.services.cloudfront.OriginRequestQueryStringBehavior | 
  Python | aws_cdk.aws_cloudfront.OriginRequestQueryStringBehavior | 
  TypeScript (source) | aws-cdk-lib » aws_cloudfront » OriginRequestQueryStringBehavior | 
Determines whether any URL query strings in viewer requests (and if so, which query strings) are included in requests that CloudFront sends to the origin.
Example
// Creating a custom origin request policy for a Distribution -- all parameters optional
declare const bucketOrigin: origins.S3Origin;
const myOriginRequestPolicy = new cloudfront.OriginRequestPolicy(this, 'OriginRequestPolicy', {
  originRequestPolicyName: 'MyPolicy',
  comment: 'A default policy',
  cookieBehavior: cloudfront.OriginRequestCookieBehavior.none(),
  headerBehavior: cloudfront.OriginRequestHeaderBehavior.all('CloudFront-Is-Android-Viewer'),
  queryStringBehavior: cloudfront.OriginRequestQueryStringBehavior.allowList('username'),
});
new cloudfront.Distribution(this, 'myDistCustomPolicy', {
  defaultBehavior: {
    origin: bucketOrigin,
    originRequestPolicy: myOriginRequestPolicy,
  },
});
Properties
| Name | Type | Description | 
|---|---|---|
| behavior | string | The behavior of query strings -- allow all, none, or only an allow list. | 
| query | string[] | The query strings to allow, if the behavior is an allow list. | 
behavior
Type:
string
The behavior of query strings -- allow all, none, or only an allow list.
queryStrings?
Type:
string[]
(optional)
The query strings to allow, if the behavior is an allow list.
Methods
| Name | Description | 
|---|---|
| static all() | All query strings in viewer requests are included in requests that CloudFront sends to the origin. | 
| static allow | Only the provided queryStrings are included in requests that CloudFront sends to the origin. | 
| static deny | All query strings except the provided queryStrings are included in requests that CloudFront sends to the origin. | 
| static none() | Query strings in viewer requests are not included in requests that CloudFront sends to the origin. | 
static all()
public static all(): OriginRequestQueryStringBehavior
Returns
All query strings in viewer requests are included in requests that CloudFront sends to the origin.
static allowList(...queryStrings) 
public static allowList(...queryStrings: string[]): OriginRequestQueryStringBehavior
Parameters
- queryStrings 
string 
Returns
Only the provided queryStrings are included in requests that CloudFront sends to the origin.
static denyList(...queryStrings) 
public static denyList(...queryStrings: string[]): OriginRequestQueryStringBehavior
Parameters
- queryStrings 
string 
Returns
All query strings except the provided queryStrings are included in requests that CloudFront sends to the origin.
static none()
public static none(): OriginRequestQueryStringBehavior
Returns
Query strings in viewer requests are not included in requests that CloudFront sends to the origin.
Any query strings that are listed in a CachePolicy are still included in origin requests.

 .NET
 Go
 Java
 Python
 TypeScript (