AWS Integration

I am wondering if anyone has any other resources to share on getting a Balena device registered and communicating with AWS IOT as a Thing? Preferably to communicate with MQTT and Python. The Balena documentation on the subject is a bit confusing and lacking in details unfortunately. It would be great to have someone expand this documentation with more details.

Hi there, I believe there were some teammates that have done some sample projects with AWS IoT, I will ask around and let you know what I find.

Hey @tofino, sorry for the delay on this reply.

I’ve created a sample example on how to connect your balena device to AWS IoT with MQTT using Python.

I am currently working on writing a step-by-step guide how to setup it on AWS, you can check the current repository here:

1 Like

Hey @tofino, I’ve just released a blog post showing how to connect balena with AWS IoT MQTT broker with python. Check it out at

Hope it helps on your project!



I follow the tutorial, but can not make it work, I keep getting this error:

I try with the aws toot certificated VeriSign Class 3 Public Primary G5 root CA certificate and also with the Amazon Root CA 1. But none of them seems to work

And this is the first part of how i copied of one of the certificates, they are based 64 on one line, separated only with spaces:


can you help me understand the problem?

Since there is some setup involved in this project, you should first check the simple stuff:

  • Are the correct device environment variables set? you need AWS_ENDPOINT, AWS_PRIVATE_CERT, AWS_ROOT_CERT and AWS_THING_CERT
  • Are the certificates encoded using openssl base64 ?
  • Have you attached your thing to the correct certificate on AWS?