:doc:`MigrationHubRefactorSpaces <../../migration-hub-refactor-spaces>` / Client / put_resource_policy

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



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

  

  Attaches a resource-based permission policy to the Amazon Web Services Migration Hub Refactor Spaces environment. The policy must contain the same actions and condition statements as the ``arn:aws:ram::aws:permission/AWSRAMDefaultPermissionRefactorSpacesEnvironment`` permission in Resource Access Manager. The policy must not contain new lines or blank lines.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/migration-hub-refactor-spaces-2021-10-26/PutResourcePolicy>`_  


  **Request Syntax**
  ::

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

    A JSON-formatted string for an Amazon Web Services resource-based policy.

    

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

    The Amazon Resource Name (ARN) of the resource to which the policy is being attached.

    

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

    
    ::

      {}
      
    **Response Structure**

    

    - *(dict) --* 
  
  **Exceptions**
  
  *   :py:class:`MigrationHubRefactorSpaces.Client.exceptions.ResourceNotFoundException`

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

  
  *   :py:class:`MigrationHubRefactorSpaces.Client.exceptions.InvalidResourcePolicyException`

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

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

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

  