Skip to main content

job_templates

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

Overview

Namejob_templates
TypeResource
Idaws.iot.job_templates

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
abort_configobjectThe criteria that determine when and how a job abort takes place.
created_atstring (date-time)The time, in seconds since the epoch, when the job template was created.
descriptionstringA description of the job template. (pattern: <code>[^\p{C}]+</code>)
destination_package_versionsarrayThe package version Amazon Resource Names (ARNs) that are installed on the device when the job successfully completes. The package version must be in either the Published or Deprecated state when the job deploys. For more information, see Package version lifecycle. Note:The following Length Constraints relates to a single ARN. Up to 25 package version ARNs are allowed.
documentstringThe job document.
document_sourcestringAn S3 link to the job document.
job_executions_retry_configobjectThe configuration that determines how many retries are allowed for each failure type for a job.
job_executions_rollout_configobjectAllows you to create a staged rollout of a job.
job_template_arnstringThe ARN of the job template. (pattern: <code>^arn:[!-~]+$</code>)
job_template_idstringThe unique identifier of the job template. (pattern: <code>[a-zA-Z0-9_-]+</code>)
maintenance_windowsarrayAllows you to configure an optional maintenance window for the rollout of a job document to all devices in the target group for a job.
presigned_url_configobjectConfiguration for pre-signed S3 URLs.
timeout_configobjectSpecifies the amount of time each device has to finish its execution of the job. A timer is started when the job execution status is set to IN_PROGRESS. If the job execution status is not set to another terminal state before the timer expires, it will be automatically set to TIMED_OUT.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_job_templateselectjob_template_id, regionReturns information about a job template.
list_job_templatesselectregionmaxResults, nextTokenReturns a list of job templates. Requires permission to access the ListJobTemplates action.
create_job_templateinsertjob_template_id, region, descriptionCreates a job template. Requires permission to access the CreateJobTemplate action.
delete_job_templatedeletejob_template_id, regionDeletes the specified job template.

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
job_template_idstringThe unique identifier of the job template to delete.
regionstringAWS region (default: us-east-1)
maxResultsintegerThe maximum number of results to return in the list.
nextTokenstringThe token to use to return the next set of results in the list.

SELECT examples

Returns information about a job template.

SELECT
abort_config,
created_at,
description,
destination_package_versions,
document,
document_source,
job_executions_retry_config,
job_executions_rollout_config,
job_template_arn,
job_template_id,
maintenance_windows,
presigned_url_config,
timeout_config
FROM aws.iot.job_templates
WHERE job_template_id = '{{ job_template_id }}' -- required
AND region = '{{ region }}' -- required
;

INSERT examples

Creates a job template. Requires permission to access the CreateJobTemplate action.

INSERT INTO aws.iot.job_templates (
jobArn,
documentSource,
document,
description,
presignedUrlConfig,
jobExecutionsRolloutConfig,
abortConfig,
timeoutConfig,
tags,
jobExecutionsRetryConfig,
maintenanceWindows,
destinationPackageVersions,
job_template_id,
region
)
SELECT
'{{ jobArn }}',
'{{ documentSource }}',
'{{ document }}',
'{{ description }}' /* required */,
'{{ presignedUrlConfig }}',
'{{ jobExecutionsRolloutConfig }}',
'{{ abortConfig }}',
'{{ timeoutConfig }}',
'{{ tags }}',
'{{ jobExecutionsRetryConfig }}',
'{{ maintenanceWindows }}',
'{{ destinationPackageVersions }}',
'{{ job_template_id }}',
'{{ region }}'
RETURNING
job_template_arn,
job_template_id
;

DELETE examples

Deletes the specified job template.

DELETE FROM aws.iot.job_templates
WHERE job_template_id = '{{ job_template_id }}' --required
AND region = '{{ region }}' --required
;