:doc:`DeviceFarm <../../devicefarm>` / Client / create_project

**************
create_project
**************



.. py:method:: DeviceFarm.Client.create_project(**kwargs)

  

  Creates a project.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/CreateProject>`_  


  **Request Syntax**
  ::

    response = client.create_project(
        name='string',
        defaultJobTimeoutMinutes=123,
        vpcConfig={
            'securityGroupIds': [
                'string',
            ],
            'subnetIds': [
                'string',
            ],
            'vpcId': 'string'
        },
        environmentVariables=[
            {
                'name': 'string',
                'value': 'string'
            },
        ],
        executionRoleArn='string'
    )
    
  :type name: string
  :param name: **[REQUIRED]** 

    The project's name.

    

  
  :type defaultJobTimeoutMinutes: integer
  :param defaultJobTimeoutMinutes: 

    Sets the execution timeout value (in minutes) for a project. All test runs in this project use the specified execution timeout value unless overridden when scheduling a run.

    

  
  :type vpcConfig: dict
  :param vpcConfig: 

    The VPC security groups and subnets that are attached to a project.

    

  
    - **securityGroupIds** *(list) --* **[REQUIRED]** 

      An array of one or more security groups IDs in your Amazon VPC.

      

    
      - *(string) --* 

      
  
    - **subnetIds** *(list) --* **[REQUIRED]** 

      An array of one or more subnet IDs in your Amazon VPC.

      

    
      - *(string) --* 

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

      The ID of the Amazon VPC.

      

    
  
  :type environmentVariables: list
  :param environmentVariables: 

    A set of environment variables which are used by default for all runs in the project. These environment variables are applied to the test run during the execution of a test spec file.

     

    For more information about using test spec files, please see `Custom test environments <https://docs.aws.amazon.com/devicefarm/latest/developerguide/custom-test-environments.html>`__ in *AWS Device Farm.*

    

  
    - *(dict) --* 

      Information about an environment variable for a project or a run.

      

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

        The name of the environment variable.

        

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

        The value of the environment variable.

        

      
    

  :type executionRoleArn: string
  :param executionRoleArn: 

    An IAM role to be assumed by the test host for all runs in the project.

    

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

    
    ::

      {
          'project': {
              'arn': 'string',
              'name': 'string',
              'defaultJobTimeoutMinutes': 123,
              'created': datetime(2015, 1, 1),
              'vpcConfig': {
                  'securityGroupIds': [
                      'string',
                  ],
                  'subnetIds': [
                      'string',
                  ],
                  'vpcId': 'string'
              },
              'environmentVariables': [
                  {
                      'name': 'string',
                      'value': 'string'
                  },
              ],
              'executionRoleArn': 'string'
          }
      }
      
    **Response Structure**

    

    - *(dict) --* 

      Represents the result of a create project request.

      
      

      - **project** *(dict) --* 

        The newly created project.

        
        

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

          The project's ARN.

          
        

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

          The project's name.

          
        

        - **defaultJobTimeoutMinutes** *(integer) --* 

          The default number of minutes (at the project level) a test run executes before it times out. The default value is 150 minutes.

          
        

        - **created** *(datetime) --* 

          When the project was created.

          
        

        - **vpcConfig** *(dict) --* 

          The VPC security groups and subnets that are attached to a project.

          
          

          - **securityGroupIds** *(list) --* 

            An array of one or more security groups IDs in your Amazon VPC.

            
            

            - *(string) --* 
        
          

          - **subnetIds** *(list) --* 

            An array of one or more subnet IDs in your Amazon VPC.

            
            

            - *(string) --* 
        
          

          - **vpcId** *(string) --* 

            The ID of the Amazon VPC.

            
      
        

        - **environmentVariables** *(list) --* 

          Environment variables associated with the project.

          
          

          - *(dict) --* 

            Information about an environment variable for a project or a run.

            
            

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

              The name of the environment variable.

              
            

            - **value** *(string) --* 

              The value of the environment variable.

              
        
      
        

        - **executionRoleArn** *(string) --* 

          The IAM execution role associated with the project.

          
    
  
  **Exceptions**
  
  *   :py:class:`DeviceFarm.Client.exceptions.ArgumentException`

  
  *   :py:class:`DeviceFarm.Client.exceptions.NotFoundException`

  
  *   :py:class:`DeviceFarm.Client.exceptions.LimitExceededException`

  
  *   :py:class:`DeviceFarm.Client.exceptions.ServiceAccountException`

  
  *   :py:class:`DeviceFarm.Client.exceptions.TagOperationException`

  

  **Examples**

  The following example creates a new project named MyProject.
  ::

    response = client.create_project(
        # A project in Device Farm is a workspace that contains test runs. A run is a test of a single app against one or more devices.
        name='MyProject',
    )
    
    print(response)

  
  Expected Output:
  ::

    {
        'project': {
            'name': 'MyProject',
            'arn': 'arn:aws:devicefarm:us-west-2:123456789101:project:5e01a8c7-c861-4c0a-b1d5-12345EXAMPLE',
            'created': datetime(2016, 8, 31, 16, 28, 59, 2, 244, 0),
        },
        'ResponseMetadata': {
            '...': '...',
        },
    }

  