job_templates
Creates, updates, deletes, gets or lists a job_templates resource.
Overview
| Name | job_templates |
| Type | Resource |
| Id | aws.iot.job_templates |
Fields
The following fields are returned by SELECT queries:
- describe_job_template
- list_job_templates
| Name | Datatype | Description |
|---|---|---|
abort_config | object | The criteria that determine when and how a job abort takes place. |
created_at | string (date-time) | The time, in seconds since the epoch, when the job template was created. |
description | string | A description of the job template. (pattern: <code>[^\p{C}]+</code>) |
destination_package_versions | array | The 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. |
document | string | The job document. |
document_source | string | An S3 link to the job document. |
job_executions_retry_config | object | The configuration that determines how many retries are allowed for each failure type for a job. |
job_executions_rollout_config | object | Allows you to create a staged rollout of a job. |
job_template_arn | string | The ARN of the job template. (pattern: <code>^arn:[!-~]+$</code>) |
job_template_id | string | The unique identifier of the job template. (pattern: <code>[a-zA-Z0-9_-]+</code>) |
maintenance_windows | array | Allows 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_config | object | Configuration for pre-signed S3 URLs. |
timeout_config | object | Specifies 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. |
| Name | Datatype | Description |
|---|---|---|
created_at | string (date-time) | The time, in seconds since the epoch, when the job template was created. |
description | string | A description of the job template. (pattern: <code>[^\p{C}]+</code>) |
job_template_arn | string | The ARN of the job template. (pattern: <code>^arn:[!-~]+$</code>) |
job_template_id | string | The unique identifier of the job template. (pattern: <code>[a-zA-Z0-9_-]+</code>) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
describe_job_template | select | job_template_id, region | Returns information about a job template. | |
list_job_templates | select | region | maxResults, nextToken | Returns a list of job templates. Requires permission to access the ListJobTemplates action. |
create_job_template | insert | job_template_id, region, description | Creates a job template. Requires permission to access the CreateJobTemplate action. | |
delete_job_template | delete | job_template_id, region | Deletes 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.
| Name | Datatype | Description |
|---|---|---|
job_template_id | string | The unique identifier of the job template to delete. |
region | string | AWS region (default: us-east-1) |
maxResults | integer | The maximum number of results to return in the list. |
nextToken | string | The token to use to return the next set of results in the list. |
SELECT examples
- describe_job_template
- list_job_templates
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
;
Returns a list of job templates. Requires permission to access the ListJobTemplates action.
SELECT
created_at,
description,
job_template_arn,
job_template_id
FROM aws.iot.job_templates
WHERE region = '{{ region }}' -- required
AND maxResults = '{{ maxResults }}'
AND nextToken = '{{ nextToken }}'
;
INSERT examples
- create_job_template
- Manifest
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
;
# Description fields are for documentation purposes
- name: job_templates
props:
- name: job_template_id
value: "{{ job_template_id }}"
description: Required parameter for the job_templates resource.
- name: region
value: "{{ region }}"
description: Required parameter for the job_templates resource.
- name: jobArn
value: "{{ jobArn }}"
- name: documentSource
value: "{{ documentSource }}"
- name: document
value: "{{ document }}"
- name: description
value: "{{ description }}"
- name: presignedUrlConfig
description: |
Configuration for pre-signed S3 URLs.
value:
roleArn: "{{ roleArn }}"
expiresInSec: {{ expiresInSec }}
- name: jobExecutionsRolloutConfig
description: |
Allows you to create a staged rollout of a job.
value:
maximumPerMinute: {{ maximumPerMinute }}
exponentialRate:
baseRatePerMinute: {{ baseRatePerMinute }}
incrementFactor: {{ incrementFactor }}
rateIncreaseCriteria:
numberOfNotifiedThings: {{ numberOfNotifiedThings }}
numberOfSucceededThings: {{ numberOfSucceededThings }}
- name: abortConfig
description: |
The criteria that determine when and how a job abort takes place.
value:
criteriaList:
- failureType: "{{ failureType }}"
action: "{{ action }}"
thresholdPercentage: {{ thresholdPercentage }}
minNumberOfExecutedThings: {{ minNumberOfExecutedThings }}
- name: timeoutConfig
description: |
Specifies 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.
value:
inProgressTimeoutInMinutes: {{ inProgressTimeoutInMinutes }}
- name: tags
value:
- Key: "{{ Key }}"
Value: "{{ Value }}"
- name: jobExecutionsRetryConfig
description: |
The configuration that determines how many retries are allowed for each failure type for a job.
value:
criteriaList:
- failureType: "{{ failureType }}"
numberOfRetries: {{ numberOfRetries }}
- name: maintenanceWindows
value:
- startTime: "{{ startTime }}"
durationInMinutes: {{ durationInMinutes }}
- name: destinationPackageVersions
value:
- "{{ destinationPackageVersions }}"
DELETE examples
- delete_job_template
Deletes the specified job template.
DELETE FROM aws.iot.job_templates
WHERE job_template_id = '{{ job_template_id }}' --required
AND region = '{{ region }}' --required
;