Skip to content

OriginRequestPolicy

Source: src/AWS/CloudFront/OriginRequestPolicy.ts

A CloudFront origin request policy.

Origin request policies control which values from the viewer request (in addition to those used in the cache key) CloudFront includes when sending a request to the origin. They are referenced by ID on a Distribution’s default behavior or per-path cache behaviors.

const originRequestPolicy = yield* OriginRequestPolicy("AppOriginRequest", {
comment: "Forward auth + locale",
headersConfig: {
HeaderBehavior: "whitelist",
Headers: { Quantity: 2, Items: ["Authorization", "Accept-Language"] },
},
cookiesConfig: { CookieBehavior: "all" },
queryStringsConfig: { QueryStringBehavior: "all" },
});