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 CreateResponseHeadersPolicy API operation.

Syntax

New-CFResponseHeadersPolicy
-ResponseHeadersPolicyConfig_Name <String>
-CorsConfig_AccessControlAllowCredential <Boolean>
-CorsConfig_AccessControlMaxAgeSec <Int32>
-StrictTransportSecurity_AccessControlMaxAgeSec <Int32>
-ResponseHeadersPolicyConfig_Comment <String>
-ContentSecurityPolicy_ContentSecurityPolicy <String>
-ServerTimingHeadersConfig_Enabled <Boolean>
-FrameOptions_FrameOption <FrameOptionsList>
-StrictTransportSecurity_IncludeSubdomain <Boolean>
-AccessControlAllowHeaders_Item <String[]>
-AccessControlAllowMethods_Item <String[]>
-AccessControlAllowOrigins_Item <String[]>
-AccessControlExposeHeaders_Item <String[]>
-CustomHeadersConfig_Item <ResponseHeadersPolicyCustomHeader[]>
-XSSProtection_ModeBlock <Boolean>
-CorsConfig_OriginOverride <Boolean>
-ContentSecurityPolicy_Override <Boolean>
-ContentTypeOptions_Override <Boolean>
-FrameOptions_Override <Boolean>
-ReferrerPolicy_Override <Boolean>
-StrictTransportSecurity_Override <Boolean>
-XSSProtection_Override <Boolean>
-StrictTransportSecurity_Preload <Boolean>
-XSSProtection_Protection <Boolean>
-AccessControlAllowHeaders_Quantity <Int32>
-AccessControlAllowMethods_Quantity <Int32>
-AccessControlAllowOrigins_Quantity <Int32>
-AccessControlExposeHeaders_Quantity <Int32>
-CustomHeadersConfig_Quantity <Int32>
-ReferrerPolicy_ReferrerPolicy <ReferrerPolicyList>
-XSSProtection_ReportUri <String>
-ServerTimingHeadersConfig_SamplingRate <Double>
-Select <String>
-PassThru <SwitchParameter>
-Force <SwitchParameter>
-ClientConfig <AmazonCloudFrontConfig>

Description

Creates a response headers policy. A response headers policy contains information about a set of HTTP response headers and their values. To create a response headers policy, you provide some metadata about the policy, and a set of configurations that specify the response headers. After you create a response headers policy, you can use its ID to attach it to one or more cache behaviors in a CloudFront distribution. When it’s attached to a cache behavior, CloudFront adds the headers in the policy to HTTP responses that it sends for requests that match the cache behavior.

Parameters

-AccessControlAllowHeaders_Item <String[]>
The list of HTTP header names. You can specify * to allow all headers.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesResponseHeadersPolicyConfig_CorsConfig_AccessControlAllowHeaders_Items
-AccessControlAllowHeaders_Quantity <Int32>
The number of HTTP header names in the list.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesResponseHeadersPolicyConfig_CorsConfig_AccessControlAllowHeaders_Quantity
-AccessControlAllowMethods_Item <String[]>
The list of HTTP methods. Valid values are:
  • GET
  • DELETE
  • HEAD
  • OPTIONS
  • PATCH
  • POST
  • PUT
  • ALL
