[ aws . cloudfront ]
Updates a response headers policy.
When you update a response headers policy, the entire policy is replaced. You cannot update some policy fields independent of others. To update a response headers policy configuration:
GetResponseHeadersPolicyConfig to get the current policy’s configuration.UpdateResponseHeadersPolicy , providing the entire response headers policy configuration, including the fields that you modified and those that you didn’t.See also: AWS API Documentation
update-response-headers-policy
--response-headers-policy-config <value>
--id <value>
[--if-match <value>]
[--cli-input-json | --cli-input-yaml]
[--generate-cli-skeleton <value>]
[--debug]
[--endpoint-url <value>]
[--no-verify-ssl]
[--no-paginate]
[--output <value>]
[--query <value>]
[--profile <value>]
[--region <value>]
[--version <value>]
[--color <value>]
[--no-sign-request]
[--ca-bundle <value>]
[--cli-read-timeout <value>]
[--cli-connect-timeout <value>]
[--cli-binary-format <value>]
[--no-cli-pager]
[--cli-auto-prompt]
[--no-cli-auto-prompt]
--response-headers-policy-config (structure)
A response headers policy configuration.
Comment -> (string)
A comment to describe the response headers policy.
The comment cannot be longer than 128 characters.
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.
CorsConfig -> (structure)
A configuration for a set of HTTP response headers that are used for cross-origin resource sharing (CORS).
AccessControlAllowOrigins -> (structure)
A list of origins (domain names) that CloudFront can use as the value for the
Access-Control-Allow-OriginHTTP response header.For more information about the
Access-Control-Allow-OriginHTTP response header, see Access-Control-Allow-Origin in the MDN Web Docs.Quantity -> (integer)
The number of origins in the list.Items -> (list)
The list of origins (domain names). You can specify
*to allow all origins.(string)
AccessControlAllowHeaders -> (structure)
A list of HTTP header names that CloudFront includes as values for the
Access-Control-Allow-HeadersHTTP response header.For more information about the
Access-Control-Allow-HeadersHTTP response header, see Access-Control-Allow-Headers in the MDN Web Docs.Quantity -> (integer)
The number of HTTP header names in the list.Items -> (list)
The list of HTTP header names. You can specify
*to allow all headers.(string)
AccessControlAllowMethods -> (structure)
A list of HTTP methods that CloudFront includes as values for the
Access-Control-Allow-MethodsHTTP response header.For more information about the
Access-Control-Allow-MethodsHTTP response header, see Access-Control-Allow-Methods in the MDN Web Docs.Quantity -> (integer)
The number of HTTP methods in the list.Items -> (list)
The list of HTTP methods. Valid values are:
GETDELETEHEADOPTIONSPATCHPOSTPUTALLALLis a special value that includes all of the listed HTTP methods.(string)
AccessControlAllowCredentials -> (boolean)
A Boolean that CloudFront uses as the value for the
Access-Control-Allow-CredentialsHTTP response header.For more information about the
Access-Control-Allow-CredentialsHTTP response header, see Access-Control-Allow-Credentials in the MDN Web Docs.AccessControlExposeHeaders -> (structure)
A list of HTTP headers that CloudFront includes as values for the
Access-Control-Expose-HeadersHTTP response header.For more information about the
Access-Control-Expose-HeadersHTTP response header, see Access-Control-Expose-Headers in the MDN Web Docs.Quantity -> (integer)
The number of HTTP headers in the list.Items -> (list)
The list of HTTP headers. You can specify
*to expose all headers.(string)
AccessControlMaxAgeSec -> (integer)
A number that CloudFront uses as the value for the
Access-Control-Max-AgeHTTP response header.For more information about the
Access-Control-Max-AgeHTTP response header, see Access-Control-Max-Age in the MDN Web Docs.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.SecurityHeadersConfig -> (structure)
A configuration for a set of security-related HTTP response headers.
XSSProtection -> (structure)
Determines whether CloudFront includes the
X-XSS-ProtectionHTTP response header and the header’s value.For more information about the
X-XSS-ProtectionHTTP response header, see X-XSS-Protection in the MDN Web Docs.Override -> (boolean)
A Boolean that determines whether CloudFront overrides theX-XSS-ProtectionHTTP response header received from the origin with the one specified in this response headers policy.Protection -> (boolean)
A Boolean that determines the value of the
X-XSS-ProtectionHTTP response header. When this setting istrue, the value of theX-XSS-Protectionheader is1. When this setting isfalse, the value of theX-XSS-Protectionheader is0.For more information about these settings, see X-XSS-Protection in the MDN Web Docs.
ModeBlock -> (boolean)
A Boolean that determines whether CloudFront includes the
mode=blockdirective in theX-XSS-Protectionheader.For more information about this directive, see X-XSS-Protection in the MDN Web Docs.
ReportUri -> (string)
A reporting URI, which CloudFront uses as the value of the
reportdirective in theX-XSS-Protectionheader.You cannot specify a
ReportUriwhenModeBlockistrue.For more information about using a reporting URL, see X-XSS-Protection in the MDN Web Docs.
FrameOptions -> (structure)
Determines whether CloudFront includes the
X-Frame-OptionsHTTP response header and the header’s value.For more information about the
X-Frame-OptionsHTTP response header, see X-Frame-Options in the MDN Web Docs.Override -> (boolean)
A Boolean that determines whether CloudFront overrides theX-Frame-OptionsHTTP response header received from the origin with the one specified in this response headers policy.FrameOption -> (string)
The value of the
X-Frame-OptionsHTTP response header. Valid values areDENYandSAMEORIGIN.For more information about these values, see X-Frame-Options in the MDN Web Docs.
ReferrerPolicy -> (structure)
Determines whether CloudFront includes the
Referrer-PolicyHTTP response header and the header’s value.For more information about the
Referrer-PolicyHTTP response header, see Referrer-Policy in the MDN Web Docs.Override -> (boolean)
A Boolean that determines whether CloudFront overrides theReferrer-PolicyHTTP response header received from the origin with the one specified in this response headers policy.ReferrerPolicy -> (string)
The value of the
Referrer-PolicyHTTP response header. Valid values are:
no-referrerno-referrer-when-downgradeoriginorigin-when-cross-originsame-originstrict-originstrict-origin-when-cross-originunsafe-urlFor more information about these values, see Referrer-Policy in the MDN Web Docs.
ContentSecurityPolicy -> (structure)
The policy directives and their values that CloudFront includes as values for the
Content-Security-PolicyHTTP response header.For more information about the
Content-Security-PolicyHTTP response header, see Content-Security-Policy in the MDN Web Docs.Override -> (boolean)
A Boolean that determines whether CloudFront overrides theContent-Security-PolicyHTTP response header received from the origin with the one specified in this response headers policy.ContentSecurityPolicy -> (string)
The policy directives and their values that CloudFront includes as values for theContent-Security-PolicyHTTP response header.ContentTypeOptions -> (structure)
Determines whether CloudFront includes the
X-Content-Type-OptionsHTTP response header with its value set tonosniff.For more information about the
X-Content-Type-OptionsHTTP response header, see X-Content-Type-Options in the MDN Web Docs.Override -> (boolean)
A Boolean that determines whether CloudFront overrides theX-Content-Type-OptionsHTTP response header received from the origin with the one specified in this response headers policy.StrictTransportSecurity -> (structure)
Determines whether CloudFront includes the
Strict-Transport-SecurityHTTP response header and the header’s value.For more information about the
Strict-Transport-SecurityHTTP response header, see Strict-Transport-Security in the MDN Web Docs.Override -> (boolean)
A Boolean that determines whether CloudFront overrides theStrict-Transport-SecurityHTTP response header received from the origin with the one specified in this response headers policy.IncludeSubdomains -> (boolean)
A Boolean that determines whether CloudFront includes theincludeSubDomainsdirective in theStrict-Transport-SecurityHTTP response header.Preload -> (boolean)
A Boolean that determines whether CloudFront includes thepreloaddirective in theStrict-Transport-SecurityHTTP response header.AccessControlMaxAgeSec -> (integer)
A number that CloudFront uses as the value for themax-agedirective in theStrict-Transport-SecurityHTTP response header.ServerTimingHeadersConfig -> (structure)
A configuration for enabling the
Server-Timingheader in HTTP responses sent from CloudFront.Enabled -> (boolean)
A Boolean that determines whether CloudFront adds theServer-Timingheader to HTTP responses that it sends in response to requests that match a cache behavior that’s associated with this response headers policy.SamplingRate -> (double)
A number 0–100 (inclusive) that specifies the percentage of responses that you want CloudFront to add theServer-Timingheader to. When you set the sampling rate to 100, CloudFront adds theServer-Timingheader 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.CustomHeadersConfig -> (structure)
A configuration for a set of custom HTTP response headers.
Quantity -> (integer)
The number of HTTP response headers in the list.Items -> (list)
The list of HTTP response headers and their values.
(structure)
An HTTP response header name and its value. CloudFront includes this header in HTTP responses that it sends for requests that match a cache behavior that’s associated with this response headers policy.
Header -> (string)
The HTTP response header name.Value -> (string)
The value for the HTTP response header.Override -> (boolean)
A Boolean that determines whether CloudFront overrides a response header with the same name received from the origin with the header specified here.RemoveHeadersConfig -> (structure)
A configuration for a set of HTTP headers to remove from the HTTP response.
Quantity -> (integer)
The number of HTTP header names in the list.Items -> (list)
The list of HTTP header names.
(structure)
The name of an HTTP header that CloudFront removes from HTTP responses to requests that match the cache behavior that this response headers policy is attached to.
Header -> (string)
The HTTP header name.
JSON Syntax:
{
"Comment": "string",
"Name": "string",
"CorsConfig": {
"AccessControlAllowOrigins": {
"Quantity": integer,
"Items": ["string", ...]
},
"AccessControlAllowHeaders": {
"Quantity": integer,
"Items": ["string", ...]
},
"AccessControlAllowMethods": {
"Quantity": integer,
"Items": ["GET"|"POST"|"OPTIONS"|"PUT"|"DELETE"|"PATCH"|"HEAD"|"ALL", ...]
},
"AccessControlAllowCredentials": true|false,
"AccessControlExposeHeaders": {
"Quantity": integer,
"Items": ["string", ...]
},
"AccessControlMaxAgeSec": integer,
"OriginOverride": true|false
},
"SecurityHeadersConfig": {
"XSSProtection": {
"Override": true|false,
"Protection": true|false,
"ModeBlock": true|false,
"ReportUri": "string"
},
"FrameOptions": {
"Override": true|false,
"FrameOption": "DENY"|"SAMEORIGIN"
},
"ReferrerPolicy": {
"Override": true|false,
"ReferrerPolicy": "no-referrer"|"no-referrer-when-downgrade"|"origin"|"origin-when-cross-origin"|"same-origin"|"strict-origin"|"strict-origin-when-cross-origin"|"unsafe-url"
},
"ContentSecurityPolicy": {
"Override": true|false,
"ContentSecurityPolicy": "string"
},
"ContentTypeOptions": {
"Override": true|false
},
"StrictTransportSecurity": {
"Override": true|false,
"IncludeSubdomains": true|false,
"Preload": true|false,
"AccessControlMaxAgeSec": integer
}
},
"ServerTimingHeadersConfig": {
"Enabled": true|false,
"SamplingRate": double
},
"CustomHeadersConfig": {
"Quantity": integer,
"Items": [
{
"Header": "string",
"Value": "string",
"Override": true|false
}
...
]
},
"RemoveHeadersConfig": {
"Quantity": integer,
"Items": [
{
"Header": "string"
}
...
]
}
}
--id (string)
The identifier for the response headers policy that you are updating.
--if-match (string)
The version of the response headers policy that you are updating.
The version is returned in the cache policy’s
ETagfield in the response toGetResponseHeadersPolicyConfig.
--cli-input-json | --cli-input-yaml (string)
Reads arguments from the JSON string provided. The JSON string follows the format provided by --generate-cli-skeleton. If other arguments are provided on the command line, those values will override the JSON-provided values. It is not possible to pass arbitrary binary values using a JSON-provided value as the string will be taken literally. This may not be specified along with --cli-input-yaml.
--generate-cli-skeleton (string)
Prints a JSON skeleton to standard output without sending an API request. If provided with no value or the value input, prints a sample input JSON that can be used as an argument for --cli-input-json. Similarly, if provided yaml-input it will print a sample input YAML that can be used with --cli-input-yaml. If provided with the value output, it validates the command inputs and returns a sample output JSON for that command. The generated JSON skeleton is not stable between versions of the AWS CLI and there are no backwards compatibility guarantees in the JSON skeleton generated.
--debug (boolean)
Turn on debug logging.
--endpoint-url (string)
Override command’s default URL with the given URL.
--no-verify-ssl (boolean)
By default, the AWS CLI uses SSL when communicating with AWS services. For each SSL connection, the AWS CLI will verify SSL certificates. This option overrides the default behavior of verifying SSL certificates.
--no-paginate (boolean)
Disable automatic pagination.
--output (string)
The formatting style for command output.
--query (string)
A JMESPath query to use in filtering the response data.
--profile (string)
Use a specific profile from your credential file.
--region (string)
The region to use. Overrides config/env settings.
--version (string)
Display the version of this tool.
--color (string)
Turn on/off color output.
--no-sign-request (boolean)
Do not sign requests. Credentials will not be loaded if this argument is provided.
--ca-bundle (string)
The CA certificate bundle to use when verifying SSL certificates. Overrides config/env settings.
--cli-read-timeout (int)
The maximum socket read time in seconds. If the value is set to 0, the socket read will be blocking and not timeout. The default value is 60 seconds.
--cli-connect-timeout (int)
The maximum socket connect time in seconds. If the value is set to 0, the socket connect will be blocking and not timeout. The default value is 60 seconds.
--cli-binary-format (string)
The formatting style to be used for binary blobs. The default format is base64. The base64 format expects binary blobs to be provided as a base64 encoded string. The raw-in-base64-out format preserves compatibility with AWS CLI V1 behavior and binary values must be passed literally. When providing contents from a file that map to a binary blob fileb:// will always be treated as binary and use the file contents directly regardless of the cli-binary-format setting. When using file:// the file contents will need to properly formatted for the configured cli-binary-format.
--no-cli-pager (boolean)
Disable cli pager for output.
--cli-auto-prompt (boolean)
Automatically prompt for CLI input parameters.
--no-cli-auto-prompt (boolean)
Disable automatically prompt for CLI input parameters.
ResponseHeadersPolicy -> (structure)
A response headers policy.
Id -> (string)
The identifier for the response headers policy.LastModifiedTime -> (timestamp)
The date and time when the response headers policy was last modified.ResponseHeadersPolicyConfig -> (structure)
A response headers policy configuration.
Comment -> (string)
A comment to describe the response headers policy.
The comment cannot be longer than 128 characters.
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.
CorsConfig -> (structure)
A configuration for a set of HTTP response headers that are used for cross-origin resource sharing (CORS).
AccessControlAllowOrigins -> (structure)
A list of origins (domain names) that CloudFront can use as the value for the
Access-Control-Allow-OriginHTTP response header.For more information about the
Access-Control-Allow-OriginHTTP response header, see Access-Control-Allow-Origin in the MDN Web Docs.Quantity -> (integer)
The number of origins in the list.Items -> (list)
The list of origins (domain names). You can specify
*to allow all origins.(string)
AccessControlAllowHeaders -> (structure)
A list of HTTP header names that CloudFront includes as values for the
Access-Control-Allow-HeadersHTTP response header.For more information about the
Access-Control-Allow-HeadersHTTP response header, see Access-Control-Allow-Headers in the MDN Web Docs.Quantity -> (integer)
The number of HTTP header names in the list.Items -> (list)
The list of HTTP header names. You can specify
*to allow all headers.(string)
AccessControlAllowMethods -> (structure)
A list of HTTP methods that CloudFront includes as values for the
Access-Control-Allow-MethodsHTTP response header.For more information about the
Access-Control-Allow-MethodsHTTP response header, see Access-Control-Allow-Methods in the MDN Web Docs.Quantity -> (integer)
The number of HTTP methods in the list.Items -> (list)
The list of HTTP methods. Valid values are:
GETDELETEHEADOPTIONSPATCHPOSTPUTALLALLis a special value that includes all of the listed HTTP methods.(string)
AccessControlAllowCredentials -> (boolean)
A Boolean that CloudFront uses as the value for the
Access-Control-Allow-CredentialsHTTP response header.For more information about the
Access-Control-Allow-CredentialsHTTP response header, see Access-Control-Allow-Credentials in the MDN Web Docs.AccessControlExposeHeaders -> (structure)
A list of HTTP headers that CloudFront includes as values for the
Access-Control-Expose-HeadersHTTP response header.For more information about the
Access-Control-Expose-HeadersHTTP response header, see Access-Control-Expose-Headers in the MDN Web Docs.Quantity -> (integer)
The number of HTTP headers in the list.Items -> (list)
The list of HTTP headers. You can specify
*to expose all headers.(string)
AccessControlMaxAgeSec -> (integer)
A number that CloudFront uses as the value for the
Access-Control-Max-AgeHTTP response header.For more information about the
Access-Control-Max-AgeHTTP response header, see Access-Control-Max-Age in the MDN Web Docs.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.SecurityHeadersConfig -> (structure)
A configuration for a set of security-related HTTP response headers.
XSSProtection -> (structure)
Determines whether CloudFront includes the
X-XSS-ProtectionHTTP response header and the header’s value.For more information about the
X-XSS-ProtectionHTTP response header, see X-XSS-Protection in the MDN Web Docs.Override -> (boolean)
A Boolean that determines whether CloudFront overrides theX-XSS-ProtectionHTTP response header received from the origin with the one specified in this response headers policy.Protection -> (boolean)
A Boolean that determines the value of the
X-XSS-ProtectionHTTP response header. When this setting istrue, the value of theX-XSS-Protectionheader is1. When this setting isfalse, the value of theX-XSS-Protectionheader is0.For more information about these settings, see X-XSS-Protection in the MDN Web Docs.
ModeBlock -> (boolean)
A Boolean that determines whether CloudFront includes the
mode=blockdirective in theX-XSS-Protectionheader.For more information about this directive, see X-XSS-Protection in the MDN Web Docs.
ReportUri -> (string)
A reporting URI, which CloudFront uses as the value of the
reportdirective in theX-XSS-Protectionheader.You cannot specify a
ReportUriwhenModeBlockistrue.For more information about using a reporting URL, see X-XSS-Protection in the MDN Web Docs.
FrameOptions -> (structure)
Determines whether CloudFront includes the
X-Frame-OptionsHTTP response header and the header’s value.For more information about the
X-Frame-OptionsHTTP response header, see X-Frame-Options in the MDN Web Docs.Override -> (boolean)
A Boolean that determines whether CloudFront overrides theX-Frame-OptionsHTTP response header received from the origin with the one specified in this response headers policy.FrameOption -> (string)
The value of the
X-Frame-OptionsHTTP response header. Valid values areDENYandSAMEORIGIN.For more information about these values, see X-Frame-Options in the MDN Web Docs.
ReferrerPolicy -> (structure)
Determines whether CloudFront includes the
Referrer-PolicyHTTP response header and the header’s value.For more information about the
Referrer-PolicyHTTP response header, see Referrer-Policy in the MDN Web Docs.Override -> (boolean)
A Boolean that determines whether CloudFront overrides theReferrer-PolicyHTTP response header received from the origin with the one specified in this response headers policy.ReferrerPolicy -> (string)
The value of the
Referrer-PolicyHTTP response header. Valid values are:
no-referrerno-referrer-when-downgradeoriginorigin-when-cross-originsame-originstrict-originstrict-origin-when-cross-originunsafe-urlFor more information about these values, see Referrer-Policy in the MDN Web Docs.
ContentSecurityPolicy -> (structure)
The policy directives and their values that CloudFront includes as values for the
Content-Security-PolicyHTTP response header.For more information about the
Content-Security-PolicyHTTP response header, see Content-Security-Policy in the MDN Web Docs.Override -> (boolean)
A Boolean that determines whether CloudFront overrides theContent-Security-PolicyHTTP response header received from the origin with the one specified in this response headers policy.ContentSecurityPolicy -> (string)
The policy directives and their values that CloudFront includes as values for theContent-Security-PolicyHTTP response header.ContentTypeOptions -> (structure)
Determines whether CloudFront includes the
X-Content-Type-OptionsHTTP response header with its value set tonosniff.For more information about the
X-Content-Type-OptionsHTTP response header, see X-Content-Type-Options in the MDN Web Docs.Override -> (boolean)
A Boolean that determines whether CloudFront overrides theX-Content-Type-OptionsHTTP response header received from the origin with the one specified in this response headers policy.StrictTransportSecurity -> (structure)
Determines whether CloudFront includes the
Strict-Transport-SecurityHTTP response header and the header’s value.For more information about the
Strict-Transport-SecurityHTTP response header, see Strict-Transport-Security in the MDN Web Docs.Override -> (boolean)
A Boolean that determines whether CloudFront overrides theStrict-Transport-SecurityHTTP response header received from the origin with the one specified in this response headers policy.IncludeSubdomains -> (boolean)
A Boolean that determines whether CloudFront includes theincludeSubDomainsdirective in theStrict-Transport-SecurityHTTP response header.Preload -> (boolean)
A Boolean that determines whether CloudFront includes thepreloaddirective in theStrict-Transport-SecurityHTTP response header.AccessControlMaxAgeSec -> (integer)
A number that CloudFront uses as the value for themax-agedirective in theStrict-Transport-SecurityHTTP response header.ServerTimingHeadersConfig -> (structure)
A configuration for enabling the
Server-Timingheader in HTTP responses sent from CloudFront.Enabled -> (boolean)
A Boolean that determines whether CloudFront adds theServer-Timingheader to HTTP responses that it sends in response to requests that match a cache behavior that’s associated with this response headers policy.SamplingRate -> (double)
A number 0–100 (inclusive) that specifies the percentage of responses that you want CloudFront to add theServer-Timingheader to. When you set the sampling rate to 100, CloudFront adds theServer-Timingheader 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.CustomHeadersConfig -> (structure)
A configuration for a set of custom HTTP response headers.
Quantity -> (integer)
The number of HTTP response headers in the list.Items -> (list)
The list of HTTP response headers and their values.
(structure)
An HTTP response header name and its value. CloudFront includes this header in HTTP responses that it sends for requests that match a cache behavior that’s associated with this response headers policy.
Header -> (string)
The HTTP response header name.Value -> (string)
The value for the HTTP response header.Override -> (boolean)
A Boolean that determines whether CloudFront overrides a response header with the same name received from the origin with the header specified here.RemoveHeadersConfig -> (structure)
A configuration for a set of HTTP headers to remove from the HTTP response.
Quantity -> (integer)
The number of HTTP header names in the list.Items -> (list)
The list of HTTP header names.
(structure)
The name of an HTTP header that CloudFront removes from HTTP responses to requests that match the cache behavior that this response headers policy is attached to.
Header -> (string)
The HTTP header name.
ETag -> (string)
The current version of the response headers policy.