:doc:`CodeCommit <../../codecommit>` / Client / update_repository_encryption_key

********************************
update_repository_encryption_key
********************************



.. py:method:: CodeCommit.Client.update_repository_encryption_key(**kwargs)

  

  Updates the Key Management Service encryption key used to encrypt and decrypt a CodeCommit repository.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/UpdateRepositoryEncryptionKey>`_  


  **Request Syntax**
  ::

    response = client.update_repository_encryption_key(
        repositoryName='string',
        kmsKeyId='string'
    )
    
  :type repositoryName: string
  :param repositoryName: **[REQUIRED]** 

    The name of the repository for which you want to update the KMS encryption key used to encrypt and decrypt the repository.

    

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

    The ID of the encryption key. You can view the ID of an encryption key in the KMS console, or use the KMS APIs to programmatically retrieve a key ID. For more information about acceptable values for keyID, see `KeyId <https://docs.aws.amazon.com/kms/latest/APIReference/API_Decrypt.html#KMS-Decrypt-request-KeyId>`__ in the Decrypt API description in the *Key Management Service API Reference*.

    

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

    
    ::

      {
          'repositoryId': 'string',
          'kmsKeyId': 'string',
          'originalKmsKeyId': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **repositoryId** *(string) --* 

        The ID of the repository.

        
      

      - **kmsKeyId** *(string) --* 

        The ID of the encryption key.

        
      

      - **originalKmsKeyId** *(string) --* 

        The ID of the encryption key formerly used to encrypt and decrypt the repository.

        
  
  **Exceptions**
  
  *   :py:class:`CodeCommit.Client.exceptions.RepositoryNameRequiredException`

  
  *   :py:class:`CodeCommit.Client.exceptions.RepositoryDoesNotExistException`

  
  *   :py:class:`CodeCommit.Client.exceptions.InvalidRepositoryNameException`

  
  *   :py:class:`CodeCommit.Client.exceptions.EncryptionKeyRequiredException`

  
  *   :py:class:`CodeCommit.Client.exceptions.EncryptionIntegrityChecksFailedException`

  
  *   :py:class:`CodeCommit.Client.exceptions.EncryptionKeyAccessDeniedException`

  
  *   :py:class:`CodeCommit.Client.exceptions.EncryptionKeyInvalidIdException`

  
  *   :py:class:`CodeCommit.Client.exceptions.EncryptionKeyInvalidUsageException`

  
  *   :py:class:`CodeCommit.Client.exceptions.EncryptionKeyDisabledException`

  
  *   :py:class:`CodeCommit.Client.exceptions.EncryptionKeyNotFoundException`

  
  *   :py:class:`CodeCommit.Client.exceptions.EncryptionKeyUnavailableException`

  