Skip to main content

ota_updates

Creates, updates, deletes, gets or lists an ota_updates resource.

Overview

Nameota_updates
TypeResource
Idaws.iot.ota_updates

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
additional_parametersobjectA collection of name/value pairs
aws_iot_job_arnstringThe IoT job ARN associated with the OTA update.
aws_iot_job_idstringThe IoT job ID associated with the OTA update.
aws_job_executions_rollout_configobjectConfiguration for the rollout of OTA updates.
aws_job_presigned_url_configobjectConfiguration information for pre-signed URLs. Valid when protocols contains HTTP.
creation_datestring (date-time)The date when the OTA update was created.
descriptionstringA description of the OTA update. (pattern: <code>[^\p{C}]+</code>)
error_infoobjectError information associated with the OTA update.
last_modified_datestring (date-time)The date when the OTA update was last updated.
ota_update_arnstringThe OTA update ARN.
ota_update_filesarrayA list of files associated with the OTA update.
ota_update_idstringThe OTA update ID. (pattern: <code>[a-zA-Z0-9_-]+</code>)
ota_update_statusstringThe status of the OTA update. (CREATE_PENDING, CREATE_IN_PROGRESS, CREATE_COMPLETE, CREATE_FAILED, DELETE_IN_PROGRESS, DELETE_FAILED)
protocolsarrayThe protocol used to transfer the OTA update image. Valid values are [HTTP], [MQTT], [HTTP, MQTT]. When both HTTP and MQTT are specified, the target device can choose the protocol.
target_selectionstringSpecifies whether the OTA update will continue to run (CONTINUOUS), or will be complete after all those things specified as targets have completed the OTA update (SNAPSHOT). If continuous, the OTA update may also be run on a thing when a change is detected in a target. For example, an OTA update will run on a thing when the thing is added to a target group, even after the OTA update was completed by all things originally in the group. (CONTINUOUS, SNAPSHOT)
targetsarrayThe targets of the OTA update.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_ota_updateselectota_update_id, regionGets an OTA update. Requires permission to access the GetOTAUpdate action.
list_ota_updatesselectregionmaxResults, nextToken, otaUpdateStatusLists OTA updates. Requires permission to access the ListOTAUpdates action.
create_ota_updateinsertota_update_id, region, targets, files, roleArnCreates an IoT OTA update on a target group of things or groups. Requires permission to access the CreateOTAUpdate action.
delete_ota_updatedeleteota_update_id, regiondeleteStream, forceDeleteAWSJobDelete an OTA update. Requires permission to access the DeleteOTAUpdate action.

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
ota_update_idstringThe ID of the OTA update to delete.
regionstringAWS region (default: us-east-1)
deleteStreambooleanWhen true, the stream created by the OTAUpdate process is deleted when the OTA update is deleted. Ignored if the stream specified in the OTAUpdate is supplied by the user.
forceDeleteAWSJobbooleanWhen true, deletes the IoT job created by the OTAUpdate process even if it is "IN_PROGRESS". Otherwise, if the job is not in a terminal state ("COMPLETED" or "CANCELED") an exception will occur. The default is false.
maxResultsintegerThe maximum number of results to return at one time.
nextTokenstringA token used to retrieve the next set of results.
otaUpdateStatusstringThe OTA update job status.

SELECT examples

Gets an OTA update. Requires permission to access the GetOTAUpdate action.

SELECT
additional_parameters,
aws_iot_job_arn,
aws_iot_job_id,
aws_job_executions_rollout_config,
aws_job_presigned_url_config,
creation_date,
description,
error_info,
last_modified_date,
ota_update_arn,
ota_update_files,
ota_update_id,
ota_update_status,
protocols,
target_selection,
targets
FROM aws.iot.ota_updates
WHERE ota_update_id = '{{ ota_update_id }}' -- required
AND region = '{{ region }}' -- required
;

INSERT examples

Creates an IoT OTA update on a target group of things or groups. Requires permission to access the CreateOTAUpdate action.

INSERT INTO aws.iot.ota_updates (
description,
targets,
protocols,
targetSelection,
awsJobExecutionsRolloutConfig,
awsJobPresignedUrlConfig,
awsJobAbortConfig,
awsJobTimeoutConfig,
files,
roleArn,
additionalParameters,
tags,
ota_update_id,
region
)
SELECT
'{{ description }}',
'{{ targets }}' /* required */,
'{{ protocols }}',
'{{ targetSelection }}',
'{{ awsJobExecutionsRolloutConfig }}',
'{{ awsJobPresignedUrlConfig }}',
'{{ awsJobAbortConfig }}',
'{{ awsJobTimeoutConfig }}',
'{{ files }}' /* required */,
'{{ roleArn }}' /* required */,
'{{ additionalParameters }}',
'{{ tags }}',
'{{ ota_update_id }}',
'{{ region }}'
RETURNING
aws_iot_job_arn,
aws_iot_job_id,
ota_update_arn,
ota_update_id,
ota_update_status
;

DELETE examples

Delete an OTA update. Requires permission to access the DeleteOTAUpdate action.

DELETE FROM aws.iot.ota_updates
WHERE ota_update_id = '{{ ota_update_id }}' --required
AND region = '{{ region }}' --required
AND deleteStream = '{{ deleteStream }}'
AND forceDeleteAWSJob = '{{ forceDeleteAWSJob }}'
;