:doc:`RedshiftServerless <../../redshift-serverless>` / Client / put_resource_policy

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



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

  

  Creates or updates a resource policy. Currently, you can use policies to share snapshots across Amazon Web Services accounts.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/redshift-serverless-2021-04-21/PutResourcePolicy>`_  


  **Request Syntax**
  ::

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

    The policy to create or update. For example, the following policy grants a user authorization to restore a snapshot.

     

    ``"{\"Version\": \"2012-10-17\", \"Statement\" : [{ \"Sid\": \"AllowUserRestoreFromSnapshot\", \"Principal\":{\"AWS\": [\"739247239426\"]}, \"Action\": [\"redshift-serverless:RestoreFromSnapshot\"] , \"Effect\": \"Allow\" }]}"``

    

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

    The Amazon Resource Name (ARN) of the account to create or update a resource policy for.

    

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

    
    ::

      {
          'resourcePolicy': {
              'policy': 'string',
              'resourceArn': 'string'
          }
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **resourcePolicy** *(dict) --* 

        The policy that was created or updated.

        
        

        - **policy** *(string) --* 

          The resource policy.

          
        

        - **resourceArn** *(string) --* 

          The Amazon Resource Name (ARN) of the policy.

          
    
  
  **Exceptions**
  
  *   :py:class:`RedshiftServerless.Client.exceptions.InternalServerException`

  
  *   :py:class:`RedshiftServerless.Client.exceptions.ResourceNotFoundException`

  
  *   :py:class:`RedshiftServerless.Client.exceptions.ValidationException`

  
  *   :py:class:`RedshiftServerless.Client.exceptions.ConflictException`

  
  *   :py:class:`RedshiftServerless.Client.exceptions.ServiceQuotaExceededException`

  