:doc:`Inspector2 <../../inspector2>` / Client / create_code_security_integration

********************************
create_code_security_integration
********************************



.. py:method:: Inspector2.Client.create_code_security_integration(**kwargs)

  

  Creates a code security integration with a source code repository provider.

   

  After calling the ``CreateCodeSecurityIntegration`` operation, you complete authentication and authorization with your provider. Next you call the ``UpdateCodeSecurityIntegration`` operation to provide the ``details`` to complete the integration setup

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/inspector2-2020-06-08/CreateCodeSecurityIntegration>`_  


  **Request Syntax**
  ::

    response = client.create_code_security_integration(
        name='string',
        type='GITLAB_SELF_MANAGED'|'GITHUB',
        details={
            'gitlabSelfManaged': {
                'instanceUrl': 'string',
                'accessToken': 'string'
            }
        },
        tags={
            'string': 'string'
        }
    )
    
  :type name: string
  :param name: **[REQUIRED]** 

    The name of the code security integration.

    

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

    The type of repository provider for the integration.

    

  
  :type details: dict
  :param details: 

    The integration details specific to the repository provider type.

    .. note::    This is a Tagged Union structure. Only one of the     following top level keys can be set: ``gitlabSelfManaged``. 

  
    - **gitlabSelfManaged** *(dict) --* 

      Details specific to creating an integration with a self-managed GitLab instance.

      

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

        The URL of the self-managed GitLab instance.

        

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

        The personal access token used to authenticate with the self-managed GitLab instance.

        

      
    
  
  :type tags: dict
  :param tags: 

    The tags to apply to the code security integration.

    

  
    - *(string) --* 

    
      - *(string) --* 

      


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

    
    ::

      {
          'integrationArn': 'string',
          'status': 'PENDING'|'IN_PROGRESS'|'ACTIVE'|'INACTIVE'|'DISABLING',
          'authorizationUrl': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **integrationArn** *(string) --* 

        The Amazon Resource Name (ARN) of the created code security integration.

        
      

      - **status** *(string) --* 

        The current status of the code security integration.

        
      

      - **authorizationUrl** *(string) --* 

        The URL used to authorize the integration with the repository provider.

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

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

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

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

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

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

  