provisioning_templates
Creates, updates, deletes, gets or lists a provisioning_templates resource.
Overview
| Name | provisioning_templates |
| Type | Resource |
| Id | aws.iot.provisioning_templates |
Fields
The following fields are returned by SELECT queries:
- describe_provisioning_template
- list_provisioning_templates
| Name | Datatype | Description |
|---|---|---|
creation_date | string (date-time) | The date when the provisioning template was created. |
default_version_id | integer | The default fleet template version ID. |
description | string | The description of the provisioning template. (pattern: <code>[^\p{C}]*</code>) |
enabled | boolean | True if the provisioning template is enabled, otherwise false. |
last_modified_date | string (date-time) | The date when the provisioning template was last modified. |
pre_provisioning_hook | object | Structure that contains payloadVersion and targetArn. |
provisioning_role_arn | string | The ARN of the role associated with the provisioning template. This IoT role grants permission to provision a device. |
template_arn | string | The ARN of the provisioning template. |
template_body | string | The JSON formatted contents of the provisioning template. (pattern: <code>[\s\S]*</code>) |
template_name | string | The name of the provisioning template. (pattern: <code>^[0-9A-Za-z_-]+$</code>) |
type_ | string | 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. (FLEET_PROVISIONING, JITP) |
| Name | Datatype | Description |
|---|---|---|
creation_date | string (date-time) | The date when the provisioning template summary was created. |
description | string | The description of the provisioning template. (pattern: <code>[^\p{C}]*</code>) |
enabled | boolean | True if the fleet provision template is enabled, otherwise false. |
last_modified_date | string (date-time) | The date when the provisioning template summary was last modified. |
template_arn | string | The ARN of the provisioning template. |
template_name | string | The name of the provisioning template. (pattern: <code>^[0-9A-Za-z_-]+$</code>) |
type_ | string | 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. (FLEET_PROVISIONING, JITP) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
describe_provisioning_template | select | template_name, region | Returns information about a provisioning template. Requires permission to access the DescribeProvisioningTemplate action. | |
list_provisioning_templates | select | region | maxResults, nextToken | Lists the provisioning templates in your Amazon Web Services account. Requires permission to access the ListProvisioningTemplates action. |
create_provisioning_template | insert | region, templateName, templateBody, provisioningRoleArn | Creates a provisioning template. Requires permission to access the CreateProvisioningTemplate action. | |
update_provisioning_template | update | template_name, region | Updates a provisioning template. Requires permission to access the UpdateProvisioningTemplate action. | |
delete_provisioning_template | delete | template_name, region | Deletes 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.
| Name | Datatype | Description |
|---|---|---|
region | string | AWS region (default: us-east-1) |
template_name | string | The name of the fleet provision template to delete. |
maxResults | integer | The maximum number of results to return at one time. |
nextToken | string | A token to retrieve the next set of results. |
SELECT examples
- describe_provisioning_template
- list_provisioning_templates
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
;
Lists the provisioning templates in your Amazon Web Services account. Requires permission to access the ListProvisioningTemplates action.
SELECT
creation_date,
description,
enabled,
last_modified_date,
template_arn,
template_name,
type_
FROM aws.iot.provisioning_templates
WHERE region = '{{ region }}' -- required
AND maxResults = '{{ maxResults }}'
AND nextToken = '{{ nextToken }}'
;
INSERT examples
- create_provisioning_template
- Manifest
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
;
# Description fields are for documentation purposes
- name: provisioning_templates
props:
- name: region
value: "{{ region }}"
description: Required parameter for the provisioning_templates resource.
- name: templateName
value: "{{ templateName }}"
- name: description
value: "{{ description }}"
- name: templateBody
value: "{{ templateBody }}"
- name: enabled
value: {{ enabled }}
- name: provisioningRoleArn
value: "{{ provisioningRoleArn }}"
- name: preProvisioningHook
description: |
Structure that contains payloadVersion and targetArn.
value:
payloadVersion: "{{ payloadVersion }}"
targetArn: "{{ targetArn }}"
- name: tags
value:
- Key: "{{ Key }}"
Value: "{{ Value }}"
- name: type
value: "{{ type }}"
valid_values: ['FLEET_PROVISIONING', 'JITP']
UPDATE examples
- update_provisioning_template
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
- delete_provisioning_template
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
;