:doc:`CloudWatchRUM <../../rum>` / Client / put_resource_policy

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



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

  

  Use this operation to assign a resource-based policy to a CloudWatch RUM app monitor to control access to it. Each app monitor can have one resource-based policy. The maximum size of the policy is 4 KB. To learn more about using resource policies with RUM, see `Using resource-based policies with CloudWatch RUM <https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-RUM-resource-policies.html>`__.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/rum-2018-05-10/PutResourcePolicy>`_  


  **Request Syntax**
  ::

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

    The name of the app monitor that you want to apply this resource-based policy to. To find the names of your app monitors, you can use the `ListAppMonitors <https://docs.aws.amazon.com/cloudwatchrum/latest/APIReference/API_ListAppMonitors.html>`__ operation.

    

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

    The JSON to use as the resource policy. The document can be up to 4 KB in size. For more information about the contents and syntax for this policy, see `Using resource-based policies with CloudWatch RUM <https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-RUM-resource-policies.html>`__.

    

  
  :type PolicyRevisionId: string
  :param PolicyRevisionId: 

    A string value that you can use to conditionally update your policy. You can provide the revision ID of your existing policy to make mutating requests against that policy.

     

    When you assign a policy revision ID, then later requests about that policy will be rejected with an ``InvalidPolicyRevisionIdException`` error if they don't provide the correct current revision ID.

    

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

    
    ::

      {
          'PolicyDocument': 'string',
          'PolicyRevisionId': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **PolicyDocument** *(string) --* 

        The JSON policy document that you specified.

        
      

      - **PolicyRevisionId** *(string) --* 

        The policy revision ID information that you specified.

        
  
  **Exceptions**
  
  *   :py:class:`CloudWatchRUM.Client.exceptions.PolicySizeLimitExceededException`

  
  *   :py:class:`CloudWatchRUM.Client.exceptions.InvalidPolicyRevisionIdException`

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

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

  
  *   :py:class:`CloudWatchRUM.Client.exceptions.InternalServerException`

  
  *   :py:class:`CloudWatchRUM.Client.exceptions.MalformedPolicyDocumentException`

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

  
  *   :py:class:`CloudWatchRUM.Client.exceptions.ThrottlingException`

  
  *   :py:class:`CloudWatchRUM.Client.exceptions.AccessDeniedException`

  