package awscloudfront import ( _init_ "github.com/aws/aws-cdk-go/awscdk/v2/jsii" _jsii_ "github.com/aws/jsii-runtime-go/runtime" ) // Determines whether any URL query strings in viewer requests are included in the cache key and automatically included in requests that CloudFront sends to the origin. // // Example: // // Creating a custom cache policy for a Distribution -- all parameters optional // var bucketOrigin s3Origin // // myCachePolicy := cloudfront.NewCachePolicy(this, jsii.String("myCachePolicy"), &CachePolicyProps{ // CachePolicyName: jsii.String("MyPolicy"), // Comment: jsii.String("A default policy"), // DefaultTtl: awscdk.Duration_Days(jsii.Number(2)), // MinTtl: awscdk.Duration_Minutes(jsii.Number(1)), // MaxTtl: awscdk.Duration_*Days(jsii.Number(10)), // CookieBehavior: cloudfront.CacheCookieBehavior_All(), // HeaderBehavior: cloudfront.CacheHeaderBehavior_AllowList(jsii.String("X-CustomHeader")), // QueryStringBehavior: cloudfront.CacheQueryStringBehavior_DenyList(jsii.String("username")), // EnableAcceptEncodingGzip: jsii.Boolean(true), // EnableAcceptEncodingBrotli: jsii.Boolean(true), // }) // cloudfront.NewDistribution(this, jsii.String("myDistCustomPolicy"), &DistributionProps{ // DefaultBehavior: &BehaviorOptions{ // Origin: bucketOrigin, // CachePolicy: myCachePolicy, // }, // }) // type CacheQueryStringBehavior interface { // The behavior of query strings -- allow all, none, only an allow list, or a deny list. Behavior() *string // The query strings to allow or deny, if the behavior is an allow or deny list. QueryStrings() *[]*string } // The jsii proxy struct for CacheQueryStringBehavior type jsiiProxy_CacheQueryStringBehavior struct { _ byte // padding } func (j *jsiiProxy_CacheQueryStringBehavior) Behavior() *string { var returns *string _jsii_.Get( j, "behavior", &returns, ) return returns } func (j *jsiiProxy_CacheQueryStringBehavior) QueryStrings() *[]*string { var returns *[]*string _jsii_.Get( j, "queryStrings", &returns, ) return returns } // All query strings in viewer requests are included in the cache key and are automatically included in requests that CloudFront sends to the origin. func CacheQueryStringBehavior_All() CacheQueryStringBehavior { _init_.Initialize() var returns CacheQueryStringBehavior _jsii_.StaticInvoke( "aws-cdk-lib.aws_cloudfront.CacheQueryStringBehavior", "all", nil, // no parameters &returns, ) return returns } // Only the provided `queryStrings` are included in the cache key and automatically included in requests that CloudFront sends to the origin. func CacheQueryStringBehavior_AllowList(queryStrings ...*string) CacheQueryStringBehavior { _init_.Initialize() args := []interface{}{} for _, a := range queryStrings { args = append(args, a) } var returns CacheQueryStringBehavior _jsii_.StaticInvoke( "aws-cdk-lib.aws_cloudfront.CacheQueryStringBehavior", "allowList", args, &returns, ) return returns } // All query strings except the provided `queryStrings` are included in the cache key and automatically included in requests that CloudFront sends to the origin. func CacheQueryStringBehavior_DenyList(queryStrings ...*string) CacheQueryStringBehavior { _init_.Initialize() args := []interface{}{} for _, a := range queryStrings { args = append(args, a) } var returns CacheQueryStringBehavior _jsii_.StaticInvoke( "aws-cdk-lib.aws_cloudfront.CacheQueryStringBehavior", "denyList", args, &returns, ) return returns } // Query strings in viewer requests are not included in the cache key and are not automatically included in requests that CloudFront sends to the origin. func CacheQueryStringBehavior_None() CacheQueryStringBehavior { _init_.Initialize() var returns CacheQueryStringBehavior _jsii_.StaticInvoke( "aws-cdk-lib.aws_cloudfront.CacheQueryStringBehavior", "none", nil, // no parameters &returns, ) return returns }