ALL is a special value that includes all of the listed HTTP methods.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesResponseHeadersPolicyConfig_CorsConfig_AccessControlAllowMethods_Items
-AccessControlAllowMethods_Quantity <Int32>
The number of HTTP methods in the list.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesResponseHeadersPolicyConfig_CorsConfig_AccessControlAllowMethods_Quantity
-AccessControlAllowOrigins_Item <String[]>
The list of origins (domain names). You can specify * to allow all origins.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesResponseHeadersPolicyConfig_CorsConfig_AccessControlAllowOrigins_Items
-AccessControlAllowOrigins_Quantity <Int32>
The number of origins in the list.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesResponseHeadersPolicyConfig_CorsConfig_AccessControlAllowOrigins_Quantity
-AccessControlExposeHeaders_Item <String[]>
The list of HTTP headers. You can specify * to expose all headers.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesResponseHeadersPolicyConfig_CorsConfig_AccessControlExposeHeaders_Items
-AccessControlExposeHeaders_Quantity <Int32>
The number of HTTP headers in the list.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesResponseHeadersPolicyConfig_CorsConfig_AccessControlExposeHeaders_Quantity
-ClientConfig <AmazonCloudFrontConfig>
Amazon.PowerShell.Cmdlets.CF.AmazonCloudFrontClientCmdlet.ClientConfig
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-ContentSecurityPolicy_ContentSecurityPolicy <String>
The policy directives and their values that CloudFront includes as values for the Content-Security-Policy HTTP response header.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesResponseHeadersPolicyConfig_SecurityHeadersConfig_ContentSecurityPolicy_ContentSecurityPolicy
-ContentSecurityPolicy_Override <Boolean>
A Boolean that determines whether CloudFront overrides the Content-Security-Policy HTTP response header received from the origin with the one specified in this response headers policy.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesResponseHeadersPolicyConfig_SecurityHeadersConfig_ContentSecurityPolicy_Override
-ContentTypeOptions_Override <Boolean>
A Boolean that determines whether CloudFront overrides the X-Content-Type-Options HTTP response header received from the origin with the one specified in this response headers policy.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesResponseHeadersPolicyConfig_SecurityHeadersConfig_ContentTypeOptions_Override
-CorsConfig_AccessControlAllowCredential <Boolean>
A Boolean that CloudFront uses as the value for the Access-Control-Allow-Credentials HTTP response header.For more information about the Access-Control-Allow-Credentials HTTP response header, see Access-Control-Allow-Credentials in the MDN Web Docs.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesResponseHeadersPolicyConfig_CorsConfig_AccessControlAllowCredentials
-CorsConfig_AccessControlMaxAgeSec <Int32>
A number that CloudFront uses as the value for the Access-Control-Max-Age HTTP response header.For more information about the Access-Control-Max-Age HTTP response header, see Access-Control-Max-Age in the MDN Web Docs.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesResponseHeadersPolicyConfig_CorsConfig_AccessControlMaxAgeSec
-CorsConfig_OriginOverride <Boolean>
A Boolean that determines whether CloudFront overrides HTTP response headers received from the origin with the ones specified in this response headers policy.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesResponseHeadersPolicyConfig_CorsConfig_OriginOverride
-CustomHeadersConfig_Item <ResponseHeadersPolicyCustomHeader[]>
The list of HTTP response headers and their values.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesResponseHeadersPolicyConfig_CustomHeadersConfig_Items
-CustomHeadersConfig_Quantity <Int32>
The number of HTTP response headers in the list.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesResponseHeadersPolicyConfig_CustomHeadersConfig_Quantity
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)
-FrameOptions_FrameOption <FrameOptionsList>
The value of the X-Frame-Options HTTP response header. Valid values are DENY and SAMEORIGIN. For more information about these values, see X-Frame-Options in the MDN Web Docs.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesResponseHeadersPolicyConfig_SecurityHeadersConfig_FrameOptions_FrameOption
-FrameOptions_Override <Boolean>
A Boolean that determines whether CloudFront overrides the X-Frame-Options HTTP response header received from the origin with the one specified in this response headers policy.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesResponseHeadersPolicyConfig_SecurityHeadersConfig_FrameOptions_Override
-PassThru <SwitchParameter>
Changes the cmdlet behavior to return the value passed to the ResponseHeadersPolicyConfig_Name parameter. The -PassThru parameter is deprecated, use -Select '^ResponseHeadersPolicyConfig_Name' instead. This parameter will be removed in a future version.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-ReferrerPolicy_Override <Boolean>
A Boolean that determines whether CloudFront overrides the Referrer-Policy HTTP response header received from the origin with the one specified in this response headers policy.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesResponseHeadersPolicyConfig_SecurityHeadersConfig_ReferrerPolicy_Override
-ReferrerPolicy_ReferrerPolicy <ReferrerPolicyList>
The value of the Referrer-Policy HTTP response header. Valid values are:
  • no-referrer
  • no-referrer-when-downgrade
  • origin
  • origin-when-cross-origin
  • same-origin
  • strict-origin
  • strict-origin-when-cross-origin
  • unsafe-url
