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 | Job templates enable you to preconfigure jobs so that you can deploy them to multiple sets of target devices. |
Id | aws.iot.job_templates |
Fields
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. |
Methods
Name | Accessible by | Required Params |
---|---|---|
create_resource | INSERT | JobTemplateId, Description, region |
delete_resource | DELETE | data__Identifier, region |
list_resources | SELECT | region |
get_resource | SELECT | data__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
.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO aws.iot.job_templates (
JobTemplateId,
Description,
region
)
SELECT
'{{ JobTemplateId }}',
'{{ Description }}',
'{{ region }}';
/*+ create */
INSERT INTO aws.iot.job_templates (
JobArn,
JobTemplateId,
Description,
Document,
DocumentSource,
TimeoutConfig,
JobExecutionsRolloutConfig,
AbortConfig,
PresignedUrlConfig,
JobExecutionsRetryConfig,
MaintenanceWindows,
DestinationPackageVersions,
Tags,
region
)
SELECT
'{{ JobArn }}',
'{{ JobTemplateId }}',
'{{ Description }}',
'{{ Document }}',
'{{ DocumentSource }}',
'{{ TimeoutConfig }}',
'{{ JobExecutionsRolloutConfig }}',
'{{ AbortConfig }}',
'{{ PresignedUrlConfig }}',
'{{ JobExecutionsRetryConfig }}',
'{{ MaintenanceWindows }}',
'{{ DestinationPackageVersions }}',
'{{ Tags }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: job_template
props:
- name: JobArn
value: '{{ JobArn }}'
- name: JobTemplateId
value: '{{ JobTemplateId }}'
- name: Description
value: '{{ Description }}'
- name: Document
value: '{{ Document }}'
- name: DocumentSource
value: '{{ DocumentSource }}'
- name: TimeoutConfig
value:
InProgressTimeoutInMinutes: '{{ InProgressTimeoutInMinutes }}'
- name: JobExecutionsRolloutConfig
value:
ExponentialRolloutRate:
BaseRatePerMinute: '{{ BaseRatePerMinute }}'
IncrementFactor: null
RateIncreaseCriteria:
NumberOfNotifiedThings: '{{ NumberOfNotifiedThings }}'
NumberOfSucceededThings: '{{ NumberOfSucceededThings }}'
MaximumPerMinute: '{{ MaximumPerMinute }}'
- name: AbortConfig
value:
CriteriaList:
- Action:
CloudwatchAlarm:
StateValue: '{{ StateValue }}'
AlarmName: '{{ AlarmName }}'
StateReason: '{{ StateReason }}'
RoleArn: '{{ RoleArn }}'
CloudwatchLogs:
LogGroupName: '{{ LogGroupName }}'
RoleArn: '{{ RoleArn }}'
BatchMode: '{{ BatchMode }}'
CloudwatchMetric:
MetricName: '{{ MetricName }}'
MetricValue: '{{ MetricValue }}'
MetricNamespace: '{{ MetricNamespace }}'
MetricUnit: '{{ MetricUnit }}'
RoleArn: '{{ RoleArn }}'
MetricTimestamp: '{{ MetricTimestamp }}'
DynamoDB:
TableName: '{{ TableName }}'
PayloadField: '{{ PayloadField }}'
RangeKeyField: '{{ RangeKeyField }}'
HashKeyField: '{{ HashKeyField }}'
RangeKeyValue: '{{ RangeKeyValue }}'
RangeKeyType: '{{ RangeKeyType }}'
HashKeyType: '{{ HashKeyType }}'
HashKeyValue: '{{ HashKeyValue }}'
RoleArn: '{{ RoleArn }}'
DynamoDBv2:
PutItem:
TableName: '{{ TableName }}'
RoleArn: '{{ RoleArn }}'
Elasticsearch:
Type: '{{ Type }}'
Index: '{{ Index }}'
Id: '{{ Id }}'
Endpoint: '{{ Endpoint }}'
RoleArn: '{{ RoleArn }}'
Firehose:
DeliveryStreamName: '{{ DeliveryStreamName }}'
RoleArn: '{{ RoleArn }}'
Separator: '{{ Separator }}'
BatchMode: '{{ BatchMode }}'
Http:
ConfirmationUrl: '{{ ConfirmationUrl }}'
Headers:
- Value: '{{ Value }}'
Key: '{{ Key }}'
Url: '{{ Url }}'
Auth:
Sigv4:
ServiceName: '{{ ServiceName }}'
SigningRegion: '{{ SigningRegion }}'
RoleArn: '{{ RoleArn }}'
IotAnalytics:
RoleArn: '{{ RoleArn }}'
ChannelName: '{{ ChannelName }}'
BatchMode: '{{ BatchMode }}'
IotEvents:
InputName: '{{ InputName }}'
RoleArn: '{{ RoleArn }}'
MessageId: '{{ MessageId }}'
BatchMode: '{{ BatchMode }}'
IotSiteWise:
RoleArn: '{{ RoleArn }}'
PutAssetPropertyValueEntries:
- PropertyAlias: '{{ PropertyAlias }}'
PropertyValues:
- Value:
StringValue: '{{ StringValue }}'
DoubleValue: '{{ DoubleValue }}'
BooleanValue: '{{ BooleanValue }}'
IntegerValue: '{{ IntegerValue }}'
Timestamp:
TimeInSeconds: '{{ TimeInSeconds }}'
OffsetInNanos: '{{ OffsetInNanos }}'
Quality: '{{ Quality }}'
AssetId: '{{ AssetId }}'
EntryId: '{{ EntryId }}'
PropertyId: '{{ PropertyId }}'
Kafka:
DestinationArn: '{{ DestinationArn }}'
Topic: '{{ Topic }}'
Key: '{{ Key }}'
Partition: '{{ Partition }}'
ClientProperties: {}
Headers:
- Value: '{{ Value }}'
Key: '{{ Key }}'
Kinesis:
PartitionKey: '{{ PartitionKey }}'
StreamName: '{{ StreamName }}'
RoleArn: '{{ RoleArn }}'
Lambda:
FunctionArn: '{{ FunctionArn }}'
Location:
RoleArn: '{{ RoleArn }}'
TrackerName: '{{ TrackerName }}'
DeviceId: '{{ DeviceId }}'
Latitude: '{{ Latitude }}'
Longitude: '{{ Longitude }}'
Timestamp:
Value: '{{ Value }}'
Unit: '{{ Unit }}'
OpenSearch:
Type: '{{ Type }}'
Index: '{{ Index }}'
Id: '{{ Id }}'
Endpoint: '{{ Endpoint }}'
RoleArn: '{{ RoleArn }}'
Republish:
Qos: '{{ Qos }}'
Topic: '{{ Topic }}'
RoleArn: '{{ RoleArn }}'
Headers:
PayloadFormatIndicator: '{{ PayloadFormatIndicator }}'
ContentType: '{{ ContentType }}'
ResponseTopic: '{{ ResponseTopic }}'
CorrelationData: '{{ CorrelationData }}'
MessageExpiry: '{{ MessageExpiry }}'
UserProperties:
- Key: '{{ Key }}'
Value: '{{ Value }}'
S3:
BucketName: '{{ BucketName }}'
Key: '{{ Key }}'
RoleArn: '{{ RoleArn }}'
CannedAcl: '{{ CannedAcl }}'
Sns:
TargetArn: '{{ TargetArn }}'
MessageFormat: '{{ MessageFormat }}'
RoleArn: '{{ RoleArn }}'
Sqs:
RoleArn: '{{ RoleArn }}'
UseBase64: '{{ UseBase64 }}'
QueueUrl: '{{ QueueUrl }}'
StepFunctions:
ExecutionNamePrefix: '{{ ExecutionNamePrefix }}'
StateMachineName: '{{ StateMachineName }}'
RoleArn: '{{ RoleArn }}'
Timestream:
RoleArn: '{{ RoleArn }}'
DatabaseName: '{{ DatabaseName }}'
TableName: '{{ TableName }}'
Dimensions:
- Name: '{{ Name }}'
Value: '{{ Value }}'
Timestamp:
Value: '{{ Value }}'
Unit: '{{ Unit }}'
FailureType: '{{ FailureType }}'
MinNumberOfExecutedThings: '{{ MinNumberOfExecutedThings }}'
ThresholdPercentage: null
- name: PresignedUrlConfig
value:
RoleArn: '{{ RoleArn }}'
ExpiresInSec: '{{ ExpiresInSec }}'
- name: JobExecutionsRetryConfig
value:
RetryCriteriaList:
- NumberOfRetries: '{{ NumberOfRetries }}'
FailureType: '{{ FailureType }}'
- name: MaintenanceWindows
value:
- StartTime: '{{ StartTime }}'
DurationInMinutes: '{{ DurationInMinutes }}'
- name: DestinationPackageVersions
value:
- '{{ DestinationPackageVersions[0] }}'
- name: Tags
value:
- Key: '{{ Key }}'
Value: '{{ Value }}'
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