Skip to main content

provisioning_templates

Creates, updates, deletes, gets or lists a provisioning_templates resource.

Overview​

Nameprovisioning_templates
TypeResource
Idaws.iot.provisioning_templates

Fields​

The following fields are returned by SELECT queries:

NameDatatypeDescription
creation_datestring (date-time)The date when the provisioning template was created.
default_version_idintegerThe default fleet template version ID.
descriptionstringThe description of the provisioning template. (pattern: <code>[^\p{C}]*</code>)
enabledbooleanTrue if the provisioning template is enabled, otherwise false.
last_modified_datestring (date-time)The date when the provisioning template was last modified.
pre_provisioning_hookobjectStructure that contains payloadVersion and targetArn.
provisioning_role_arnstringThe ARN of the role associated with the provisioning template. This IoT role grants permission to provision a device.
template_arnstringThe ARN of the provisioning template.
template_bodystringThe JSON formatted contents of the provisioning template. (pattern: <code>[\s\S]*</code>)
template_namestringThe name of the provisioning template. (pattern: <code>^[0-9A-Za-z_-]+$</code>)
type_stringThe 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. (FLEET_PROVISIONING, JITP)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_provisioning_templateselecttemplate_name, regionReturns information about a provisioning template. Requires permission to access the DescribeProvisioningTemplate action.
list_provisioning_templatesselectregionmaxResults, nextTokenLists the provisioning templates in your Amazon Web Services account. Requires permission to access the ListProvisioningTemplates action.
create_provisioning_templateinsertregion, templateName, templateBody, provisioningRoleArnCreates a provisioning template. Requires permission to access the CreateProvisioningTemplate action.
update_provisioning_templateupdatetemplate_name, regionUpdates a provisioning template. Requires permission to access the UpdateProvisioningTemplate action.
delete_provisioning_templatedeletetemplate_name, regionDeletes a provisioning template. Requires permission to access the DeleteProvisioningTemplate action.

Parameters​

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
regionstringAWS region (default: us-east-1)
template_namestringThe name of the fleet provision template to delete.
maxResultsintegerThe maximum number of results to return at one time.
nextTokenstringA token to retrieve the next set of results.

SELECT examples​

Returns information about a provisioning template. Requires permission to access the DescribeProvisioningTemplate action.

SELECT
creation_date,
default_version_id,
description,
enabled,
last_modified_date,
pre_provisioning_hook,
provisioning_role_arn,
template_arn,
template_body,
template_name,
type_
FROM aws.iot.provisioning_templates
WHERE template_name = '{{ template_name }}' -- required
AND region = '{{ region }}' -- required
;

INSERT examples​

Creates a provisioning template. Requires permission to access the CreateProvisioningTemplate action.

INSERT INTO aws.iot.provisioning_templates (
templateName,
description,
templateBody,
enabled,
provisioningRoleArn,
preProvisioningHook,
tags,
type,
region
)
SELECT
'{{ templateName }}' /* required */,
'{{ description }}',
'{{ templateBody }}' /* required */,
{{ enabled }},
'{{ provisioningRoleArn }}' /* required */,
'{{ preProvisioningHook }}',
'{{ tags }}',
'{{ type }}',
'{{ region }}'
RETURNING
default_version_id,
template_arn,
template_name
;

UPDATE examples​

Updates a provisioning template. Requires permission to access the UpdateProvisioningTemplate action.

UPDATE aws.iot.provisioning_templates
SET
description = '{{ description }}',
enabled = {{ enabled }},
defaultVersionId = {{ defaultVersionId }},
provisioningRoleArn = '{{ provisioningRoleArn }}',
preProvisioningHook = '{{ preProvisioningHook }}',
removePreProvisioningHook = {{ removePreProvisioningHook }}
WHERE
template_name = '{{ template_name }}' --required
AND region = '{{ region }}' --required;

DELETE examples​

Deletes a provisioning template. Requires permission to access the DeleteProvisioningTemplate action.

DELETE FROM aws.iot.provisioning_templates
WHERE template_name = '{{ template_name }}' --required
AND region = '{{ region }}' --required
;