Skip to content

Commit

Permalink
fix: use default AllViewer policy for e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sshelomentsev committed May 16, 2024
1 parent 8fe6d3d commit 8dfe8d5
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 14 deletions.
2 changes: 1 addition & 1 deletion e2e/infra/cloudfront/src/cloudfront-with-headers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ const cloudfrontDistro = new aws.cloudfront.Distribution(resource('website-with-
pathPattern: 'fpjs/*',
viewerProtocolPolicy: 'redirect-to-https',
cachePolicyId: lambdaCachePolicy.id,
originRequestPolicyId: lambdaOriginPolicy.id,
originRequestPolicyId: lambdaOriginPolicy,
allowedMethods: ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'PATCH', 'POST', 'PUT'],
cachedMethods: ['GET', 'HEAD'],
targetOriginId: s3OriginId,
Expand Down
2 changes: 1 addition & 1 deletion e2e/infra/cloudfront/src/cloudfront-with-secrets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const cloudfrontDistro = new aws.cloudfront.Distribution(resource('website-with-
pathPattern: 'fpjs/*',
viewerProtocolPolicy: 'redirect-to-https',
cachePolicyId: lambdaCachePolicy.id,
originRequestPolicyId: lambdaOriginPolicy.id,
originRequestPolicyId: lambdaOriginPolicy,
allowedMethods: ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'PATCH', 'POST', 'PUT'],
cachedMethods: ['GET', 'HEAD'],
targetOriginId: s3OriginId,
Expand Down
2 changes: 1 addition & 1 deletion e2e/infra/cloudfront/src/cloudfront-without-variables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const cloudfrontDistro = new aws.cloudfront.Distribution(resource('website-witho
pathPattern: 'fpjs/*',
viewerProtocolPolicy: 'redirect-to-https',
cachePolicyId: lambdaCachePolicy.id,
originRequestPolicyId: lambdaOriginPolicy.id,
originRequestPolicyId: lambdaOriginPolicy,
allowedMethods: ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'PATCH', 'POST', 'PUT'],
cachedMethods: ['GET', 'HEAD'],
targetOriginId: s3OriginId,
Expand Down
12 changes: 1 addition & 11 deletions e2e/infra/cloudfront/src/lambda.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,4 @@ export const lambdaCachePolicy = new aws.cloudfront.CachePolicy(resource('lambda
},
})

export const lambdaOriginPolicy = new aws.cloudfront.OriginRequestPolicy(resource('lambda-origin-policy'), {
headersConfig: {
headerBehavior: 'allViewer',
},
cookiesConfig: {
cookieBehavior: 'all',
},
queryStringsConfig: {
queryStringBehavior: 'all',
},
})
export const lambdaOriginPolicy = '216adef6-5c7f-47e4-b989-5492eafa07d3' // default AllViewer policy

0 comments on commit 8dfe8d5

Please sign in to comment.