:doc:`CodeStarconnections <../../codestar-connections>` / Client / create_connection

*****************
create_connection
*****************



.. py:method:: CodeStarconnections.Client.create_connection(**kwargs)

  

  Creates a connection that can then be given to other Amazon Web Services services like CodePipeline so that it can access third-party code repositories. The connection is in pending status until the third-party connection handshake is completed from the console.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/codestar-connections-2019-12-01/CreateConnection>`_  


  **Request Syntax**
  ::

    response = client.create_connection(
        ProviderType='Bitbucket'|'GitHub'|'GitHubEnterpriseServer'|'GitLab'|'GitLabSelfManaged',
        ConnectionName='string',
        Tags=[
            {
                'Key': 'string',
                'Value': 'string'
            },
        ],
        HostArn='string'
    )
    
  :type ProviderType: string
  :param ProviderType: 

    The name of the external provider where your third-party code repository is configured.

    

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

    The name of the connection to be created.

    

  
  :type Tags: list
  :param Tags: 

    The key-value pair to use when tagging the resource.

    

  
    - *(dict) --* 

      A tag is a key-value pair that is used to manage the resource.

       

      This tag is available for use by Amazon Web Services services that support tags.

      

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

        The tag's key.

        

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

        The tag's value.

        

      
    

  :type HostArn: string
  :param HostArn: 

    The Amazon Resource Name (ARN) of the host associated with the connection to be created.

    

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

    
    ::

      {
          'ConnectionArn': 'string',
          'Tags': [
              {
                  'Key': 'string',
                  'Value': 'string'
              },
          ]
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **ConnectionArn** *(string) --* 

        The Amazon Resource Name (ARN) of the connection to be created. The ARN is used as the connection reference when the connection is shared between Amazon Web Services services.

         

        .. note::

          

          The ARN is never reused if the connection is deleted.

          

        
      

      - **Tags** *(list) --* 

        Specifies the tags applied to the resource.

        
        

        - *(dict) --* 

          A tag is a key-value pair that is used to manage the resource.

           

          This tag is available for use by Amazon Web Services services that support tags.

          
          

          - **Key** *(string) --* 

            The tag's key.

            
          

          - **Value** *(string) --* 

            The tag's value.

            
      
    
  
  **Exceptions**
  
  *   :py:class:`CodeStarconnections.Client.exceptions.LimitExceededException`

  
  *   :py:class:`CodeStarconnections.Client.exceptions.ResourceNotFoundException`

  
  *   :py:class:`CodeStarconnections.Client.exceptions.ResourceUnavailableException`

  