create_response_headers_policy¶
Operation¶
create_response_headers_policy
¶
create_response_headers_policy(request: CreateResponseHeadersPolicyInput | CreateResponseHeadersPolicyInputDict | None = None, /, *, plugins: list[Plugin] | None = None, **kwargs: Unpack[CreateResponseHeadersPolicyInputDict]) -> CreateResponseHeadersPolicyOutput
Creates a response headers policy.
A response headers policy contains information about a set of HTTP headers. To create a response headers policy, you provide some metadata about the policy and a set of configurations that specify the 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, the response headers policy affects the HTTP headers that CloudFront includes in HTTP responses to requests that match the cache behavior. CloudFront adds or removes response headers according to the configuration of the response headers policy.
For more information, see Adding or removing HTTP headers in CloudFront responses in the Amazon CloudFront Developer Guide.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
CreateResponseHeadersPolicyInput | CreateResponseHeadersPolicyInputDict | None
|
The input as a model or dictionary. Pass this or keyword arguments, not both. |
None
|
plugins
|
list[Plugin] | None
|
A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations. |
None
|
**kwargs
|
Unpack[CreateResponseHeadersPolicyInputDict]
|
The input fields as keyword arguments. |
{}
|
Returns:
| Type | Description |
|---|---|
CreateResponseHeadersPolicyOutput
|
An instance of |
create_response_headers_policy
async
¶
create_response_headers_policy(request: CreateResponseHeadersPolicyInput | CreateResponseHeadersPolicyInputDict | None = None, /, *, plugins: list[Plugin] | None = None, **kwargs: Unpack[CreateResponseHeadersPolicyInputDict]) -> CreateResponseHeadersPolicyOutput
Creates a response headers policy.
A response headers policy contains information about a set of HTTP headers. To create a response headers policy, you provide some metadata about the policy and a set of configurations that specify the 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, the response headers policy affects the HTTP headers that CloudFront includes in HTTP responses to requests that match the cache behavior. CloudFront adds or removes response headers according to the configuration of the response headers policy.
For more information, see Adding or removing HTTP headers in CloudFront responses in the Amazon CloudFront Developer Guide.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
CreateResponseHeadersPolicyInput | CreateResponseHeadersPolicyInputDict | None
|
The input as a model or dictionary. Pass this or keyword arguments, not both. |
None
|
plugins
|
list[Plugin] | None
|
A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations. |
None
|
**kwargs
|
Unpack[CreateResponseHeadersPolicyInputDict]
|
The input fields as keyword arguments. |
{}
|
Returns:
| Type | Description |
|---|---|
CreateResponseHeadersPolicyOutput
|
An instance of |
Input¶
Pass the input as keyword arguments, a positional dictionary, or a positional model object. Pass plugins separately as a keyword argument.
CreateResponseHeadersPolicyInputDict
¶
Bases: TypedDict
Dictionary form of CreateResponseHeadersPolicyInput.
Attributes¶
response_headers_policy_config
instance-attribute
¶
response_headers_policy_config: Required[ResponseHeadersPolicyConfig | ResponseHeadersPolicyConfigDict]
Contains metadata about the response headers policy, and a set of configurations that specify the HTTP headers.
CreateResponseHeadersPolicyInput
dataclass
¶
Bases: _SerdeShape
Dataclass for CreateResponseHeadersPolicyInput structure.
Attributes¶
response_headers_policy_config
class-attribute
instance-attribute
¶
response_headers_policy_config: ResponseHeadersPolicyConfig | None = ...
Contains metadata about the response headers policy, and a set of configurations that specify the HTTP headers.
Output¶
CreateResponseHeadersPolicyOutput
dataclass
¶
Bases: _SerdeShape
Dataclass for CreateResponseHeadersPolicyOutput structure.
Attributes¶
e_tag
class-attribute
instance-attribute
¶
e_tag: str | None = ...
The version identifier for the current version of the response headers policy.
location
class-attribute
instance-attribute
¶
location: str | None = ...
The URL of the response headers policy.
response_headers_policy
class-attribute
instance-attribute
¶
response_headers_policy: ResponseHeadersPolicy | None = ...
Contains a response headers policy.
response_metadata
class-attribute
instance-attribute
¶
Metadata about the response that produced this output. Use this to recover the request identifiers a service's support team needs in order to investigate a call. Members of the metadata are individually optional.