:doc:`LexModelsV2 <../../lexv2-models>` / Client / create_resource_policy

**********************
create_resource_policy
**********************



.. py:method:: LexModelsV2.Client.create_resource_policy(**kwargs)

  

  Creates a new resource policy with the specified policy statements.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/models.lex.v2-2020-08-07/CreateResourcePolicy>`_  


  **Request Syntax**
  ::

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

    The Amazon Resource Name (ARN) of the bot or bot alias that the resource policy is attached to.

    

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

    A resource policy to add to the resource. The policy is a JSON structure that contains one or more statements that define the policy. The policy must follow the IAM syntax. For more information about the contents of a JSON policy document, see `IAM JSON policy reference <https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies.html>`__.

     

    If the policy isn't valid, Amazon Lex returns a validation exception.

    

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

    
    ::

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

    

    - *(dict) --* 
      

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

        The Amazon Resource Name (ARN) of the bot or bot alias that the resource policy was attached to.

        
      

      - **revisionId** *(string) --* 

        The current revision of the resource policy. Use the revision ID to make sure that you are updating the most current version of a resource policy when you add a policy statement to a resource, delete a resource, or update a resource.

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

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

  
  *   :py:class:`LexModelsV2.Client.exceptions.PreconditionFailedException`

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

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

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

  