:doc:`ECR <../../ecr>` / Client / put_registry_policy

*******************
put_registry_policy
*******************



.. py:method:: ECR.Client.put_registry_policy(**kwargs)

  

  Creates or updates the permissions policy for your registry.

   

  A registry policy is used to specify permissions for another Amazon Web Services account and is used when configuring cross-account replication. For more information, see `Registry permissions <https://docs.aws.amazon.com/AmazonECR/latest/userguide/registry-permissions.html>`__ in the *Amazon Elastic Container Registry User Guide*.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/PutRegistryPolicy>`_  


  **Request Syntax**
  ::

    response = client.put_registry_policy(
        policyText='string'
    )
    
  :type policyText: string
  :param policyText: **[REQUIRED]** 

    The JSON policy text to apply to your registry. The policy text follows the same format as IAM policy text. For more information, see `Registry permissions <https://docs.aws.amazon.com/AmazonECR/latest/userguide/registry-permissions.html>`__ in the *Amazon Elastic Container Registry User Guide*.

    

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

    
    ::

      {
          'registryId': 'string',
          'policyText': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **registryId** *(string) --* 

        The registry ID associated with the request.

        
      

      - **policyText** *(string) --* 

        The JSON policy text for your registry.

        
  
  **Exceptions**
  
  *   :py:class:`ECR.Client.exceptions.ServerException`

  
  *   :py:class:`ECR.Client.exceptions.InvalidParameterException`

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

  