:doc:`IoT <../../iot>` / Client / create_provisioning_template

****************************
create_provisioning_template
****************************



.. py:method:: IoT.Client.create_provisioning_template(**kwargs)

  

  Creates a provisioning template.

   

  Requires permission to access the `CreateProvisioningTemplate <https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions>`__ action.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/CreateProvisioningTemplate>`_  


  **Request Syntax**
  ::

    response = client.create_provisioning_template(
        templateName='string',
        description='string',
        templateBody='string',
        enabled=True|False,
        provisioningRoleArn='string',
        preProvisioningHook={
            'payloadVersion': 'string',
            'targetArn': 'string'
        },
        tags=[
            {
                'Key': 'string',
                'Value': 'string'
            },
        ],
        type='FLEET_PROVISIONING'|'JITP'
    )
    
  :type templateName: string
  :param templateName: **[REQUIRED]** 

    The name of the provisioning template.

    

  
  :type description: string
  :param description: 

    The description of the provisioning template.

    

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

    The JSON formatted contents of the provisioning template.

    

  
  :type enabled: boolean
  :param enabled: 

    True to enable the provisioning template, otherwise false.

    

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

    The role ARN for the role associated with the provisioning template. This IoT role grants permission to provision a device.

    

  
  :type preProvisioningHook: dict
  :param preProvisioningHook: 

    Creates a pre-provisioning hook template. Only supports template of type ``FLEET_PROVISIONING``. For more information about provisioning template types, see `type <https://docs.aws.amazon.com/iot/latest/apireference/API_CreateProvisioningTemplate.html#iot-CreateProvisioningTemplate-request-type>`__.

    

  
    - **payloadVersion** *(string) --* 

      The payload that was sent to the target function.

       

      *Note:* Only Lambda functions are currently supported.

      

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

      The ARN of the target function.

       

      *Note:* Only Lambda functions are currently supported.

      

    
  
  :type tags: list
  :param tags: 

    Metadata which can be used to manage the provisioning template.

     

    .. note::

      

      For URI Request parameters use format: ...key1=value1&key2=value2...

       

      For the CLI command-line parameter use format: &&tags "key1=value1&key2=value2..."

       

      For the cli-input-json file use format: "tags": "key1=value1&key2=value2..."

      

    

  
    - *(dict) --* 

      A set of key/value pairs that are used to manage the resource.

      

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

        The tag's key.

        

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

        The tag's value.

        

      
    

  :type type: string
  :param type: 

    The type you define in a provisioning template. You can create a template with only one type. You can't change the template type after its creation. The default value is ``FLEET_PROVISIONING``. For more information about provisioning template, see: `Provisioning template <https://docs.aws.amazon.com/iot/latest/developerguide/provision-template.html>`__.

    

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

    
    ::

      {
          'templateArn': 'string',
          'templateName': 'string',
          'defaultVersionId': 123
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **templateArn** *(string) --* 

        The ARN that identifies the provisioning template.

        
      

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

        The name of the provisioning template.

        
      

      - **defaultVersionId** *(integer) --* 

        The default version of the provisioning template.

        
  
  **Exceptions**
  
  *   :py:class:`IoT.Client.exceptions.InternalFailureException`

  
  *   :py:class:`IoT.Client.exceptions.InvalidRequestException`

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

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

  
  *   :py:class:`IoT.Client.exceptions.UnauthorizedException`

  
  *   :py:class:`IoT.Client.exceptions.ResourceAlreadyExistsException`

  