:doc:`CloudFront <../../cloudfront>` / Client / put_resource_policy

*******************
put_resource_policy
*******************



.. py:method:: CloudFront.Client.put_resource_policy(**kwargs)

  

  Creates a resource control policy for a given CloudFront resource.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2020-05-31/PutResourcePolicy>`_  


  **Request Syntax**
  ::

    response = client.put_resource_policy(
        ResourceArn='string',
        PolicyDocument='string'
    )
    
  :type ResourceArn: string
  :param ResourceArn: **[REQUIRED]** 

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

    

  
  :type PolicyDocument: string
  :param PolicyDocument: **[REQUIRED]** 

    The JSON-formatted resource policy to create.

    

  
  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {
          'ResourceArn': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **ResourceArn** *(string) --* 

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

        
  
  **Exceptions**
  
  *   :py:class:`CloudFront.Client.exceptions.PreconditionFailed`

  
  *   :py:class:`CloudFront.Client.exceptions.AccessDenied`

  
  *   :py:class:`CloudFront.Client.exceptions.EntityNotFound`

  
  *   :py:class:`CloudFront.Client.exceptions.UnsupportedOperation`

  
  *   :py:class:`CloudFront.Client.exceptions.InvalidArgument`

  
  *   :py:class:`CloudFront.Client.exceptions.IllegalUpdate`

  