:doc:`AppRunner <../../apprunner>` / Client / create_connection

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



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

  

  Create an App Runner connection resource. App Runner requires a connection resource when you create App Runner services that access private repositories from certain third-party providers. You can share a connection across multiple services.

   

  A connection resource is needed to access GitHub and Bitbucket repositories. Both require a user interface approval process through the App Runner console before you can use the connection.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/apprunner-2020-05-15/CreateConnection>`_  


  **Request Syntax**
  ::

    response = client.create_connection(
        ConnectionName='string',
        ProviderType='GITHUB'|'BITBUCKET',
        Tags=[
            {
                'Key': 'string',
                'Value': 'string'
            },
        ]
    )
    
  :type ConnectionName: string
  :param ConnectionName: **[REQUIRED]** 

    A name for the new connection. It must be unique across all App Runner connections for the Amazon Web Services account in the Amazon Web Services Region.

    

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

    The source repository provider.

    

  
  :type Tags: list
  :param Tags: 

    A list of metadata items that you can associate with your connection resource. A tag is a key-value pair.

    

  
    - *(dict) --* 

      Describes a tag that is applied to an App Runner resource. A tag is a metadata item consisting of a key-value pair.

      

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

        The key of the tag.

        

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

        The value of the tag.

        

      
    

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

    
    ::

      {
          'Connection': {
              'ConnectionName': 'string',
              'ConnectionArn': 'string',
              'ProviderType': 'GITHUB'|'BITBUCKET',
              'Status': 'PENDING_HANDSHAKE'|'AVAILABLE'|'ERROR'|'DELETED',
              'CreatedAt': datetime(2015, 1, 1)
          }
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **Connection** *(dict) --* 

        A description of the App Runner connection that's created by this request.

        
        

        - **ConnectionName** *(string) --* 

          The customer-provided connection name.

          
        

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

          The Amazon Resource Name (ARN) of this connection.

          
        

        - **ProviderType** *(string) --* 

          The source repository provider.

          
        

        - **Status** *(string) --* 

          The current state of the App Runner connection. When the state is ``AVAILABLE``, you can use the connection to create an App Runner service.

          
        

        - **CreatedAt** *(datetime) --* 

          The App Runner connection creation time, expressed as a Unix time stamp.

          
    
  
  **Exceptions**
  
  *   :py:class:`AppRunner.Client.exceptions.InvalidRequestException`

  
  *   :py:class:`AppRunner.Client.exceptions.InternalServiceErrorException`

  
  *   :py:class:`AppRunner.Client.exceptions.ServiceQuotaExceededException`

  