provisioning_templates
Creates, updates, deletes or gets a provisioning_template resource or lists provisioning_templates in a region
Overview
| Name | provisioning_templates |
| Type | Resource |
| Description | Creates a fleet provisioning template. |
| Id | awscc.iot.provisioning_templates |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
template_arn | string | |
template_name | string | |
description | string | |
enabled | boolean | |
provisioning_role_arn | string | |
template_body | string | |
template_type | string | |
pre_provisioning_hook | object | |
tags | array | |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
template_name | string | |
region | string | AWS region. |
For more information, see AWS::IoT::ProvisioningTemplate.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | provisioning_templates | INSERT | ProvisioningRoleArn, TemplateBody, region |
delete_resource | provisioning_templates | DELETE | Identifier, region |
update_resource | provisioning_templates | UPDATE | Identifier, PatchDocument, region |
list_resources | provisioning_templates_list_only | SELECT | region |
get_resource | provisioning_templates | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual provisioning_template.
SELECT
region,
template_arn,
template_name,
description,
enabled,
provisioning_role_arn,
template_body,
template_type,
pre_provisioning_hook,
tags
FROM awscc.iot.provisioning_templates
WHERE
region = 'us-east-1' AND
Identifier = '{{ template_name }}';
Lists all provisioning_templates in a region.
SELECT
region,
template_name
FROM awscc.iot.provisioning_templates_list_only
WHERE
region = 'us-east-1';
INSERT example
Use the following StackQL query and manifest file to create a new provisioning_template resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.iot.provisioning_templates (
ProvisioningRoleArn,
TemplateBody,
region
)
SELECT
'{{ provisioning_role_arn }}',
'{{ template_body }}',
'{{ region }}';
/*+ create */
INSERT INTO awscc.iot.provisioning_templates (
TemplateName,
Description,
Enabled,
ProvisioningRoleArn,
TemplateBody,
TemplateType,
PreProvisioningHook,
Tags,
region
)
SELECT
'{{ template_name }}',
'{{ description }}',
'{{ enabled }}',
'{{ provisioning_role_arn }}',
'{{ template_body }}',
'{{ template_type }}',
'{{ pre_provisioning_hook }}',
'{{ tags }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: provisioning_template
props:
- name: template_name
value: '{{ template_name }}'
- name: description
value: '{{ description }}'
- name: enabled
value: '{{ enabled }}'
- name: provisioning_role_arn
value: '{{ provisioning_role_arn }}'
- name: template_body
value: '{{ template_body }}'
- name: template_type
value: '{{ template_type }}'
- name: pre_provisioning_hook
value:
target_arn: '{{ target_arn }}'
payload_version: '{{ payload_version }}'
- name: tags
value:
- key: '{{ key }}'
value: '{{ value }}'
UPDATE example
Use the following StackQL query and manifest file to update a provisioning_template resource, using stack-deploy.
/*+ update */
UPDATE awscc.iot.provisioning_templates
SET PatchDocument = string('{{ {
"Description": description,
"Enabled": enabled,
"ProvisioningRoleArn": provisioning_role_arn,
"TemplateBody": template_body,
"PreProvisioningHook": pre_provisioning_hook,
"Tags": tags
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ template_name }}';
DELETE example
/*+ delete */
DELETE FROM awscc.iot.provisioning_templates
WHERE
Identifier = '{{ template_name }}' AND
region = 'us-east-1';
Permissions
To operate on the provisioning_templates resource, the following permissions are required:
- Create
- Read
- Update
- Delete
- List
iam:GetRole,
iam:PassRole,
iot:CreateProvisioningTemplate,
iot:DescribeProvisioningTemplate,
iot:TagResource,
iot:ListTagsForResource,
kms:Decrypt
iot:DescribeProvisioningTemplate,
iot:ListTagsForResource,
kms:Decrypt
iam:GetRole,
iam:PassRole,
iot:UpdateProvisioningTemplate,
iot:CreateProvisioningTemplateVersion,
iot:ListProvisioningTemplateVersions,
iot:DeleteProvisioningTemplateVersion,
iot:DescribeProvisioningTemplate,
iot:TagResource,
iot:UntagResource,
iot:ListTagsForResource,
kms:Decrypt
iot:DeleteProvisioningTemplate,
iot:DescribeProvisioningTemplate,
kms:Decrypt
iot:ListProvisioningTemplates