job_templates
Creates, updates, deletes or gets a job_template resource or lists job_templates in a region
Overview
| Name | job_templates |
| Type | Resource |
| Description | Resource 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. |
| Id | awscc.iot.job_templates |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
arn | string | |
job_arn | string | Optional for copying a JobTemplate from a pre-existing Job configuration. |
job_template_id | string | |
description | string | A description of the Job Template. |
document | string | The job document. Required if you don't specify a value for documentSource. |
document_source | string | An S3 link to the job document to use in the template. Required if you don't specify a value for document. |
timeout_config | object | Specifies the amount of time each device has to finish its execution of the job. |
job_executions_rollout_config | object | Allows you to create a staged rollout of a job. |
abort_config | object | The criteria that determine when and how a job abort takes place. |
presigned_url_config | object | Configuration for pre-signed S3 URLs. |
job_executions_retry_config | object | |
maintenance_windows | array | |
destination_package_versions | array | |
tags | array | Metadata that can be used to manage the JobTemplate. |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
job_template_id | string | |
region | string | AWS region. |
For more information, see AWS::IoT::JobTemplate.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | job_templates | INSERT | JobTemplateId, Description, region |
delete_resource | job_templates | DELETE | Identifier, region |
list_resources | job_templates_list_only | SELECT | region |
get_resource | job_templates | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
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 }}';
Lists all job_templates in a region.
SELECT
region,
job_template_id
FROM awscc.iot.job_templates_list_only
WHERE
region = '{{ region }}';
INSERT example
Use the following StackQL query and manifest file to create a new job_template resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ 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
;
/*+ create */
INSERT INTO awscc.iot.job_templates (
JobArn,
JobTemplateId,
Description,
Document,
DocumentSource,
TimeoutConfig,
JobExecutionsRolloutConfig,
AbortConfig,
PresignedUrlConfig,
JobExecutionsRetryConfig,
MaintenanceWindows,
DestinationPackageVersions,
Tags,
region
)
SELECT
'{{ 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 }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: job_template
props:
- name: job_arn
value: '{{ job_arn }}'
- name: job_template_id
value: '{{ job_template_id }}'
- name: description
value: '{{ description }}'
- name: document
value: '{{ document }}'
- name: document_source
value: '{{ document_source }}'
- name: timeout_config
value:
in_progress_timeout_in_minutes: '{{ in_progress_timeout_in_minutes }}'
- name: job_executions_rollout_config
value:
exponential_rollout_rate:
base_rate_per_minute: '{{ base_rate_per_minute }}'
increment_factor: null
rate_increase_criteria:
number_of_notified_things: '{{ number_of_notified_things }}'
number_of_succeeded_things: '{{ number_of_succeeded_things }}'
maximum_per_minute: '{{ maximum_per_minute }}'
- name: abort_config
value:
criteria_list:
- action:
cloudwatch_alarm:
state_value: '{{ state_value }}'
alarm_name: '{{ alarm_name }}'
state_reason: '{{ state_reason }}'
role_arn: '{{ role_arn }}'
cloudwatch_logs:
log_group_name: '{{ log_group_name }}'
role_arn: '{{ role_arn }}'
batch_mode: '{{ batch_mode }}'
cloudwatch_metric:
metric_name: '{{ metric_name }}'
metric_value: '{{ metric_value }}'
metric_namespace: '{{ metric_namespace }}'
metric_unit: '{{ metric_unit }}'
role_arn: '{{ role_arn }}'
metric_timestamp: '{{ metric_timestamp }}'
dynamo_db:
table_name: '{{ table_name }}'
payload_field: '{{ payload_field }}'
range_key_field: '{{ range_key_field }}'
hash_key_field: '{{ hash_key_field }}'
range_key_value: '{{ range_key_value }}'
range_key_type: '{{ range_key_type }}'
hash_key_type: '{{ hash_key_type }}'
hash_key_value: '{{ hash_key_value }}'
role_arn: '{{ role_arn }}'
dynamo_dbv2:
put_item:
table_name: '{{ table_name }}'
role_arn: '{{ role_arn }}'
elasticsearch:
type: '{{ type }}'
index: '{{ index }}'
id: '{{ id }}'
endpoint: '{{ endpoint }}'
role_arn: '{{ role_arn }}'
firehose:
delivery_stream_name: '{{ delivery_stream_name }}'
role_arn: '{{ role_arn }}'
separator: '{{ separator }}'
batch_mode: '{{ batch_mode }}'
http:
confirmation_url: '{{ confirmation_url }}'
headers:
- value: '{{ value }}'
key: '{{ key }}'
url: '{{ url }}'
auth:
sigv4:
service_name: '{{ service_name }}'
signing_region: '{{ signing_region }}'
role_arn: '{{ role_arn }}'
iot_analytics:
role_arn: '{{ role_arn }}'
channel_name: '{{ channel_name }}'
batch_mode: '{{ batch_mode }}'
iot_events:
input_name: '{{ input_name }}'
role_arn: '{{ role_arn }}'
message_id: '{{ message_id }}'
batch_mode: '{{ batch_mode }}'
iot_site_wise:
role_arn: '{{ role_arn }}'
put_asset_property_value_entries:
- property_alias: '{{ property_alias }}'
property_values:
- value:
string_value: '{{ string_value }}'
double_value: '{{ double_value }}'
boolean_value: '{{ boolean_value }}'
integer_value: '{{ integer_value }}'
timestamp:
time_in_seconds: '{{ time_in_seconds }}'
offset_in_nanos: '{{ offset_in_nanos }}'
quality: '{{ quality }}'
asset_id: '{{ asset_id }}'
entry_id: '{{ entry_id }}'
property_id: '{{ property_id }}'
kafka:
destination_arn: '{{ destination_arn }}'
topic: '{{ topic }}'
key: '{{ key }}'
partition: '{{ partition }}'
client_properties: {}
headers:
- value: '{{ value }}'
key: '{{ key }}'
kinesis:
partition_key: '{{ partition_key }}'
stream_name: '{{ stream_name }}'
role_arn: '{{ role_arn }}'
lambda:
function_arn: '{{ function_arn }}'
location:
role_arn: '{{ role_arn }}'
tracker_name: '{{ tracker_name }}'
device_id: '{{ device_id }}'
latitude: '{{ latitude }}'
longitude: '{{ longitude }}'
timestamp:
value: '{{ value }}'
unit: '{{ unit }}'
open_search:
type: '{{ type }}'
index: '{{ index }}'
id: '{{ id }}'
endpoint: '{{ endpoint }}'
role_arn: '{{ role_arn }}'
republish:
qos: '{{ qos }}'
topic: '{{ topic }}'
role_arn: '{{ role_arn }}'
headers:
payload_format_indicator: '{{ payload_format_indicator }}'
content_type: '{{ content_type }}'
response_topic: '{{ response_topic }}'
correlation_data: '{{ correlation_data }}'
message_expiry: '{{ message_expiry }}'
user_properties:
- key: '{{ key }}'
value: '{{ value }}'
s3:
bucket_name: '{{ bucket_name }}'
key: '{{ key }}'
role_arn: '{{ role_arn }}'
canned_acl: '{{ canned_acl }}'
sns:
target_arn: '{{ target_arn }}'
message_format: '{{ message_format }}'
role_arn: '{{ role_arn }}'
sqs:
role_arn: '{{ role_arn }}'
use_base64: '{{ use_base64 }}'
queue_url: '{{ queue_url }}'
step_functions:
execution_name_prefix: '{{ execution_name_prefix }}'
state_machine_name: '{{ state_machine_name }}'
role_arn: '{{ role_arn }}'
timestream:
role_arn: '{{ role_arn }}'
database_name: '{{ database_name }}'
table_name: '{{ table_name }}'
dimensions:
- name: '{{ name }}'
value: '{{ value }}'
timestamp:
value: '{{ value }}'
unit: '{{ unit }}'
failure_type: '{{ failure_type }}'
min_number_of_executed_things: '{{ min_number_of_executed_things }}'
threshold_percentage: null
- name: presigned_url_config
value:
role_arn: '{{ role_arn }}'
expires_in_sec: '{{ expires_in_sec }}'
- name: job_executions_retry_config
value:
retry_criteria_list:
- number_of_retries: '{{ number_of_retries }}'
failure_type: '{{ failure_type }}'
- name: maintenance_windows
value:
- start_time: '{{ start_time }}'
duration_in_minutes: '{{ duration_in_minutes }}'
- name: destination_package_versions
value:
- '{{ destination_package_versions[0] }}'
- name: tags
value:
- key: '{{ key }}'
value: '{{ value }}'
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:
| Parameter | Description |
|---|---|
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:
- Create
- Read
- Delete
- List
iot:CreateJobTemplate,
iam:PassRole,
s3:GetObject,
iot:TagResource
iot:DescribeJobTemplate,
iot:ListTagsForResource
iot:DeleteJobTemplate
iot:ListJobTemplates