Access AWS S3 Bucket from AWS IoT Thing in Python3

I have been working on IoT devices recently and one of the tasks is to figure out an easy way to perform Over The Air (OTA) software update. Given that our IoT devices are registered under AWS IoT, and that the executable binary is quite small (about 6 MB), a fairly straightforward solution is to put the updated binary on an internal S3 bucket, which will be downloaded by each IoT device whenever update is needed.

However, looking deeper into this, I realized that AWS IoT authenticates IoT devices differently from other AWS resources (such as…