For more information about these values, see Referrer-Policy in the MDN Web Docs.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesResponseHeadersPolicyConfig_SecurityHeadersConfig_ReferrerPolicy_ReferrerPolicy
-ResponseHeadersPolicyConfig_Comment <String>
A comment to describe the response headers policy.The comment cannot be longer than 128 characters.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-ResponseHeadersPolicyConfig_Name <String>
A name to identify the response headers policy.The name must be unique for response headers policies in this Amazon Web Services account.
Required?True
Position?1
Accept pipeline input?True (ByValue, ByPropertyName)
-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.CreateResponseHeadersPolicyResponse). Specifying the name of a property of type Amazon.CloudFront.Model.CreateResponseHeadersPolicyResponse 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)
-ServerTimingHeadersConfig_Enabled <Boolean>
A Boolean that determines whether CloudFront adds the Server-Timing header to HTTP responses that it sends in response to requests that match a cache behavior that's associated with this response headers policy.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesResponseHeadersPolicyConfig_ServerTimingHeadersConfig_Enabled
-ServerTimingHeadersConfig_SamplingRate <Double>
A number 0–100 (inclusive) that specifies the percentage of responses that you want CloudFront to add the Server-Timing header to. When you set the sampling rate to 100, CloudFront adds the Server-Timing header to the HTTP response for every request that matches the cache behavior that this response headers policy is attached to. When you set it to 50, CloudFront adds the header to 50% of the responses for requests that match the cache behavior. You can set the sampling rate to any number 0–100 with up to four decimal places.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesResponseHeadersPolicyConfig_ServerTimingHeadersConfig_SamplingRate
-StrictTransportSecurity_AccessControlMaxAgeSec <Int32>
A number that CloudFront uses as the value for the max-age directive in the Strict-Transport-Security HTTP response header.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesResponseHeadersPolicyConfig_SecurityHeadersConfig_StrictTransportSecurity_AccessControlMaxAgeSec
-StrictTransportSecurity_IncludeSubdomain <Boolean>
A Boolean that determines whether CloudFront includes the includeSubDomains directive in the Strict-Transport-Security HTTP response header.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesResponseHeadersPolicyConfig_SecurityHeadersConfig_StrictTransportSecurity_IncludeSubdomains
-StrictTransportSecurity_Override <Boolean>
A Boolean that determines whether CloudFront overrides the Strict-Transport-Security HTTP response header received from the origin with the one specified in this response headers policy.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesResponseHeadersPolicyConfig_SecurityHeadersConfig_StrictTransportSecurity_Override
-StrictTransportSecurity_Preload <Boolean>
A Boolean that determines whether CloudFront includes the preload directive in the Strict-Transport-Security HTTP response header.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesResponseHeadersPolicyConfig_SecurityHeadersConfig_StrictTransportSecurity_Preload
-XSSProtection_ModeBlock <Boolean>
A Boolean that determines whether CloudFront includes the mode=block directive in the X-XSS-Protection header.For more information about this directive, see X-XSS-Protection in the MDN Web Docs.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesResponseHeadersPolicyConfig_SecurityHeadersConfig_XSSProtection_ModeBlock
-XSSProtection_Override <Boolean>
A Boolean that determines whether CloudFront overrides the X-XSS-Protection HTTP response header received from the origin with the one specified in this response headers policy.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesResponseHeadersPolicyConfig_SecurityHeadersConfig_XSSProtection_Override
-XSSProtection_Protection <Boolean>
A Boolean that determines the value of the X-XSS-Protection HTTP response header. When this setting is true, the value of the X-XSS-Protection header is 1. When this setting is false, the value of the X-XSS-Protection header is 0.For more information about these settings, see X-XSS-Protection in the MDN Web Docs.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesResponseHeadersPolicyConfig_SecurityHeadersConfig_XSSProtection_Protection
-XSSProtection_ReportUri <String>
A reporting URI, which CloudFront uses as the value of the report directive in the X-XSS-Protection header.You cannot specify a ReportUri when ModeBlock is true.For more information about using a reporting URL, see X-XSS-Protection in the MDN Web Docs.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesResponseHeadersPolicyConfig_SecurityHeadersConfig_XSSProtection_ReportUri

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.CreateResponseHeadersPolicyResponse 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