We're working on an embedded device (using FreeRTOS) which will receive OTA updates from AWS.
We want to add some custom fields to the IoT Job Document which is used to start the OTA update.
I've been using the AWS CLI tool to create OTA jobs. Here's what I have:
aws iot create-ota-update
--profile dev
--ota-update-id my-test-ota-update
--description "OTA update generated for testing"
--targets arn:aws:iot:xxxxxxx
--protocols MQTT
--target-selection SNAPSHOT
--aws-job-executions-rollout-config "maximumPerMinute=10"
--aws-job-timeout-config "inProgressTimeoutInMinutes=60"
--files [file info json]
--role-arn arn:aws:iam::xxxxxxxxxxx
[file info json] is compact JSON representing the firmware file stream created already, and looks like this. Note that "streamId" would be the ID for a file stream I already created:
{
"fileName": "myfile",
"fileType": 0,
"fileLocation": {
"stream": {
"streamId": "xxxxxxxxxx",
"fileId": 0
}
}
}
When I use this command, the device gets sent an IoT job which looks like this:
{
"clientToken": "xxxxxxx",
"timestamp": 1679881909,
"execution": {
"jobId": "xxxxxxxxxxx",
"status": "QUEUED",
"queuedAt": 1679881895,
"lastUpdatedAt": 1679881895,
"versionNumber": 1,
"executionNumber": 1,
"jobDocument": {
"afr_ota": {
"protocols": [
"MQTT"
],
"streamname": "xxxxxxxxxxxxxx",
"files": [
{
"filepath": "myfile",
"filesize": 1249280,
"fileid": 0,
"fileType": 0
}
]
}
}
}
}
What I want is to add a field to the document, inside the "afr_ota" object.
According to the command reference, there is an option for "--additional-parameters". I tried using this - e.g.
--additional-parameters KeyName1=string,KeyName2=string
But nothing was added to the job document.
Is it possible to add fields to the job document with the AWS CLI tool?