:doc:`Glue <../../glue>` / Client / put_resource_policy

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



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

  

  Sets the Data Catalog resource policy for access control.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/PutResourcePolicy>`_  


  **Request Syntax**
  ::

    response = client.put_resource_policy(
        PolicyInJson='string',
        ResourceArn='string',
        PolicyHashCondition='string',
        PolicyExistsCondition='MUST_EXIST'|'NOT_EXIST'|'NONE',
        EnableHybrid='TRUE'|'FALSE'
    )
    
  :type PolicyInJson: string
  :param PolicyInJson: **[REQUIRED]** 

    Contains the policy document to set, in JSON format.

    

  
  :type ResourceArn: string
  :param ResourceArn: 

    Do not use. For internal use only.

    

  
  :type PolicyHashCondition: string
  :param PolicyHashCondition: 

    The hash value returned when the previous policy was set using ``PutResourcePolicy``. Its purpose is to prevent concurrent modifications of a policy. Do not use this parameter if no previous policy has been set.

    

  
  :type PolicyExistsCondition: string
  :param PolicyExistsCondition: 

    A value of ``MUST_EXIST`` is used to update a policy. A value of ``NOT_EXIST`` is used to create a new policy. If a value of ``NONE`` or a null value is used, the call does not depend on the existence of a policy.

    

  
  :type EnableHybrid: string
  :param EnableHybrid: 

    If ``'TRUE'``, indicates that you are using both methods to grant cross-account access to Data Catalog resources:

     

    
    * By directly updating the resource policy with ``PutResourePolicy``
     
    * By using the **Grant permissions** command on the Amazon Web Services Management Console.
    

     

    Must be set to ``'TRUE'`` if you have already used the Management Console to grant cross-account access, otherwise the call fails. Default is 'FALSE'.

    

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

    
    ::

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

    

    - *(dict) --* 
      

      - **PolicyHash** *(string) --* 

        A hash of the policy that has just been set. This must be included in a subsequent call that overwrites or updates this policy.

        
  
  **Exceptions**
  
  *   :py:class:`Glue.Client.exceptions.EntityNotFoundException`

  
  *   :py:class:`Glue.Client.exceptions.InternalServiceException`

  
  *   :py:class:`Glue.Client.exceptions.OperationTimeoutException`

  
  *   :py:class:`Glue.Client.exceptions.InvalidInputException`

  
  *   :py:class:`Glue.Client.exceptions.ConditionCheckFailureException`

  