:doc:`PinpointSMSVoiceV2 <../../pinpoint-sms-voice-v2>` / Client / put_resource_policy

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



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

  

  Attaches a resource-based policy to a End User Messaging SMS resource(phone number, sender Id, phone poll, or opt-out list) that is used for sharing the resource. A shared resource can be a Pool, Opt-out list, Sender Id, or Phone number. For more information about resource-based policies, see `Working with shared resources <https://docs.aws.amazon.com/sms-voice/latest/userguide/shared-resources.html>`__ in the *End User Messaging SMS User Guide*.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/pinpoint-sms-voice-v2-2022-03-31/PutResourcePolicy>`_  


  **Request Syntax**
  ::

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

    The Amazon Resource Name (ARN) of the End User Messaging SMS resource to attach the resource-based policy to.

    

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

    The JSON formatted resource-based policy to attach.

    

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

    
    ::

      {
          'ResourceArn': 'string',
          'Policy': 'string',
          'CreatedTimestamp': datetime(2015, 1, 1)
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

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

        The Amazon Resource Name (ARN) of the End User Messaging SMS resource attached to the resource-based policy.

        
      

      - **Policy** *(string) --* 

        The JSON formatted Resource Policy.

        
      

      - **CreatedTimestamp** *(datetime) --* 

        The time when the resource-based policy was created, in `UNIX epoch time <https://www.epochconverter.com/>`__ format.

        
  
  **Exceptions**
  
  *   :py:class:`PinpointSMSVoiceV2.Client.exceptions.ThrottlingException`

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

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

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

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

  