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

**************
create_service
**************



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

  

  Create an Proton service. An Proton service is an instantiation of a service template and often includes several service instances and pipeline. For more information, see `Services <https://docs.aws.amazon.com/proton/latest/userguide/ag-services.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/CreateService>`_  


  **Request Syntax**
  ::

    response = client.create_service(
        branchName='string',
        description='string',
        name='string',
        repositoryConnectionArn='string',
        repositoryId='string',
        spec='string',
        tags=[
            {
                'key': 'string',
                'value': 'string'
            },
        ],
        templateMajorVersion='string',
        templateMinorVersion='string',
        templateName='string'
    )
    
  :type branchName: string
  :param branchName: 

    The name of the code repository branch that holds the code that's deployed in Proton. *Don't* include this parameter if your service template *doesn't* include a service pipeline.

    

  
  :type description: string
  :param description: 

    A description of the Proton service.

    

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

    The service name.

    

  
  :type repositoryConnectionArn: string
  :param repositoryConnectionArn: 

    The Amazon Resource Name (ARN) of the repository connection. For more information, see `Setting up an AWS CodeStar connection <https://docs.aws.amazon.com/proton/latest/userguide/setting-up-for-service.html#setting-up-vcontrol>`__ in the *Proton User Guide*. *Don't* include this parameter if your service template *doesn't* include a service pipeline.

    

  
  :type repositoryId: string
  :param repositoryId: 

    The ID of the code repository. *Don't* include this parameter if your service template *doesn't* include a service pipeline.

    

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

    A link to a spec file that provides inputs as defined in the service template bundle schema file. The spec file is in YAML format. *Don’t* include pipeline inputs in the spec if your service template *doesn’t* include a service pipeline. For more information, see `Create a service <https://docs.aws.amazon.com/proton/latest/userguide/ag-create-svc.html>`__ in the *Proton User Guide*.

    

  
  :type tags: list
  :param tags: 

    An optional list of metadata items that you can associate with the Proton service. 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.

        

      
    

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

    The major version of the service template that was used to create the service.

    

  
  :type templateMinorVersion: string
  :param templateMinorVersion: 

    The minor version of the service template that was used to create the service.

    

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

    The name of the service template that's used to create the service.

    

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

    
    ::

      {
          'service': {
              'arn': 'string',
              'branchName': 'string',
              'createdAt': datetime(2015, 1, 1),
              'description': 'string',
              'lastModifiedAt': datetime(2015, 1, 1),
              'name': 'string',
              'pipeline': {
                  'arn': 'string',
                  'createdAt': datetime(2015, 1, 1),
                  'deploymentStatus': 'IN_PROGRESS'|'FAILED'|'SUCCEEDED'|'DELETE_IN_PROGRESS'|'DELETE_FAILED'|'DELETE_COMPLETE'|'CANCELLING'|'CANCELLED',
                  'deploymentStatusMessage': 'string',
                  'lastAttemptedDeploymentId': 'string',
                  'lastDeploymentAttemptedAt': datetime(2015, 1, 1),
                  'lastDeploymentSucceededAt': datetime(2015, 1, 1),
                  'lastSucceededDeploymentId': 'string',
                  'spec': 'string',
                  'templateMajorVersion': 'string',
                  'templateMinorVersion': 'string',
                  'templateName': 'string'
              },
              'repositoryConnectionArn': 'string',
              'repositoryId': 'string',
              'spec': 'string',
              'status': 'CREATE_IN_PROGRESS'|'CREATE_FAILED_CLEANUP_IN_PROGRESS'|'CREATE_FAILED_CLEANUP_COMPLETE'|'CREATE_FAILED_CLEANUP_FAILED'|'CREATE_FAILED'|'ACTIVE'|'DELETE_IN_PROGRESS'|'DELETE_FAILED'|'UPDATE_IN_PROGRESS'|'UPDATE_FAILED_CLEANUP_IN_PROGRESS'|'UPDATE_FAILED_CLEANUP_COMPLETE'|'UPDATE_FAILED_CLEANUP_FAILED'|'UPDATE_FAILED'|'UPDATE_COMPLETE_CLEANUP_FAILED',
              'statusMessage': 'string',
              'templateName': 'string'
          }
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **service** *(dict) --* 

        The service detail data that's returned by Proton.

        
        

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

          The Amazon Resource Name (ARN) of the service.

          
        

        - **branchName** *(string) --* 

          The name of the code repository branch that holds the code that's deployed in Proton.

          
        

        - **createdAt** *(datetime) --* 

          The time when the service was created.

          
        

        - **description** *(string) --* 

          A description of the service.

          
        

        - **lastModifiedAt** *(datetime) --* 

          The time when the service was last modified.

          
        

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

          The name of the service.

          
        

        - **pipeline** *(dict) --* 

          The service pipeline detail data.

          
          

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

            The Amazon Resource Name (ARN) of the service pipeline.

            
          

          - **createdAt** *(datetime) --* 

            The time when the service pipeline was created.

            
          

          - **deploymentStatus** *(string) --* 

            The deployment status of the service pipeline.

            
          

          - **deploymentStatusMessage** *(string) --* 

            A service pipeline deployment status message.

            
          

          - **lastAttemptedDeploymentId** *(string) --* 

            The ID of the last attempted deployment of this service pipeline.

            
          

          - **lastDeploymentAttemptedAt** *(datetime) --* 

            The time when a deployment of the service pipeline was last attempted.

            
          

          - **lastDeploymentSucceededAt** *(datetime) --* 

            The time when the service pipeline was last deployed successfully.

            
          

          - **lastSucceededDeploymentId** *(string) --* 

            The ID of the last successful deployment of this service pipeline.

            
          

          - **spec** *(string) --* 

            The service spec that was used to create the service pipeline.

            
          

          - **templateMajorVersion** *(string) --* 

            The major version of the service template that was used to create the service pipeline.

            
          

          - **templateMinorVersion** *(string) --* 

            The minor version of the service template that was used to create the service pipeline.

            
          

          - **templateName** *(string) --* 

            The name of the service template that was used to create the service pipeline.

            
      
        

        - **repositoryConnectionArn** *(string) --* 

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

          
        

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

          The ID of the source code repository.

          
        

        - **spec** *(string) --* 

          The formatted specification that defines the service.

          
        

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

          The status of the service.

          
        

        - **statusMessage** *(string) --* 

          A service status message.

          
        

        - **templateName** *(string) --* 

          The name of the service template.

          
    
  
  **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.ResourceNotFoundException`

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

  