AWS Tools for Windows PowerShell
Command Reference

AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

Synopsis

Calls the Amazon CloudFront CreateOriginRequestPolicy API operation.

Syntax

New-CFOriginRequestPolicy
-OriginRequestPolicyConfig_Comment <String>
-CookiesConfig_CookieBehavior <OriginRequestPolicyCookieBehavior>
-HeadersConfig_HeaderBehavior <OriginRequestPolicyHeaderBehavior>
-Cookies_Item <String[]>
-Headers_Item <String[]>
-QueryStrings_Item <String[]>
-OriginRequestPolicyConfig_Name <String>
-Cookies_Quantity <Int32>
-Headers_Quantity <Int32>
-QueryStrings_Quantity <Int32>
-QueryStringsConfig_QueryStringBehavior <OriginRequestPolicyQueryStringBehavior>
-Select <String>
-Force <SwitchParameter>
-ClientConfig <AmazonCloudFrontConfig>

Description

Creates an origin request policy. After you create an origin request policy, you can attach it to one or more cache behaviors. 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, and X-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 a valid 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. For more information about origin request policies, see Controlling origin requests in the Amazon CloudFront Developer Guide.

Parameters

-ClientConfig <AmazonCloudFrontConfig>
Amazon.PowerShell.Cmdlets.CF.AmazonCloudFrontClientCmdlet.ClientConfig
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-Cookies_Item <String[]>
A list of cookie names.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesOriginRequestPolicyConfig_CookiesConfig_Cookies_Items
-Cookies_Quantity <Int32>
The number of cookie names in the Items list.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesOriginRequestPolicyConfig_CookiesConfig_Cookies_Quantity
-CookiesConfig_CookieBehavior <OriginRequestPolicyCookieBehavior>
Determines whether cookies in viewer requests are included in requests that CloudFront sends to the origin. Valid values are:
  • none – Cookies in viewer requests are not included in requests that CloudFront sends to the origin. Even when this field is set to none, any cookies that are listed in a CachePolicyare included in origin requests.
  • whitelist – The cookies in viewer requests that are listed in the CookieNames 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.
Required?True
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesOriginRequestPolicyConfig_CookiesConfig_CookieBehavior
This parameter overrides confirmation prompts to force the cmdlet to continue its operation. This parameter should always be used with caution.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-Headers_Item <String[]>
A list of HTTP header names.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesOriginRequestPolicyConfig_HeadersConfig_Headers_Items
-Headers_Quantity <Int32>
The number of header names in the Items list.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesOriginRequestPolicyConfig_HeadersConfig_Headers_Quantity
-HeadersConfig_HeaderBehavior <OriginRequestPolicyHeaderBehavior>
Determines whether any HTTP headers are included in requests that CloudFront sends to the origin. Valid values are:
  • none – HTTP headers are not included in requests that CloudFront sends to the origin. Even when this field is set to none, any headers that are listed in a CachePolicyare included in origin requests.
  • whitelist – The HTTP headers that are listed in the Headers 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 the Headers type are included in requests that CloudFront sends to the origin. The additional headers are added by CloudFront.
Required?True
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesOriginRequestPolicyConfig_HeadersConfig_HeaderBehavior
-OriginRequestPolicyConfig_Comment <String>
A comment to describe the origin request policy. The comment cannot be longer than 128 characters.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-OriginRequestPolicyConfig_Name <String>
A unique name to identify the origin request policy.
Required?True
Position?Named
Accept pipeline input?True (ByPropertyName)
-QueryStrings_Item <String[]>
A list of query string names.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesOriginRequestPolicyConfig_QueryStringsConfig_QueryStrings_Items
-QueryStrings_Quantity <Int32>
The number of query string names in the Items list.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesOriginRequestPolicyConfig_QueryStringsConfig_QueryStrings_Quantity
-QueryStringsConfig_QueryStringBehavior <OriginRequestPolicyQueryStringBehavior>
Determines whether any URL query strings in viewer requests are included in requests that CloudFront sends to the origin. Valid values are:
  • none – Query strings in viewer requests are not included in requests that CloudFront sends to the origin. Even when this field is set to none, any query strings that are listed in a CachePolicyare included in origin requests.
  • whitelist – The query strings in viewer requests that are listed in the QueryStringNames 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.
Required?True
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesOriginRequestPolicyConfig_QueryStringsConfig_QueryStringBehavior
-Select <String>
Use the -Select parameter to control the cmdlet output. The default value is '*'. Specifying -Select '*' will result in the cmdlet returning the whole service response (Amazon.CloudFront.Model.CreateOriginRequestPolicyResponse). Specifying the name of a property of type Amazon.CloudFront.Model.CreateOriginRequestPolicyResponse will result in that property being returned. Specifying -Select '^ParameterName' will result in the cmdlet returning the selected cmdlet parameter value.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)

Common Credential and Region Parameters

-AccessKey <String>
The AWS access key for the user account. This can be a temporary access key if the corresponding session token is supplied to the -SessionToken parameter.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesAK
-Credential <AWSCredentials>
An AWSCredentials object instance containing access and secret key information, and optionally a token for session-based credentials.
Required?False
Position?Named
Accept pipeline input?True (ByValue, ByPropertyName)
-EndpointUrl <String>
The endpoint to make the call against.Note: This parameter is primarily for internal AWS use and is not required/should not be specified for normal usage. The cmdlets normally determine which endpoint to call based on the region specified to the -Region parameter or set as default in the shell (via Set-DefaultAWSRegion). Only specify this parameter if you must direct the call to a specific custom endpoint.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-NetworkCredential <PSCredential>
Used with SAML-based authentication when ProfileName references a SAML role profile. Contains the network credentials to be supplied during authentication with the configured identity provider's endpoint. This parameter is not required if the user's default network identity can or should be used during authentication.
Required?False
Position?Named
Accept pipeline input?True (ByValue, ByPropertyName)
-ProfileLocation <String>
Used to specify the name and location of the ini-format credential file (shared with the AWS CLI and other AWS SDKs)If this optional parameter is omitted this cmdlet will search the encrypted credential file used by the AWS SDK for .NET and AWS Toolkit for Visual Studio first. If the profile is not found then the cmdlet will search in the ini-format credential file at the default location: (user's home directory)\.aws\credentials.If this parameter is specified then this cmdlet will only search the ini-format credential file at the location given.As the current folder can vary in a shell or during script execution it is advised that you use specify a fully qualified path instead of a relative path.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesAWSProfilesLocation, ProfilesLocation
-ProfileName <String>
The user-defined name of an AWS credentials or SAML-based role profile containing credential information. The profile is expected to be found in the secure credential file shared with the AWS SDK for .NET and AWS Toolkit for Visual Studio. You can also specify the name of a profile stored in the .ini-format credential file used with the AWS CLI and other AWS SDKs.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesStoredCredentials, AWSProfileName
-Region <Object>
The system name of an AWS region or an AWSRegion instance. This governs the endpoint that will be used when calling service operations. Note that the AWS resources referenced in a call are usually region-specific.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesRegionToCall
-SecretKey <String>
The AWS secret key for the user account. This can be a temporary secret key if the corresponding session token is supplied to the -SessionToken parameter.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesSK, SecretAccessKey
-SessionToken <String>
The session token if the access and secret keys are temporary session-based credentials.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesST

Outputs

This cmdlet returns an Amazon.CloudFront.Model.CreateOriginRequestPolicyResponse object containing multiple properties. The object can also be referenced from properties attached to the cmdlet entry in the $AWSHistory stack.

Supported Version

AWS Tools for PowerShell: 2.x.y.z