Skip to main content

job_templates

Creates, updates, deletes or gets a job_template resource or lists job_templates in a region

Overview

Namejob_templates
TypeResource
DescriptionJob templates enable you to preconfigure jobs so that you can deploy them to multiple sets of target devices.
Idaws.iot.job_templates

Fields

NameDatatypeDescription
arnstring
job_arnstringOptional for copying a JobTemplate from a pre-existing Job configuration.
job_template_idstring
descriptionstringA description of the Job Template.
documentstringThe job document. Required if you don't specify a value for documentSource.
document_sourcestringAn S3 link to the job document to use in the template. Required if you don't specify a value for document.
timeout_configobjectSpecifies the amount of time each device has to finish its execution of the job.
job_executions_rollout_configobjectAllows you to create a staged rollout of a job.
abort_configobjectThe criteria that determine when and how a job abort takes place.
presigned_url_configobjectConfiguration for pre-signed S3 URLs.
job_executions_retry_configobject
maintenance_windowsarray
destination_package_versionsarray
tagsarrayMetadata that can be used to manage the JobTemplate.
regionstringAWS region.

Methods

NameAccessible byRequired Params
create_resourceINSERTJobTemplateId, Description, region
delete_resourceDELETEdata__Identifier, region
list_resourcesSELECTregion
get_resourceSELECTdata__Identifier, region

SELECT examples

Gets all job_templates in a region.

SELECT
region,
arn,
job_arn,
job_template_id,
description,
document,
document_source,
timeout_config,
job_executions_rollout_config,
abort_config,
presigned_url_config,
job_executions_retry_config,
maintenance_windows,
destination_package_versions,
tags
FROM aws.iot.job_templates
WHERE region = 'us-east-1';

Gets all properties from an individual job_template.

SELECT
region,
arn,
job_arn,
job_template_id,
description,
document,
document_source,
timeout_config,
job_executions_rollout_config,
abort_config,
presigned_url_config,
job_executions_retry_config,
maintenance_windows,
destination_package_versions,
tags
FROM aws.iot.job_templates
WHERE region = 'us-east-1' AND data__Identifier = '<JobTemplateId>';

INSERT example

Use the following StackQL query and manifest file to create a new job_template resource, using stack-deploy.

/*+ create */
INSERT INTO aws.iot.job_templates (
JobTemplateId,
Description,
region
)
SELECT
'{{ JobTemplateId }}',
'{{ Description }}',
'{{ region }}';

DELETE example

/*+ delete */
DELETE FROM aws.iot.job_templates
WHERE data__Identifier = '<JobTemplateId>'
AND region = 'us-east-1';

Permissions

To operate on the job_templates resource, the following permissions are required:

Create

iot:CreateJobTemplate,
iam:PassRole,
s3:GetObject,
iot:TagResource

Read

iot:DescribeJobTemplate

Delete

iot:DeleteJobTemplate

List

iot:ListJobTemplates