Skip to content

CloudFront  >  Operations  >  update_origin_request_policy

update_origin_request_policy

Operation

update_origin_request_policy async

update_origin_request_policy(input: UpdateOriginRequestPolicyInput, plugins: list[Plugin] | None = None) -> UpdateOriginRequestPolicyOutput

Updates an origin request policy configuration.

When you update an origin request policy configuration, all the fields are updated with the values provided in the request. You cannot update some fields independent of others. To update an origin request policy configuration:

  1. Use GetOriginRequestPolicyConfig to get the current configuration.

  2. Locally modify the fields in the origin request policy configuration that you want to update.

  3. Call UpdateOriginRequestPolicy by providing the entire origin request policy configuration, including the fields that you modified and those that you didn't.

Parameters:

Name Type Description Default
input UpdateOriginRequestPolicyInput

An instance of UpdateOriginRequestPolicyInput.

required
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

Returns:

Type Description
UpdateOriginRequestPolicyOutput

An instance of UpdateOriginRequestPolicyOutput.

Input

UpdateOriginRequestPolicyInput dataclass

Bases: _SerdeShape

Dataclass for UpdateOriginRequestPolicyInput structure.

Attributes

id class-attribute instance-attribute
id: str | None = ...

The unique identifier for the origin request policy that you are updating. The identifier is returned in a cache behavior's OriginRequestPolicyId field in the response to GetDistributionConfig.

if_match class-attribute instance-attribute
if_match: str | None = ...

The version of the origin request policy that you are updating. The version is returned in the origin request policy's ETag field in the response to GetOriginRequestPolicyConfig.

origin_request_policy_config class-attribute instance-attribute
origin_request_policy_config: OriginRequestPolicyConfig | None = ...

An origin request policy configuration.

Output

UpdateOriginRequestPolicyOutput dataclass

Bases: _SerdeShape

Dataclass for UpdateOriginRequestPolicyOutput structure.

Attributes

e_tag class-attribute instance-attribute
e_tag: str | None = ...

The current version of the origin request policy.

origin_request_policy class-attribute instance-attribute
origin_request_policy: OriginRequestPolicy | None = ...

An origin request policy.

response_metadata class-attribute instance-attribute
response_metadata: ResponseMetadata = ...

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.