:doc:`CodeBuild <../../codebuild>` / Client / put_resource_policy

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



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

  

  Stores a resource policy for the ARN of a ``Project`` or ``ReportGroup`` object.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/PutResourcePolicy>`_  


  **Request Syntax**
  ::

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

    A JSON-formatted resource policy. For more information, see `Sharing a Project <https://docs.aws.amazon.com/codebuild/latest/userguide/project-sharing.html#project-sharing-share>`__ and `Sharing a Report Group <https://docs.aws.amazon.com/codebuild/latest/userguide/report-groups-sharing.html#report-groups-sharing-share>`__ in the *CodeBuild User Guide*.

    

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

    The ARN of the ``Project`` or ``ReportGroup`` resource you want to associate with a resource policy.

    

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

    
    ::

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

    

    - *(dict) --* 
      

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

        The ARN of the ``Project`` or ``ReportGroup`` resource that is associated with a resource policy.

        
  
  **Exceptions**
  
  *   :py:class:`CodeBuild.Client.exceptions.ResourceNotFoundException`

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

  