:doc:`Proton <../../proton>` / Client / create_repository

*****************
create_repository
*****************



.. py:method:: Proton.Client.create_repository(**kwargs)

  

  Create and register a link to a repository. Proton uses the link to repeatedly access the repository, to either push to it (self-managed provisioning) or pull from it (template sync). You can share a linked repository across multiple resources (like environments using self-managed provisioning, or synced templates). When you create a repository link, Proton creates a `service-linked role <https://docs.aws.amazon.com/proton/latest/userguide/using-service-linked-roles.html>`__ for you.

   

  For more information, see `Self-managed provisioning <https://docs.aws.amazon.com/proton/latest/userguide/ag-works-prov-methods.html#ag-works-prov-methods-self>`__, `Template bundles <https://docs.aws.amazon.com/proton/latest/userguide/ag-template-authoring.html#ag-template-bundles>`__, and `Template sync configurations <https://docs.aws.amazon.com/proton/latest/userguide/ag-template-sync-configs.html>`__ in the *Proton User Guide*.

  

  .. danger::

        This operation is deprecated and may not function as expected. This operation should not be used going forward and is only kept for the purpose of backwards compatiblity.


  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/proton-2020-07-20/CreateRepository>`_  


  **Request Syntax**
  ::

    response = client.create_repository(
        connectionArn='string',
        encryptionKey='string',
        name='string',
        provider='GITHUB'|'GITHUB_ENTERPRISE'|'BITBUCKET',
        tags=[
            {
                'key': 'string',
                'value': 'string'
            },
        ]
    )
    
  :type connectionArn: string
  :param connectionArn: **[REQUIRED]** 

    The Amazon Resource Name (ARN) of your AWS CodeStar connection that connects Proton to your repository provider account. For more information, see `Setting up for Proton <https://docs.aws.amazon.com/proton/latest/userguide/setting-up-for-service.html>`__ in the *Proton User Guide*.

    

  
  :type encryptionKey: string
  :param encryptionKey: 

    The ARN of your customer Amazon Web Services Key Management Service (Amazon Web Services KMS) key.

    

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

    The repository name (for example, ``myrepos/myrepo``).

    

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

    The repository provider.

    

  
  :type tags: list
  :param tags: 

    An optional list of metadata items that you can associate with the Proton repository. A tag is a key-value pair.

     

    For more information, see `Proton resources and tagging <https://docs.aws.amazon.com/proton/latest/userguide/resources.html>`__ in the *Proton User Guide*.

    

  
    - *(dict) --* 

      A description of a resource tag.

      

    
      - **key** *(string) --* **[REQUIRED]** 

        The key of the resource tag.

        

      
      - **value** *(string) --* **[REQUIRED]** 

        The value of the resource tag.

        

      
    

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

    
    ::

      {
          'repository': {
              'arn': 'string',
              'connectionArn': 'string',
              'encryptionKey': 'string',
              'name': 'string',
              'provider': 'GITHUB'|'GITHUB_ENTERPRISE'|'BITBUCKET'
          }
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **repository** *(dict) --* 

        The repository link's detail data that's returned by Proton.

        
        

        - **arn** *(string) --* 

          The Amazon Resource Name (ARN) of the linked repository.

          
        

        - **connectionArn** *(string) --* 

          The Amazon Resource Name (ARN) of your AWS CodeStar connection that connects Proton to your repository provider account.

          
        

        - **encryptionKey** *(string) --* 

          Your customer Amazon Web Services KMS encryption key.

          
        

        - **name** *(string) --* 

          The repository name.

          
        

        - **provider** *(string) --* 

          The repository provider.

          
    
  
  **Exceptions**
  
  *   :py:class:`Proton.Client.exceptions.ServiceQuotaExceededException`

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

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

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

  
  *   :py:class:`Proton.Client.exceptions.ConflictException`

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

  