Skip to content

Commit

Permalink
Add ALL_VIEWER OriginRequestPolicy, necessary to pass request params …
Browse files Browse the repository at this point in the history
…on to LB
  • Loading branch information
jonathonherbert committed Jan 23, 2025
1 parent 374e316 commit e959a14
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
1 change: 1 addition & 0 deletions cdk/lib/__snapshots__/index.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2294,6 +2294,7 @@ EOF
],
"CachePolicyId": "4135ea2d-6df8-44a3-9df3-4b5a84be39ad",
"Compress": true,
"OriginRequestPolicyId": "216adef6-5c7f-47e4-b989-5492eafa07d3",
"TargetOriginId": "typerightertyperightercloudfrontOrigin1DFFB56FA",
"ViewerProtocolPolicy": "allow-all",
},
Expand Down
8 changes: 3 additions & 5 deletions cdk/lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import {
Duration,
RemovalPolicy,
SecretValue,
Tags,
} from "aws-cdk-lib";
import { Certificate } from "aws-cdk-lib/aws-certificatemanager";
import type { GuStackProps } from "@guardian/cdk/lib/constructs/core/stack";
Expand All @@ -22,12 +21,10 @@ import { InstanceType, Port, SubnetType } from "aws-cdk-lib/aws-ec2";
import { GuS3Bucket } from "@guardian/cdk/lib/constructs/s3";
import {
AllowedMethods,
CacheCookieBehavior,
CacheHeaderBehavior,
CachePolicy,
CacheQueryStringBehavior,
Distribution,
OriginProtocolPolicy,
OriginRequestPolicy,
} from "aws-cdk-lib/aws-cloudfront";
import { LoadBalancerV2Origin } from "aws-cdk-lib/aws-cloudfront-origins";
import {
Expand Down Expand Up @@ -225,7 +222,8 @@ EOF
defaultBehavior: {
origin: checkerOrigin,
allowedMethods: AllowedMethods.ALLOW_ALL,
cachePolicy: CachePolicy.CACHING_DISABLED
cachePolicy: CachePolicy.CACHING_DISABLED,
originRequestPolicy: OriginRequestPolicy.ALL_VIEWER
},
domainNames: [checkerDomain],
logBucket: cloudfrontBucket,
Expand Down

0 comments on commit e959a14

Please sign in to comment.