:doc:`Greengrass <../../greengrass>` / Client / create_device_definition

************************
create_device_definition
************************



.. py:method:: Greengrass.Client.create_device_definition(**kwargs)

  Creates a device definition. You may provide the initial version of the device definition now or use ''CreateDeviceDefinitionVersion'' at a later time.

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/CreateDeviceDefinition>`_  


  **Request Syntax**
  ::

    response = client.create_device_definition(
        AmznClientToken='string',
        InitialVersion={
            'Devices': [
                {
                    'CertificateArn': 'string',
                    'Id': 'string',
                    'SyncShadow': True|False,
                    'ThingArn': 'string'
                },
            ]
        },
        Name='string',
        tags={
            'string': 'string'
        }
    )
    
  :type AmznClientToken: string
  :param AmznClientToken: A client token used to correlate requests and responses.

  
  :type InitialVersion: dict
  :param InitialVersion: Information about the initial version of the device definition.

  
    - **Devices** *(list) --* A list of devices in the definition version.

    
      - *(dict) --* Information about a device.

      
        - **CertificateArn** *(string) --* **[REQUIRED]** The ARN of the certificate associated with the device.

        
        - **Id** *(string) --* **[REQUIRED]** A descriptive or arbitrary ID for the device. This value must be unique within the device definition version. Max length is 128 characters with pattern ''[a-zA-Z0-9:_-]+''.

        
        - **SyncShadow** *(boolean) --* If true, the device's local shadow will be automatically synced with the cloud.

        
        - **ThingArn** *(string) --* **[REQUIRED]** The thing ARN of the device.

        
      
  
  
  :type Name: string
  :param Name: The name of the device definition.

  
  :type tags: dict
  :param tags: Tag(s) to add to the new resource.

  
    - *(string) --* 

    
      - *(string) --* 

      


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

    
    ::

      {
          'Arn': 'string',
          'CreationTimestamp': 'string',
          'Id': 'string',
          'LastUpdatedTimestamp': 'string',
          'LatestVersion': 'string',
          'LatestVersionArn': 'string',
          'Name': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **Arn** *(string) --* The ARN of the definition.
      

      - **CreationTimestamp** *(string) --* The time, in milliseconds since the epoch, when the definition was created.
      

      - **Id** *(string) --* The ID of the definition.
      

      - **LastUpdatedTimestamp** *(string) --* The time, in milliseconds since the epoch, when the definition was last updated.
      

      - **LatestVersion** *(string) --* The ID of the latest version associated with the definition.
      

      - **LatestVersionArn** *(string) --* The ARN of the latest version associated with the definition.
      

      - **Name** *(string) --* The name of the definition.
  
  **Exceptions**
  
  *   :py:class:`Greengrass.Client.exceptions.BadRequestException`

  