How to identify update author in Device Shadow


I am facing a problem where I need to somehow include the last update author in the Device Shadow state document. For example, we have a remote console and a device which communicate the device's state through device shadow. On each update to the device shadow I would like to include an author field, to identify whether the console or the device authored the update.

I am interested in adding this author field in the Device Shadow metadata section. However I cannot find any documentation or examples online on customizing the metadata section. Can this be done? If not, what are some other ways I could include the author information in the state document.

asked 3 months ago53 views
1 Answer

Hi, the normal use of device shadows is that the device writes the updates in the reported section of the device shadow, while applications write updates in the desired section of the device shadow. If your solution can follow this pattern, eg the console is the application, then you can track if the device or the console updated the shadow document and when. If this pattern cannot be followed, you can add a field in the device shadow reported section to be populated by the writer. Finally, depending on which use you make of this information, all operations on shadow documents are logged in CloudWatch logs together with the information indicating what performed the update.



answered 3 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions