We recommend new projects start with resources from the AWS provider.
aws-native.cloudfront.OriginRequestPolicy
Explore with Pulumi AI
We recommend new projects start with resources from the AWS provider.
An origin request policy. When it’s attached to a cache behavior, the origin request policy determines the values that CloudFront includes in requests that it sends to the origin. Each request that CloudFront sends to the origin includes the following:
- The request body and the URL path (without the domain name) from the viewer request.
- The headers that CloudFront automatically includes in every origin request, including
Host
,User-Agent
, andX-Amz-Cf-Id
. - All HTTP headers, cookies, and URL query strings that are specified in the cache policy or the origin request policy. These can include items from the viewer request and, in the case of headers, additional ones that are added by CloudFront.
CloudFront sends a request when it can’t find an object in its cache that matches the request. If you want to send values to the origin and also include them in the cache key, use CachePolicy
.
Create OriginRequestPolicy Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new OriginRequestPolicy(name: string, args: OriginRequestPolicyArgs, opts?: CustomResourceOptions);
@overload
def OriginRequestPolicy(resource_name: str,
args: OriginRequestPolicyArgs,
opts: Optional[ResourceOptions] = None)
@overload
def OriginRequestPolicy(resource_name: str,
opts: Optional[ResourceOptions] = None,
origin_request_policy_config: Optional[OriginRequestPolicyConfigArgs] = None)
func NewOriginRequestPolicy(ctx *Context, name string, args OriginRequestPolicyArgs, opts ...ResourceOption) (*OriginRequestPolicy, error)
public OriginRequestPolicy(string name, OriginRequestPolicyArgs args, CustomResourceOptions? opts = null)
public OriginRequestPolicy(String name, OriginRequestPolicyArgs args)
public OriginRequestPolicy(String name, OriginRequestPolicyArgs args, CustomResourceOptions options)
type: aws-native:cloudfront:OriginRequestPolicy
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args OriginRequestPolicyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args OriginRequestPolicyArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args OriginRequestPolicyArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args OriginRequestPolicyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args OriginRequestPolicyArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
OriginRequestPolicy Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The OriginRequestPolicy resource accepts the following input properties:
- Origin
Request Pulumi.Policy Config Aws Native. Cloud Front. Inputs. Origin Request Policy Config - The origin request policy configuration.
- Origin
Request OriginPolicy Config Request Policy Config Args - The origin request policy configuration.
- origin
Request OriginPolicy Config Request Policy Config - The origin request policy configuration.
- origin
Request OriginPolicy Config Request Policy Config - The origin request policy configuration.
- origin_
request_ Originpolicy_ config Request Policy Config Args - The origin request policy configuration.
- origin
Request Property MapPolicy Config - The origin request policy configuration.
Outputs
All input properties are implicitly available as output properties. Additionally, the OriginRequestPolicy resource produces the following output properties:
- Aws
Id string - The unique identifier for the origin request policy. For example:
befd7079-9bbc-4ebf-8ade-498a3694176c
. - Id string
- The provider-assigned unique ID for this managed resource.
- Last
Modified stringTime - The date and time when the origin request policy was last modified.
- Aws
Id string - The unique identifier for the origin request policy. For example:
befd7079-9bbc-4ebf-8ade-498a3694176c
. - Id string
- The provider-assigned unique ID for this managed resource.
- Last
Modified stringTime - The date and time when the origin request policy was last modified.
- aws
Id String - The unique identifier for the origin request policy. For example:
befd7079-9bbc-4ebf-8ade-498a3694176c
. - id String
- The provider-assigned unique ID for this managed resource.
- last
Modified StringTime - The date and time when the origin request policy was last modified.
- aws
Id string - The unique identifier for the origin request policy. For example:
befd7079-9bbc-4ebf-8ade-498a3694176c
. - id string
- The provider-assigned unique ID for this managed resource.
- last
Modified stringTime - The date and time when the origin request policy was last modified.
- aws_
id str - The unique identifier for the origin request policy. For example:
befd7079-9bbc-4ebf-8ade-498a3694176c
. - id str
- The provider-assigned unique ID for this managed resource.
- last_
modified_ strtime - The date and time when the origin request policy was last modified.
- aws
Id String - The unique identifier for the origin request policy. For example:
befd7079-9bbc-4ebf-8ade-498a3694176c
. - id String
- The provider-assigned unique ID for this managed resource.
- last
Modified StringTime - The date and time when the origin request policy was last modified.
Supporting Types
OriginRequestPolicyConfig, OriginRequestPolicyConfigArgs
- Pulumi.
Aws Native. Cloud Front. Inputs. Origin Request Policy Cookies Config - The cookies from viewer requests to include in origin requests.
- Headers
Config Pulumi.Aws Native. Cloud Front. Inputs. Origin Request Policy Headers Config - The HTTP headers to include in origin requests. These can include headers from viewer requests and additional headers added by CloudFront.
- Name string
- A unique name to identify the origin request policy.
- Query
Strings Pulumi.Config Aws Native. Cloud Front. Inputs. Origin Request Policy Query Strings Config - The URL query strings from viewer requests to include in origin requests.
- Comment string
- A comment to describe the origin request policy. The comment cannot be longer than 128 characters.
- Origin
Request Policy Cookies Config - The cookies from viewer requests to include in origin requests.
- Headers
Config OriginRequest Policy Headers Config - The HTTP headers to include in origin requests. These can include headers from viewer requests and additional headers added by CloudFront.
- Name string
- A unique name to identify the origin request policy.
- Query
Strings OriginConfig Request Policy Query Strings Config - The URL query strings from viewer requests to include in origin requests.
- Comment string
- A comment to describe the origin request policy. The comment cannot be longer than 128 characters.
- Origin
Request Policy Cookies Config - The cookies from viewer requests to include in origin requests.
- headers
Config OriginRequest Policy Headers Config - The HTTP headers to include in origin requests. These can include headers from viewer requests and additional headers added by CloudFront.
- name String
- A unique name to identify the origin request policy.
- query
Strings OriginConfig Request Policy Query Strings Config - The URL query strings from viewer requests to include in origin requests.
- comment String
- A comment to describe the origin request policy. The comment cannot be longer than 128 characters.
- Origin
Request Policy Cookies Config - The cookies from viewer requests to include in origin requests.
- headers
Config OriginRequest Policy Headers Config - The HTTP headers to include in origin requests. These can include headers from viewer requests and additional headers added by CloudFront.
- name string
- A unique name to identify the origin request policy.
- query
Strings OriginConfig Request Policy Query Strings Config - The URL query strings from viewer requests to include in origin requests.
- comment string
- A comment to describe the origin request policy. The comment cannot be longer than 128 characters.
- Origin
Request Policy Cookies Config - The cookies from viewer requests to include in origin requests.
- headers_
config OriginRequest Policy Headers Config - The HTTP headers to include in origin requests. These can include headers from viewer requests and additional headers added by CloudFront.
- name str
- A unique name to identify the origin request policy.
- query_
strings_ Originconfig Request Policy Query Strings Config - The URL query strings from viewer requests to include in origin requests.
- comment str
- A comment to describe the origin request policy. The comment cannot be longer than 128 characters.
- Property Map
- The cookies from viewer requests to include in origin requests.
- headers
Config Property Map - The HTTP headers to include in origin requests. These can include headers from viewer requests and additional headers added by CloudFront.
- name String
- A unique name to identify the origin request policy.
- query
Strings Property MapConfig - The URL query strings from viewer requests to include in origin requests.
- comment String
- A comment to describe the origin request policy. The comment cannot be longer than 128 characters.
OriginRequestPolicyCookiesConfig, OriginRequestPolicyCookiesConfigArgs
- string
- Determines whether cookies in viewer requests are included in requests that CloudFront sends to the origin. Valid values are:
none
– No cookies in viewer requests are included in requests that CloudFront sends to the origin. Even when this field is set tonone
, any cookies that are listed in aCachePolicy
are included in origin requests.whitelist
– Only the cookies in viewer requests that are listed in theCookieNames
type are included in requests that CloudFront sends to the origin.all
– All cookies in viewer requests are included in requests that CloudFront sends to the origin.allExcept
– All cookies in viewer requests are included in requests that CloudFront sends to the origin, except for those listed in theCookieNames
type, which are not included.
- List<string>
- Contains a list of cookie names.
- string
- Determines whether cookies in viewer requests are included in requests that CloudFront sends to the origin. Valid values are:
none
– No cookies in viewer requests are included in requests that CloudFront sends to the origin. Even when this field is set tonone
, any cookies that are listed in aCachePolicy
are included in origin requests.whitelist
– Only the cookies in viewer requests that are listed in theCookieNames
type are included in requests that CloudFront sends to the origin.all
– All cookies in viewer requests are included in requests that CloudFront sends to the origin.allExcept
– All cookies in viewer requests are included in requests that CloudFront sends to the origin, except for those listed in theCookieNames
type, which are not included.
- []string
- Contains a list of cookie names.
- String
- Determines whether cookies in viewer requests are included in requests that CloudFront sends to the origin. Valid values are:
none
– No cookies in viewer requests are included in requests that CloudFront sends to the origin. Even when this field is set tonone
, any cookies that are listed in aCachePolicy
are included in origin requests.whitelist
– Only the cookies in viewer requests that are listed in theCookieNames
type are included in requests that CloudFront sends to the origin.all
– All cookies in viewer requests are included in requests that CloudFront sends to the origin.allExcept
– All cookies in viewer requests are included in requests that CloudFront sends to the origin, except for those listed in theCookieNames
type, which are not included.
- List<String>
- Contains a list of cookie names.
- string
- Determines whether cookies in viewer requests are included in requests that CloudFront sends to the origin. Valid values are:
none
– No cookies in viewer requests are included in requests that CloudFront sends to the origin. Even when this field is set tonone
, any cookies that are listed in aCachePolicy
are included in origin requests.whitelist
– Only the cookies in viewer requests that are listed in theCookieNames
type are included in requests that CloudFront sends to the origin.all
– All cookies in viewer requests are included in requests that CloudFront sends to the origin.allExcept
– All cookies in viewer requests are included in requests that CloudFront sends to the origin, except for those listed in theCookieNames
type, which are not included.
- string[]
- Contains a list of cookie names.
- str
- Determines whether cookies in viewer requests are included in requests that CloudFront sends to the origin. Valid values are:
none
– No cookies in viewer requests are included in requests that CloudFront sends to the origin. Even when this field is set tonone
, any cookies that are listed in aCachePolicy
are included in origin requests.whitelist
– Only the cookies in viewer requests that are listed in theCookieNames
type are included in requests that CloudFront sends to the origin.all
– All cookies in viewer requests are included in requests that CloudFront sends to the origin.allExcept
– All cookies in viewer requests are included in requests that CloudFront sends to the origin, except for those listed in theCookieNames
type, which are not included.
- Sequence[str]
- Contains a list of cookie names.
- String
- Determines whether cookies in viewer requests are included in requests that CloudFront sends to the origin. Valid values are:
none
– No cookies in viewer requests are included in requests that CloudFront sends to the origin. Even when this field is set tonone
, any cookies that are listed in aCachePolicy
are included in origin requests.whitelist
– Only the cookies in viewer requests that are listed in theCookieNames
type are included in requests that CloudFront sends to the origin.all
– All cookies in viewer requests are included in requests that CloudFront sends to the origin.allExcept
– All cookies in viewer requests are included in requests that CloudFront sends to the origin, except for those listed in theCookieNames
type, which are not included.
- List<String>
- Contains a list of cookie names.
OriginRequestPolicyHeadersConfig, OriginRequestPolicyHeadersConfigArgs
- Header
Behavior string - Determines whether any HTTP headers are included in requests that CloudFront sends to the origin. Valid values are:
none
– No HTTP headers in viewer requests are included in requests that CloudFront sends to the origin. Even when this field is set tonone
, any headers that are listed in aCachePolicy
are included in origin requests.whitelist
– Only the HTTP headers that are listed in theHeaders
type are included in requests that CloudFront sends to the origin.allViewer
– All HTTP headers in viewer requests are included in requests that CloudFront sends to the origin.allViewerAndWhitelistCloudFront
– All HTTP headers in viewer requests and the additional CloudFront headers that are listed in theHeaders
type are included in requests that CloudFront sends to the origin. The additional headers are added by CloudFront.allExcept
– All HTTP headers in viewer requests are included in requests that CloudFront sends to the origin, except for those listed in theHeaders
type, which are not included.
- Headers List<string>
- Contains a list of HTTP header names.
- Header
Behavior string - Determines whether any HTTP headers are included in requests that CloudFront sends to the origin. Valid values are:
none
– No HTTP headers in viewer requests are included in requests that CloudFront sends to the origin. Even when this field is set tonone
, any headers that are listed in aCachePolicy
are included in origin requests.whitelist
– Only the HTTP headers that are listed in theHeaders
type are included in requests that CloudFront sends to the origin.allViewer
– All HTTP headers in viewer requests are included in requests that CloudFront sends to the origin.allViewerAndWhitelistCloudFront
– All HTTP headers in viewer requests and the additional CloudFront headers that are listed in theHeaders
type are included in requests that CloudFront sends to the origin. The additional headers are added by CloudFront.allExcept
– All HTTP headers in viewer requests are included in requests that CloudFront sends to the origin, except for those listed in theHeaders
type, which are not included.
- Headers []string
- Contains a list of HTTP header names.
- header
Behavior String - Determines whether any HTTP headers are included in requests that CloudFront sends to the origin. Valid values are:
none
– No HTTP headers in viewer requests are included in requests that CloudFront sends to the origin. Even when this field is set tonone
, any headers that are listed in aCachePolicy
are included in origin requests.whitelist
– Only the HTTP headers that are listed in theHeaders
type are included in requests that CloudFront sends to the origin.allViewer
– All HTTP headers in viewer requests are included in requests that CloudFront sends to the origin.allViewerAndWhitelistCloudFront
– All HTTP headers in viewer requests and the additional CloudFront headers that are listed in theHeaders
type are included in requests that CloudFront sends to the origin. The additional headers are added by CloudFront.allExcept
– All HTTP headers in viewer requests are included in requests that CloudFront sends to the origin, except for those listed in theHeaders
type, which are not included.
- headers List<String>
- Contains a list of HTTP header names.
- header
Behavior string - Determines whether any HTTP headers are included in requests that CloudFront sends to the origin. Valid values are:
none
– No HTTP headers in viewer requests are included in requests that CloudFront sends to the origin. Even when this field is set tonone
, any headers that are listed in aCachePolicy
are included in origin requests.whitelist
– Only the HTTP headers that are listed in theHeaders
type are included in requests that CloudFront sends to the origin.allViewer
– All HTTP headers in viewer requests are included in requests that CloudFront sends to the origin.allViewerAndWhitelistCloudFront
– All HTTP headers in viewer requests and the additional CloudFront headers that are listed in theHeaders
type are included in requests that CloudFront sends to the origin. The additional headers are added by CloudFront.allExcept
– All HTTP headers in viewer requests are included in requests that CloudFront sends to the origin, except for those listed in theHeaders
type, which are not included.
- headers string[]
- Contains a list of HTTP header names.
- header_
behavior str - Determines whether any HTTP headers are included in requests that CloudFront sends to the origin. Valid values are:
none
– No HTTP headers in viewer requests are included in requests that CloudFront sends to the origin. Even when this field is set tonone
, any headers that are listed in aCachePolicy
are included in origin requests.whitelist
– Only the HTTP headers that are listed in theHeaders
type are included in requests that CloudFront sends to the origin.allViewer
– All HTTP headers in viewer requests are included in requests that CloudFront sends to the origin.allViewerAndWhitelistCloudFront
– All HTTP headers in viewer requests and the additional CloudFront headers that are listed in theHeaders
type are included in requests that CloudFront sends to the origin. The additional headers are added by CloudFront.allExcept
– All HTTP headers in viewer requests are included in requests that CloudFront sends to the origin, except for those listed in theHeaders
type, which are not included.
- headers Sequence[str]
- Contains a list of HTTP header names.
- header
Behavior String - Determines whether any HTTP headers are included in requests that CloudFront sends to the origin. Valid values are:
none
– No HTTP headers in viewer requests are included in requests that CloudFront sends to the origin. Even when this field is set tonone
, any headers that are listed in aCachePolicy
are included in origin requests.whitelist
– Only the HTTP headers that are listed in theHeaders
type are included in requests that CloudFront sends to the origin.allViewer
– All HTTP headers in viewer requests are included in requests that CloudFront sends to the origin.allViewerAndWhitelistCloudFront
– All HTTP headers in viewer requests and the additional CloudFront headers that are listed in theHeaders
type are included in requests that CloudFront sends to the origin. The additional headers are added by CloudFront.allExcept
– All HTTP headers in viewer requests are included in requests that CloudFront sends to the origin, except for those listed in theHeaders
type, which are not included.
- headers List<String>
- Contains a list of HTTP header names.
OriginRequestPolicyQueryStringsConfig, OriginRequestPolicyQueryStringsConfigArgs
- Query
String stringBehavior - Determines whether any URL query strings in viewer requests are included in requests that CloudFront sends to the origin. Valid values are:
none
– No query strings in viewer requests are included in requests that CloudFront sends to the origin. Even when this field is set tonone
, any query strings that are listed in aCachePolicy
are included in origin requests.whitelist
– Only the query strings in viewer requests that are listed in theQueryStringNames
type are included in requests that CloudFront sends to the origin.all
– All query strings in viewer requests are included in requests that CloudFront sends to the origin.allExcept
– All query strings in viewer requests are included in requests that CloudFront sends to the origin, except for those listed in theQueryStringNames
type, which are not included.
- Query
Strings List<string> - Contains a list of query string names.
- Query
String stringBehavior - Determines whether any URL query strings in viewer requests are included in requests that CloudFront sends to the origin. Valid values are:
none
– No query strings in viewer requests are included in requests that CloudFront sends to the origin. Even when this field is set tonone
, any query strings that are listed in aCachePolicy
are included in origin requests.whitelist
– Only the query strings in viewer requests that are listed in theQueryStringNames
type are included in requests that CloudFront sends to the origin.all
– All query strings in viewer requests are included in requests that CloudFront sends to the origin.allExcept
– All query strings in viewer requests are included in requests that CloudFront sends to the origin, except for those listed in theQueryStringNames
type, which are not included.
- Query
Strings []string - Contains a list of query string names.
- query
String StringBehavior - Determines whether any URL query strings in viewer requests are included in requests that CloudFront sends to the origin. Valid values are:
none
– No query strings in viewer requests are included in requests that CloudFront sends to the origin. Even when this field is set tonone
, any query strings that are listed in aCachePolicy
are included in origin requests.whitelist
– Only the query strings in viewer requests that are listed in theQueryStringNames
type are included in requests that CloudFront sends to the origin.all
– All query strings in viewer requests are included in requests that CloudFront sends to the origin.allExcept
– All query strings in viewer requests are included in requests that CloudFront sends to the origin, except for those listed in theQueryStringNames
type, which are not included.
- query
Strings List<String> - Contains a list of query string names.
- query
String stringBehavior - Determines whether any URL query strings in viewer requests are included in requests that CloudFront sends to the origin. Valid values are:
none
– No query strings in viewer requests are included in requests that CloudFront sends to the origin. Even when this field is set tonone
, any query strings that are listed in aCachePolicy
are included in origin requests.whitelist
– Only the query strings in viewer requests that are listed in theQueryStringNames
type are included in requests that CloudFront sends to the origin.all
– All query strings in viewer requests are included in requests that CloudFront sends to the origin.allExcept
– All query strings in viewer requests are included in requests that CloudFront sends to the origin, except for those listed in theQueryStringNames
type, which are not included.
- query
Strings string[] - Contains a list of query string names.
- query_
string_ strbehavior - Determines whether any URL query strings in viewer requests are included in requests that CloudFront sends to the origin. Valid values are:
none
– No query strings in viewer requests are included in requests that CloudFront sends to the origin. Even when this field is set tonone
, any query strings that are listed in aCachePolicy
are included in origin requests.whitelist
– Only the query strings in viewer requests that are listed in theQueryStringNames
type are included in requests that CloudFront sends to the origin.all
– All query strings in viewer requests are included in requests that CloudFront sends to the origin.allExcept
– All query strings in viewer requests are included in requests that CloudFront sends to the origin, except for those listed in theQueryStringNames
type, which are not included.
- query_
strings Sequence[str] - Contains a list of query string names.
- query
String StringBehavior - Determines whether any URL query strings in viewer requests are included in requests that CloudFront sends to the origin. Valid values are:
none
– No query strings in viewer requests are included in requests that CloudFront sends to the origin. Even when this field is set tonone
, any query strings that are listed in aCachePolicy
are included in origin requests.whitelist
– Only the query strings in viewer requests that are listed in theQueryStringNames
type are included in requests that CloudFront sends to the origin.all
– All query strings in viewer requests are included in requests that CloudFront sends to the origin.allExcept
– All query strings in viewer requests are included in requests that CloudFront sends to the origin, except for those listed in theQueryStringNames
type, which are not included.
- query
Strings List<String> - Contains a list of query string names.
Package Details
- Repository
- AWS Native pulumi/pulumi-aws-native
- License
- Apache-2.0
We recommend new projects start with resources from the AWS provider.