Skip to content

CloudFront  >  Operations  >  put_resource_policy

put_resource_policy

Operation

put_resource_policy async

put_resource_policy(input: PutResourcePolicyInput, plugins: list[Plugin] | None = None) -> PutResourcePolicyOutput

Creates a resource control policy for a given CloudFront resource.

Parameters:

Name Type Description Default
input PutResourcePolicyInput

An instance of PutResourcePolicyInput.

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
PutResourcePolicyOutput

An instance of PutResourcePolicyOutput.

Input

PutResourcePolicyInput dataclass

Bases: _SerdeShape

Dataclass for PutResourcePolicyInput structure.

Attributes

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

The JSON-formatted resource policy to create.

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

The Amazon Resource Name (ARN) of the CloudFront resource for which the policy is being created.

Output

PutResourcePolicyOutput dataclass

Bases: _SerdeShape

Dataclass for PutResourcePolicyOutput structure.

Attributes

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

The Amazon Resource Name (ARN) of the CloudFront resource for which the policy was created.

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.