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
DescriptionResource Type definition for AWS::IoT::JobTemplate. Job templates enable you to preconfigure jobs so that you can deploy them to multiple sets of target devices.
Idawscc.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.

For more information, see AWS::IoT::JobTemplate.

Methods

NameResourceAccessible byRequired Params
create_resourcejob_templatesINSERTJobTemplateId, Description, region
delete_resourcejob_templatesDELETEIdentifier, region
list_resourcesjob_templates_list_onlySELECTregion
get_resourcejob_templatesSELECTIdentifier, region

SELECT examples

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 awscc.iot.job_templates
WHERE
region = '{{ region }}' AND
Identifier = '{{ job_template_id }}';

INSERT example

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

/*+ create */
INSERT INTO awscc.iot.job_templates (
JobTemplateId,
Description,
region
)
SELECT
'{{ job_template_id }}',
'{{ description }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

DELETE example

/*+ delete */
DELETE FROM awscc.iot.job_templates
WHERE
Identifier = '{{ job_template_id }}' AND
region = '{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

Additional Parameters

Mutable resources in the Cloud Control provider support additional optional parameters which can be supplied with INSERT, UPDATE, or DELETE operations. These include:

ParameterDescription
ClientToken
A unique identifier to ensure the idempotency of the resource request.This allows the provider to accurately distinguish between retries and new requests.
A client token is valid for 36 hours once used.
After that, a resource request with the same client token is treated as a new request.
If you do not specify a client token, one is generated for inclusion in the request.
RoleArn
The ARN of the IAM role used to perform this resource operation.The role specified must have the permissions required for this operation.
If you do not specify a role, a temporary session is created using your AWS user credentials.
TypeVersionId
For private resource types, the type version to use in this resource operation.If you do not specify a resource version, the default version is used.

Permissions

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

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